Forum Discussion
Need help with removing an alias synced from on-prem AD
Try below:
1. Check Exchange Online: Sometimes, attributes in Exchange Online might not match those in on-prem AD. Use the Exchange Online PowerShell to check the email addresses and aliases for both accounts. You can use the Get-Mailbox and Get-MailUser cmdlets to verify this.
Get-Mailbox -Identity "john.disabled@company.local" | Select-Object EmailAddresses
Get-Mailbox -Identity "john.active@company.local" | Select-Object EmailAddresses
2. Azure AD Connect: Ensure that Azure AD Connect is not filtering out any attributes. Sometimes, custom sync rules can cause attributes to be excluded. Check the synchronization rules in the Azure AD Connect tool.
3. Attribute Cleanup: Even if the alias isn’t visible in ADSI Edit, it might still be lingering in the metaverse or connector space in Azure AD Connect. Use the Synchronization Service Manager to inspect and clean up any lingering attributes.
4. Soft Deletion: If the account was soft-deleted and then re-created, it might still have remnants in the Azure AD recycle bin. Use the Get-MsolUser cmdlet to check for any soft-deleted users.
Get-MsolUser -UserPrincipalName "john.disabled@company.local" -ReturnDeletedUsers
5. Manual Attribute Update: If all else fails, you might need to manually update the attributes in Azure AD. This can be done using the Azure AD PowerShell module.
Set-AzureADUser -ObjectId "user-object-id" -OtherMails @("new.alias@company.local")
- Cloud_Geek_82Nov 15, 2024Copper Contributor
Hi Kidd_Ip
Thanks for your reply.
I think this all started happen because at some point in the past the AD account was renamed and I noticed that the whole domain was removed from Microsoft 365.
I would delete that AD object with pleasure but I know it will be reflected in Microsoft 365 and that account will be deleted there as well.
I'm considering exporting emails, deleting disabled AD accounts that should delete Microsoft 365 accounts. Then I will create a cloud sourced account and import back the exported emails.