Last post May 06, 2014 04:32 AM by George Qiao
May 04, 2014 11:57 AM|Bhav1973|LINK
Hi, I'm trying to setup a open a powershell connection to a Exchange 2010 Client Access Server. The snag is that my connections are being denied and I see the follwoing error message "Fatal error : Connecting to remote server failed with the following error
message : The WS-Management service cannot process the request. The resource URI (http://schema.microsoft.com/powershell/microsoft.powershell) was
not found in the WS-Management catalog. The catalog contains the metadata that describes resources, or logical endpoints. For more information, see the about_Remote_Troubleshooting Help topic., please find a complete error at ErrorLog file"
The Server I have installed IIS on, has the Exchange Management Tools installed, and I have no problems connection to remote sessions via PS, as I am an Org Admin etc...
any ideas why?
Dim q As String = physicalFolder.ToString
Dim r As String = TextBox1.Text
script = "D:\PSTMailboxReports\MailboxPSTCheck.ps1" & Space(1) & "-id r" & Space(1) & "-txtpath q"
conntectTo = "casserver.fqdn"
user = "domain\username"
password = "*******"
Const SHELL_URI As String = "http://schema.microsoft.com/powershell/microsoft.powershell"
Dim serverURI As New Uri("http://" & conntectTo & ":5985/wsman")
Dim securepass As New SecureString
Dim c As Char
For Each c In password
Dim remotecred As New PSCredential(user, securepass)
Dim connectionInfo As New WSManConnectionInfo(serverURI, SHELL_URI, remotecred)
connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos
connectionInfo.ProxyAuthentication = AuthenticationMechanism.Negotiate
Dim myRunSpace As Runspace = RunspaceFactory.CreateRunspace(connectionInfo)
Dim psresult As New System.Collections.ObjectModel.Collection(Of PSObject)
Dim psh As PowerShell = PowerShell.Create()
psh.Runspace = myRunSpace
psresult = psh.Invoke
May 06, 2014 04:32 AM|George Qiao|LINK
Thanks for your post.
You running your code in asp.net project? If yes, please run your project locally or run your project on Server machine to check the result.
You’re using PowerShell API connect to the remote Exchange 2010 Client Access Server instead of manually running PowerShell script?
Please refer to the answer reply in this post:
Do you think it’s a ASP.NET issue? I suggest you confirmed this issue with
Exchange 2010 Server experts.