question

BenjaminPeikes-7466 avatar image
0 Votes"
BenjaminPeikes-7466 asked MotoX80 commented

Invoke-Command not running with elevated privilages even though credentials are being passed

We have a server which is acting as a remote desktop connection broker, gateway and host. We want to be able to automate some of our administrative tasks so we don't have to have someone log into the machine. Here is a summary of the issue:
1) I can remote into the machine using a set of credentials which have domain administrator privileges. If I run Get-RDRemoteApp from a regular PowerShell window I get the error:
Get-RDRemoteApp : A Remote Desktop Services deployment does not exist on XXXXXXXXX.........

2) I then "Run ISE as Administrator" on the same machine in the same session, and Get-RDRemoteApp returns the list of applications in the collection we have

3) From a different machine, I use Invoke-Command, with the -Credentials passed in, like this:

 $password_sec = ConvertTo-SecureString $password -AsPlainText -Force
 $cred = New-Object System.Management.Automation.PSCredential ($admin_user, $password_sec)
    
 $sb =
 {
     Import-Module RemoteDesktop
     Import-Module RemoteDesktopServices
     Get-RDRemoteApp -CollectionName 
 }
    
 Invoke-Command -Credential $cred -ComputerName $server -ScriptBlock $sb 


This returns the "Get-RDRemoteApp : A Remote Desktop Services deployment does not exist on XXXXXXXXX........." error. It appears that Invoke-Command is not running with elevated permissions for some reason. I've read that if the credentials of the user passed in have administrative rights, there should be no issue.

Is it possible that there is no way to remotely administrate remote desktop servers?

windows-server-powershellremote-desktop-services
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please see my comment in your first question.

0 Votes 0 ·

It might be the double hop issue, as the command does connect to the connection broker (which is the same machine)

How do you resolve the double hop issue?

Whats odd is that there are no errors around authentication, just doesnt see the remote apps

0 Votes 0 ·
MotoX80 avatar image MotoX80 BenjaminPeikes-7466 ·

How about replying to your initial question (and maybe closing this one) so that there isn't duplicate questions.

0 Votes 0 ·

0 Answers