Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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 ...
JavaScript
$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

Sebstian
Posted
Updated 26-Apr-12 19:33pm
v8

1 solution

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#.
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900