Forum Discussion
Azure AD Connect > Managing with Powershell
I guess you have to use Exchange online cmdlets
How to connect to Exchange online:
https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx
change mailbox address:
http://www.remylarrieu.com/en/office-365-change-a-shared-mailbox-email-address/
Thanks for the reply.
I don't think the Powershell for AD connect uses that cmdlet:
I am using the following:
- Import-Module MsOnline
- Enter Connect-MsolService -Credential $credential
I tried Set-Mailbox -Identity oldEmail@domain.com -EmailAddresses newEmail@domain.com
It does not recognise the command Set-Mailbox.
Any ideas
Thanks
- MaluksDec 27, 2017Iron Contributor
it's because MsOnline powershell module does not contain Set-Mailbox cmdlet.
To view all the available cmdlets that are available in MsOnline module you can enter in powershell
get-command -Module msonline
- COYO IT SupportDec 27, 2017Copper Contributor
Hello,
Even using the Exchange Powershell I get an error but it is being synced with Azure AD Connect (formerly Azure AD Sync)
I have attached a screenshot of the error.
Thanks
- MaluksDec 27, 2017Iron Contributor
Well I can see that you have Exchange on-premises. What primary SMTP address is set in Exchange? Are you able to change email address via ECP?
As from error message it says that you have to change this internaly, afterwards changes should be synced to cloud
- COYO IT SupportDec 27, 2017Copper Contributor
Yes you are correct, and I can not see a command to change the primary email on a shared mailbox
I can use Set-MsolUserPrincipalName but it only changes the value on a user not a shared mailbox
Can I use the Exchange cmdlet to connect to Office 365 and use other commands?
Thanks