Click here to Skip to main content
11,637,662 members (72,054 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# exchange
I wish to query exchange server 2010 using power shell. My exchange server 2010 is mount at Windows server 2008 R2. I have got the result with the following query get-mailbox XXX. But as I want to query it from a remote PC, I have tried it as follows ...
$server='WIN-XXX';$pwd= convertto-securestring 'abc123' -asplaintext -force;$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'WIN-XXX\Administrator',$pwd; invoke-command -computername $server -credential $cred -scriptblock {Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010; get-mailbox XXX}
But it gives an error

Active Directory operation failed on WIN-XXX. The supplied credential for 'ABC\Administrator' on
Bind operation is invalid. Error Code: 0x31.
+ CategoryInfo : NotSpecified: ( : ) [], ADInvalidCredentialException
+ FullyQualifiedErrorId : 5C9B4453

Can anybody help me on this?

Thanks & regards

Posted 17-Apr-12 23:33pm
Edited 26-Apr-12 19:33pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Give a try without the domain name (or computer name) in your login name (remove the ABC\ part).. I experienced a similar issue when using EWS from C#.
Sebastian T Xavier at 24-Apr-12 9:32am
Thanks for your help. That worked for me in local PC (The PC which Exchange server is set up). But When I tried it in a different PC, it failed again.

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 344
1 OriginalGriff 295
2 stibee 288
3 270
4 himanshu agarwal 189
0 OriginalGriff 9,031
1 Sergey Alexandrovich Kryukov 8,763
2 Mika Wendelius 6,999
3 F-ES Sitecore 2,388
4 Suvendu Shekhar Giri 2,320

Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 27 Apr 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