I am trying to remotely connect my Citrix Xenapp server via PowerShell. When I ran the following PS command:
Invoke-Command -Session $s -ScriptBlock {Get-XAApplicationReport *}| Select-object Displayname, Enabled, @{n='accounts'; e={[string]::join(",",$_.accounts)}} | Export-Csv .\$comp.csv -NoTypeInformation
I got the following error:
Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting
Help topic.
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionOpenFailed
Resolution :
Run below mention command and enter yes:-
PS C:\Documents and Settings\citrixadmin> winrm quickconfig
WinRM already is set up to receive requests on this machine.
WinRM is not set up to allow remote access to this machine for management.
The following changes must be made:
Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
Make these changes [y/n]? y
WinRM has been updated for remote management.
Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this machine.
PS C:\Documents and Settings\citrixadmin>