-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AzDo build & general folder organisation (#7)
* Updated Readme with new functionality * updated img paths * Moved img folder into RDCManager sub-folder * Moved img folder into RDCManager sub-folder * added spaces for psm1 compilation * Added FunctionsToExport manually * Added build script for AzurePipelines
- Loading branch information
1 parent
19fca25
commit e7da5bc
Showing
7 changed files
with
128 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
using namespace System.Xml.Linq | ||
using assembly System.Xml.Linq | ||
|
||
function InitializeModule { | ||
Set-RdcConfiguration -Reset | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[cmdletbinding()] | ||
param ( | ||
$SourceFolder = "$PSScriptRoot", | ||
$Destination = "$PSScriptRoot\out" | ||
) | ||
|
||
function Get-FilesToMerge { | ||
[cmdletbinding()] | ||
param ( | ||
$Path = $PSScriptRoot | ||
) | ||
|
||
Get-ChildItem -Path $PSScriptRoot -Recurse -Include *.ps1 -Exclude build.ps1 | | ||
Sort-Object FullName | ForEach-Object { | ||
"Adding {0} to the psm1 file" -f $_.BaseName | Write-Verbose | ||
Get-Content -Path $_.FullName | Add-Content -Path $Destination\RDCManager\RDCManager.psm1 | ||
"`r" | Add-Content -Path $Destination\RDCManager\RDCManager.psm1 | ||
} | ||
} | ||
|
||
if (Test-Path -Path $PSScriptRoot\out) { | ||
Remove-Item -Path $Destination -Force -Confirm:$false -Recurse | ||
} | ||
|
||
# Remove out directory to allow rebuilding | ||
$null = New-Item -ItemType Directory -Name RDCManager -Path $PSScriptRoot\out | ||
|
||
Get-FilesToMerge | ||
|
||
"Adding InitializeModule to the psm1 file" | Write-Verbose | ||
"InitializeModule" | Add-Content -Path $Destination\RDCManager\RDCManager.psm1 | ||
|
||
"Copying Manifest file to {0}" -f $Destination | Write-Verbose | ||
Copy-Item -Path $PSScriptRoot\RDCManager\*.psd1 -Destination $Destination\RDCManager | ||
|
||
#$content -replace "^FunctionsToExport = '[*]'$", ("FunctionsToExport = @('{0}'`r`n)" -f ($pubfunctions -join "',`r`n`t'")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,91 @@ | ||
# Remote Desktop Manager File Generator ### | ||
# Remote Desktop Manager File Generator | ||
|
||
Idea taken from Kevin Marquette's RDCMan DSL to generate the entire XML for a new file. | ||
~~Idea taken from Kevin Marquette's RDCMan DSL to generate the entire XML for a new file.~~ | ||
|
||
Now **very** loosely based on Kevin Marquette's RDCMan DSL blog post | ||
|
||
https://kevinmarquette.github.io/2017-03-04-Powershell-DSL-example-RDCMan/ | ||
|
||
Reworked by [Chris Dent - Indented Automation](https://github.com/indented-automation) | ||
Entirely reworked by [Chris Dent - Indented Automation](https://github.com/indented-automation) | ||
|
||
## Usage | ||
RDCManager alllows you to group servers and store configuration data so you can effectively manage your server estate from one window. | ||
|
||
This module allows you to dynamically create the document for RDCManager by extracting the data from Active Directory. This saves you having to remember to add/remove servers as they change in your estate. | ||
|
||
The module offers the option of using the Active Directory module if RSAT tools are installed otherwise you can specify to use LDAP to perform queries. | ||
|
||
## Generating the document | ||
|
||
### Manual computers | ||
### RdcDocument | ||
This must be specified as this is the starting point for you to begin defining groups/computers. | ||
|
||
You can then define your document manually with the `RdcGroup` and `RdcComputer` functions. | ||
|
||
Generates a file based on a manually defined list of computers. | ||
```powershell | ||
RdcDocument 'manual' { | ||
RdcGroup 'Manual list' { | ||
RdcComputer @{ | ||
Name = 'somehost1' | ||
} | ||
RdcComputer @{ | ||
Name = 'somehost2' | ||
} | ||
RdcDocument MyServers { | ||
RdcGroup "My First Group" { | ||
RdcComputer -Name 'server001' -DnsHostName 'server001.fqdn.com' -IPv4address '10.0.0.1' | ||
RdcComputer -Name 'server002' -DnsHostName 'server002.fqdn.com' -IPv4address '10.0.0.2' | ||
} | ||
} | ||
``` | ||
### Manual groups. Computers from AD. | ||
#### Output | ||
 | ||
|
||
### Generating a file with specific Active Directory filtering | ||
```powershell | ||
RdcDocument 'simpleAD' { | ||
RdcGroup 'some servers' { | ||
RdcADComputer -Filter { name -like 'some*' } -Recurse | ||
} | ||
RdcGroup 'other servers' { | ||
RdcADComputer -Filter { name -like 'other*' } -Recurse | ||
RdcDocument MyServers { | ||
RdcGroup "My Group" { | ||
# Will create a group with the OU name and any computer objects within | ||
RdcADGroup -Identity 'OU=Newcastle,DC=millerb,DC=co,DC=uk' | ||
#Add -Recurse switch and it will create a group for each sub OU and add members accordingly | ||
RdcADGroup -Identity 'OU=London,DC=millerb,DC=co,DC=uk' -Recurse | ||
# Will search for a specific server provided by the filter recursing all OU's | ||
RdcADComputer -Name 'Admin*' -Recurse | ||
} | ||
} | ||
``` | ||
### Automatic creation from OU structure | ||
|
||
### Automatic creation from root of domain | ||
This will create groups replicating the OU structure which contains computer objects. | ||
|
||
```powershell | ||
RdcDocument 'SomeOU' { | ||
RdcADGroup -Identity 'OU=SomeOU,DC=somewhere,DC=com' -Recurse | ||
RdcDocument 'Domain' { | ||
RdcADGroup -Recurse | ||
} | ||
``` | ||
### Automatic creation from domain root | ||
|
||
#### Output | ||
 | ||
|
||
## Additional Functionality | ||
|
||
#### RdcConfiguration | ||
Sets the configuration to be used when generating the document. This is not required as if the AD module is detected this will be used unless ADSI is specified. If the AD Module is not available then ADSI LDAP filters will be used. | ||
|
||
```powershell | ||
RdcDocument 'Domain' { | ||
RdcADGroup -Recurse | ||
RdcConfiguration @{ | ||
SearchMode = 'ADSI' | ||
FilterFormat = 'LDAP' | ||
} | ||
``` | ||
|
||
#### RdcLogonCredential | ||
Allows credentials to be set at any level to support different domains/forests. May conflict with GPO's set to prevent saved passwords being used. | ||
|
||
```powershell | ||
RdcLogonCredential @{ | ||
Username = 'millerb-admin' | ||
Domain = 'millerb.co.uk' | ||
} | ||
``` | ||
#### RdcRemoteDesktopSetting | ||
Enables scaling of the connected client window. | ||
```powershell | ||
RdcRemoteDesktopSetting @{ | ||
SameSizeAsClientArea = $true | ||
} | ||
``` |