I am having trouble doing an auto deployment of a server.
I am trying to start a server, join it to the domain, install Windows features, reboot and then configure those Windows features.
The process is happening on Amazon Web Services (although in theory, any similar process should be doable in any environment).
The process I am doing is as follows:
1) Boot server
2) Install Windows features using "Add-WindowsFeature –Name RDS-RD-Server,RDS-Connection-Broker,RDS-Gateway,RDS-Licensing,RSAT-RDS-Tools –IncludeAllSubFeature"
3) Join to Domain using "New-SSMAssociation" which joins the Server to the domain - this works
4) Reboot machine - this is done automagically with step 3
5) Configure RDS using "New-RDSessionDeployment -ConnectionBroker $server -WebAccessServer $server -SessionHost $server" - this does not work as it needs an elevated PowerShell run by a Domain Admin.
With Step 5 failing because it does not have the ability to run the "New-RDSessionDeployment" command.
I have tried issuing a PowerShell "Run Command" detailing the Admin user but this doesn't work.
I have tried remotely connecting to PowerShell (locally) but this doesn't work.
The only solution is to manually RDC to the Server as a Domain Admin and run the command.