Click here to Skip to main content
11,925,896 members (62,021 online)
Rate this:
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 18-Apr-12 0:33am
Edited 26-Apr-12 20: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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.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