Author Posts

January 1, 2012 at 12:00 am

by sxavier at 2013-05-10 02:20:11

Hi,
I want to monitor exchange server 2007 using power-shell scripts. Here are the scripts which I have used for that.
$secpasswd = ConvertTo-SecureString "password" -AsPlainText -Force
$mycreds = New-object -typename System.Management.Automation.PSCredential("domain\Admin",$secpasswd)
Enter-pssession 192.168.1.153 –credential $mycreds

$server='client-pc-1.domain.com';$pwd= convertto-securestring 'password' -asplaintext -force;
$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'Admin',
$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin
Microsoft.Exchange.Management.PowerShell.Admin; Get-ExchangeServer}

But I have landed in the following Exception
[code]Processing data from remote server failed with the following error message: The WSMan provider host process did not return a proper response. A provider in the host process may have behaved improperly. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OperationStopped: (System.Manageme...pressionSyncJob:
PSInvokeExpressionSyncJob) [], PSRemotingTransportException + FullyQualifiedErrorId : JobFailure[/code]

Any help to solve this issue would be great.

Sebastian