Click here to Skip to main content
11,715,160 members (63,940 online)
Rate this: bad
good
Please Sign up or sign in to vote.
Hello,

I am working with power shell and Exchange server 2010. I was able to get mailbox details using the following command
$server='WIN-APRJ2923AV5.abc.com';$pwd= convertto-securestring 'Global123$' -asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'Administrator',$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; get-mailbox xyz}

I have tried this command with IP address instead of Computername....
$server='192.168.1.194';$pwd= convertto-securestring 'Global123$'-asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'WIN-APRJ2923AV5.abc.com\Administrator',$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; get-mailbox xyz}

But it threw an exception as follows
[192.168.1.194] Connecting to remote server failed with the following error message : The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
    + FullyQualifiedErrorId : PSSessionStateBroken

What is the problem with second query? Can anyone help me on this?

Thanks & Regards
Sebastian
Posted 10-May-12 3:20am
Edited 10-May-12 18:21pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 495
1 Richard MacCutchan 275
2 Maciej Los 259
3 ManasKumarM 155
4 Frankie-C 125
0 Sergey Alexandrovich Kryukov 775
1 CHill60 415
2 Richard MacCutchan 405
3 Maciej Los 389
4 OriginalGriff 320


Advertise | Privacy | Mobile
Web01 | 2.8.150901.1 | Last Updated 25 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100