Click here to Skip to main content
Rate this: bad
good
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
 
Sebstian
Posted 18-Apr-12 0:33am
Edited 26-Apr-12 20:33pm
v8

1 solution

Rate this: bad
good
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#.
  Permalink  
Comments
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 OriginalGriff 565
1 Maciej Los 319
2 Richard MacCutchan 220
3 BillWoodruff 164
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 27 Apr 2012
Copyright © CodeProject, 1999-2014
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