Click here to Skip to main content
11,813,557 members (46,715 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# Exchange-Server
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 Abhinav S 275
1 Palash Mondal_ 190
2 KrunalRohit 150
4 Manas_Kumar 115
0 OriginalGriff 3,877
1 KrunalRohit 2,526
2 Maciej Los 2,245
3 CPallini 2,240
4 ppolymorphe 1,750

Advertise | Privacy | Mobile
Web03 | 2.8.151002.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