-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
3,886 additions
and
34 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,6 @@ | ||
################################################################################ | ||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio. | ||
################################################################################ | ||
|
||
/rds-deployment/deploy.ps1 | ||
/rds-deployment/rds-724929a8-aa00-4139-bf8f-6993254e640a.log |
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,320 @@ | ||
configuration DomainJoin | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory)] | ||
[String]$domainName, | ||
|
||
[Parameter(Mandatory)] | ||
[PSCredential]$adminCreds | ||
) | ||
|
||
Import-DscResource -ModuleName xActiveDirectory, xComputerManagement | ||
|
||
$domainCreds = New-Object System.Management.Automation.PSCredential ("$domainName\$($adminCreds.UserName)", $adminCreds.Password) | ||
|
||
Node localhost | ||
{ | ||
LocalConfigurationManager | ||
{ | ||
RebootNodeIfNeeded = $true | ||
} | ||
|
||
WindowsFeature ADPowershell | ||
{ | ||
Name = "RSAT-AD-PowerShell" | ||
Ensure = "Present" | ||
} | ||
|
||
xComputer DomainJoin | ||
{ | ||
Name = $env:COMPUTERNAME | ||
DomainName = $domainName | ||
Credential = $domainCreds | ||
DependsOn = "[WindowsFeature]ADPowershell" | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
configuration Gateway | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory)] | ||
[String]$domainName, | ||
|
||
[Parameter(Mandatory)] | ||
[PSCredential]$adminCreds | ||
) | ||
|
||
|
||
Node localhost | ||
{ | ||
LocalConfigurationManager | ||
{ | ||
RebootNodeIfNeeded = $true | ||
ConfigurationMode = "ApplyOnly" | ||
} | ||
|
||
DomainJoin DomainJoin | ||
{ | ||
domainName = $domainName | ||
adminCreds = $adminCreds | ||
} | ||
|
||
WindowsFeature RDS-Gateway | ||
{ | ||
Ensure = "Present" | ||
Name = "RDS-Gateway" | ||
} | ||
|
||
WindowsFeature RDS-Web-Access | ||
{ | ||
Ensure = "Present" | ||
Name = "RDS-Web-Access" | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
configuration SessionHost | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory)] | ||
[String]$domainName, | ||
|
||
[Parameter(Mandatory)] | ||
[PSCredential]$adminCreds | ||
) | ||
|
||
|
||
Node localhost | ||
{ | ||
LocalConfigurationManager | ||
{ | ||
RebootNodeIfNeeded = $true | ||
ConfigurationMode = "ApplyOnly" | ||
} | ||
|
||
DomainJoin DomainJoin | ||
{ | ||
domainName = $domainName | ||
adminCreds = $adminCreds | ||
} | ||
|
||
WindowsFeature RDS-RD-Server | ||
{ | ||
Ensure = "Present" | ||
Name = "RDS-RD-Server" | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
configuration RDSDeployment | ||
{ | ||
param | ||
( | ||
[Parameter(Mandatory)] | ||
[String]$domainName, | ||
|
||
[Parameter(Mandatory)] | ||
[PSCredential]$adminCreds, | ||
|
||
# Connection Broker Node name | ||
[String]$connectionBroker, | ||
|
||
# Web Access Node name | ||
[String]$webAccessServer, | ||
|
||
# Gateway external FQDN | ||
[String]$externalFqdn, | ||
|
||
# RD Session Host count and naming prefix | ||
[Int]$numberOfRdshInstances = 1, | ||
[String]$sessionHostNamingPrefix = "SessionHost-", | ||
|
||
# Collection Name | ||
[String]$collectionName, | ||
|
||
# Connection Description | ||
[String]$collectionDescription | ||
|
||
) | ||
|
||
Import-DscResource -ModuleName PSDesiredStateConfiguration -ModuleVersion 1.1 | ||
Import-DscResource -ModuleName xActiveDirectory, xComputerManagement, xRemoteDesktopSessionHost | ||
|
||
$localhost = [System.Net.Dns]::GetHostByName((hostname)).HostName | ||
|
||
$username = $adminCreds.UserName -split '\\' | select -last 1 | ||
$domainCreds = New-Object System.Management.Automation.PSCredential ("$domainName\$username", $adminCreds.Password) | ||
|
||
if (-not $connectionBroker) { $connectionBroker = $localhost } | ||
if (-not $webAccessServer) { $webAccessServer = $localhost } | ||
|
||
if ($sessionHostNamingPrefix) | ||
{ | ||
$sessionHosts = @( 0..($numberOfRdshInstances-1) | % { "$sessionHostNamingPrefix$_.$domainname"} ) | ||
} | ||
else | ||
{ | ||
$sessionHosts = @( $localhost ) | ||
} | ||
|
||
if (-not $collectionName) { $collectionName = "Desktop Collection" } | ||
if (-not $collectionDescription) { $collectionDescription = "A sample RD Session collection up in cloud." } | ||
|
||
|
||
Node localhost | ||
{ | ||
LocalConfigurationManager | ||
{ | ||
RebootNodeIfNeeded = $true | ||
ConfigurationMode = "ApplyOnly" | ||
} | ||
|
||
DomainJoin DomainJoin | ||
{ | ||
domainName = $domainName | ||
adminCreds = $adminCreds | ||
} | ||
|
||
WindowsFeature RSAT-RDS-Tools | ||
{ | ||
Ensure = "Present" | ||
Name = "RSAT-RDS-Tools" | ||
IncludeAllSubFeature = $true | ||
} | ||
|
||
Registry RdmsEnableUILog | ||
{ | ||
Ensure = "Present" | ||
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDMS" | ||
ValueName = "EnableUILog" | ||
ValueType = "Dword" | ||
ValueData = "1" | ||
} | ||
|
||
Registry EnableDeploymentUILog | ||
{ | ||
Ensure = "Present" | ||
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDMS" | ||
ValueName = "EnableDeploymentUILog" | ||
ValueType = "Dword" | ||
ValueData = "1" | ||
} | ||
|
||
Registry EnableTraceLog | ||
{ | ||
Ensure = "Present" | ||
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDMS" | ||
ValueName = "EnableTraceLog" | ||
ValueType = "Dword" | ||
ValueData = "1" | ||
} | ||
|
||
Registry EnableTraceToFile | ||
{ | ||
Ensure = "Present" | ||
Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDMS" | ||
ValueName = "EnableTraceToFile" | ||
ValueType = "Dword" | ||
ValueData = "1" | ||
} | ||
|
||
WindowsFeature RDS-Licensing | ||
{ | ||
Ensure = "Present" | ||
Name = "RDS-Licensing" | ||
} | ||
|
||
xRDSessionDeployment Deployment | ||
{ | ||
DependsOn = "[DomainJoin]DomainJoin" | ||
|
||
ConnectionBroker = $connectionBroker | ||
WebAccessServer = $webAccessServer | ||
|
||
SessionHosts = $sessionHosts | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
|
||
xRDServer AddLicenseServer | ||
{ | ||
DependsOn = "[xRDSessionDeployment]Deployment" | ||
|
||
Role = 'RDS-Licensing' | ||
Server = $connectionBroker | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
xRDLicenseConfiguration LicenseConfiguration | ||
{ | ||
DependsOn = "[xRDServer]AddLicenseServer" | ||
|
||
ConnectionBroker = $connectionBroker | ||
LicenseServers = @( $connectionBroker ) | ||
|
||
LicenseMode = 'PerUser' | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
|
||
xRDServer AddGatewayServer | ||
{ | ||
DependsOn = "[xRDLicenseConfiguration]LicenseConfiguration" | ||
|
||
Role = 'RDS-Gateway' | ||
Server = $webAccessServer | ||
|
||
GatewayExternalFqdn = $externalFqdn | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
xRDGatewayConfiguration GatewayConfiguration | ||
{ | ||
DependsOn = "[xRDServer]AddGatewayServer" | ||
|
||
ConnectionBroker = $connectionBroker | ||
GatewayServer = $webAccessServer | ||
|
||
ExternalFqdn = $externalFqdn | ||
|
||
GatewayMode = 'Custom' | ||
LogonMethod = 'Password' | ||
|
||
UseCachedCredentials = $true | ||
BypassLocal = $false | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
|
||
xRDSessionCollection Collection | ||
{ | ||
DependsOn = "[xRDGatewayConfiguration]GatewayConfiguration" | ||
|
||
ConnectionBroker = $connectionBroker | ||
|
||
CollectionName = $collectionName | ||
CollectionDescription = $collectionDescription | ||
|
||
SessionHosts = $sessionHosts | ||
|
||
PsDscRunAsCredential = $domainCreds | ||
} | ||
|
||
} | ||
} |
Binary file added
BIN
+14.6 KB
...oyment/DSC/Configuration/xActiveDirectory/DSCResources/MSFT_xADDomain/MSFT_xADDomain.psm1
Binary file not shown.
Binary file added
BIN
+1.11 KB
.../DSC/Configuration/xActiveDirectory/DSCResources/MSFT_xADDomain/MSFT_xADDomain.schema.mof
Binary file not shown.
Binary file added
BIN
+9.12 KB
...tion/xActiveDirectory/DSCResources/MSFT_xADDomainController/MSFT_xADDomainController.psm1
Binary file not shown.
Binary file added
BIN
+856 Bytes
...ActiveDirectory/DSCResources/MSFT_xADDomainController/MSFT_xADDomainController.schema.mof
Binary file not shown.
Binary file added
BIN
+26.5 KB
.../Configuration/xActiveDirectory/DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.psm1
Binary file not shown.
Binary file added
BIN
+1.71 KB
...guration/xActiveDirectory/DSCResources/MSFT_xADDomainTrust/MSFT_xADDomainTrust.schema.mof
Binary file not shown.
Oops, something went wrong.