C
Christian Salway
We are trying to deploy Remote Desktop Services using scripting.
Although through Server manager , we can deploy all services (Connection Broker, Web Access, Session Host) on the same server, we can not do the same thing using PowerShell.
The PowerShell looks like the following
$servername=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain
Import-Module RemoteDesktop
New-RDSessionDeployment -ConnectionBroker "$servername" -WebAccessServer "$servername" -SessionHost "$servername"
New-RDSessionCollection -CollectionName "sh01" -SessionHost "$servername" -ConnectionBroker "$servername"
Set-RDSessionCollectionConfiguration -CollectionName "sh01" -UserGroup "directory\RDS-Users" -ClientDeviceRedirectionOptions 0x0000 -ClientPrinterRedirected $False
And the error returned is:
PS C:\Windows\system32> New-RDSessionDeployment -ConnectionBroker "$servername" -SessionHost "$servername"
New-RDSessionDeployment : Validation failed for the "RD Session Host" parameter.
EC2AMAZ-VC2FB5F.directory.local You cannot restart the local server.
At line:1 char:1
+ New-RDSessionDeployment -ConnectionBroker "$servername" -SessionHost ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-RDSessionDeployment
Continue reading...
Although through Server manager , we can deploy all services (Connection Broker, Web Access, Session Host) on the same server, we can not do the same thing using PowerShell.
The PowerShell looks like the following
$servername=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain
Import-Module RemoteDesktop
New-RDSessionDeployment -ConnectionBroker "$servername" -WebAccessServer "$servername" -SessionHost "$servername"
New-RDSessionCollection -CollectionName "sh01" -SessionHost "$servername" -ConnectionBroker "$servername"
Set-RDSessionCollectionConfiguration -CollectionName "sh01" -UserGroup "directory\RDS-Users" -ClientDeviceRedirectionOptions 0x0000 -ClientPrinterRedirected $False
And the error returned is:
PS C:\Windows\system32> New-RDSessionDeployment -ConnectionBroker "$servername" -SessionHost "$servername"
New-RDSessionDeployment : Validation failed for the "RD Session Host" parameter.
EC2AMAZ-VC2FB5F.directory.local You cannot restart the local server.
At line:1 char:1
+ New-RDSessionDeployment -ConnectionBroker "$servername" -SessionHost ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-RDSessionDeployment
Continue reading...