Monday, 7 September 2015

#O365 - Change User Primary SMTP Email Address with Dirsync

Error: The operation on mailbox "Username" failed because it's out of the current user's write scope. The action 'Set-Mailbox', 'EmailAddresses', can't be performed on this oject "Username" because teh object is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization.

Solution 1:

1. Run Windows Azure Active Directory Module for Windows PowerShell as administrator.
2. To enable execution policy remotesigned, type

  • Set-ExecutionPolicy RemoteSigned
3. To assign credential right, type

  • $MSCred = Get-Credential
(Enter O365 admin user and password when prompt)

4. To open a connection to O365 server, type

  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $MSCred -Authentication Basic -AllowRedirection
5. To enter the Exchange powershell session, type

  • Import-PSSession $Session

6. To change user primary smtp email address, type

  •  Set-Mailbox -identity -WindowsEmailAddress
7. To exit the Exchange powershell session, type

  • Remove-PSSession $Session
Reference: link

Solution 2:
(Eidt AD user attribute)

1, Open Active Directory Users and Computers. Search for the user you want to change the primary smtp email address.
2. Open user properties, select Attribute Editor. (If Attribute Editor not exist, enable advanced features under AD users and computers view or/and open user properties from the actual directory, don't open from the search box)
3. Look for ProxyAddresses, and edit.

4. If no SMTP exist, enter the value as: (with SMTP upper case)

For example:

    If SMTP exist, remove the existing SMTP value, and enter the value as: (with SMTP lower case)

For example:

5. Click add, and the apply the setting.

6. Resync the Dirsync server.

No comments:

Post a Comment