none
Exchange 2010 Remote Powershell - How to Set-Mailbox password RRS feed

  • Question

  • I reviewed the 'Set-Mailbox' spex at http://technet.microsoft.com/en-us/library/bb123981(EXCHG.140).aspx and there is an Optional parameter 'Password'.  However, if I set the 'Password' parameter, I recived the error "A parameter cannot be found that matches parameter name 'Password'." on the Invoke() call.
            powershell.AddCommand("Set-Mailbox");
              powershell.AddParameter("Identity", emailaddress);
              powershell.AddParameter("Password", ToSecureString(newpassword));
              powershell.AddParameter("ResetPasswordOnNextLogon", false);
              powershell.Runspace = runspace;
              Collection results = powershell.Invoke();
    

    I have been Googling for a way to change the Exchange 2010 mailbox password, and have come up dry. Is Set-Mailbox the right cmdlet to use, or is the another method. Please advise.

     


    Chris
    Thursday, August 25, 2011 4:41 PM

Answers

  • Are you using hosted Exchange, or on-premise? 

    The password parameter is only applicable if you are a hosted Exchange user.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by mangia Thursday, August 25, 2011 7:05 PM
    Thursday, August 25, 2011 5:23 PM
  • You can use the DirectoryEntry or UserPrincipal classes to reset the AD password. These links have some code samples:

    http://www.informit.com/articles/article.aspx?p=474649&seqNum=4
    http://www.codeproject.com/KB/system/usingAccountManagement.aspx?display=Print


    Mike Pfeiffer | blog: mikepfeiffer.net | twitter: @mike_pfeiffer
    • Marked as answer by mangia Tuesday, August 30, 2011 6:28 PM
    Tuesday, August 30, 2011 6:26 PM

All replies

  • Related; On the 'Get-Mailbox' spec, there is an Optional parament for 'Credential'.  Is there a way to 'get' the Credentials for an existing mailbox, for the purpose of allowing a change password request only if the user knows the existing password?

    Or, is the answer to this only and simply to force a 'ResetPasswordOnNextLogon' == true?


    Chris
    Thursday, August 25, 2011 5:03 PM
  • Are you using hosted Exchange, or on-premise? 

    The password parameter is only applicable if you are a hosted Exchange user.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Marked as answer by mangia Thursday, August 25, 2011 7:05 PM
    Thursday, August 25, 2011 5:23 PM
  • On-premise.  We host email for our clients and need the ability to allow our client to change their password, via our website.  Are you saying then, if our Exchange 2010 server and IIS Server are all on the same domain, the Password parameter is not applicable?  If so, how can I administer changing a user's password upon their request? 

    Is the answer to force a 'ResetPasswordOnNextLogon' == true?


    Chris
    Thursday, August 25, 2011 6:36 PM
  • In an on-premise Exchange installation, the password is the password of the associated domain user's account, and changing that password is a domian maintenance task - you would use domain management tools. 

    Not sure how that works out in your scenario. Do your clients log on your domain to access their mailboxes?

     


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Thursday, August 25, 2011 6:45 PM
  • Our clients use or product web site, which hosts their email and provides functions to manage their email account (i.e distribution list, add/change email account settings, change password, etc).

    I'll mark this as answered but would appreciate additional comments.


    Chris
    Thursday, August 25, 2011 7:05 PM
  • You can use the DirectoryEntry or UserPrincipal classes to reset the AD password. These links have some code samples:

    http://www.informit.com/articles/article.aspx?p=474649&seqNum=4
    http://www.codeproject.com/KB/system/usingAccountManagement.aspx?display=Print


    Mike Pfeiffer | blog: mikepfeiffer.net | twitter: @mike_pfeiffer
    • Marked as answer by mangia Tuesday, August 30, 2011 6:28 PM
    Tuesday, August 30, 2011 6:26 PM