1

We have our on-premises AD synced to Azure AD using ADConnect. We use Office 365 for Exchange/SharePoint/Skype/etc.

There was a user having some issues (not related to O365 or Azure AD) and the decision was made to create a new AD account for them (no, this was not the right choice but it was already done.) So now the same user has two AD accounts each synced to Azure AD. Their Office 365 licenses, mailbox, Skype, etc. are all linked to their old AD account but they are logging into their machine with their new AD account.

Is there any way that we can transfer everything Office 365/Azure AD linked under John@acme.com to JohnNew@acme.com? My inclination is no (and we just need to get rid of JohnNew@acme.com) but I wanted to check first.

Nicknow
  • 111
  • 3

1 Answers1

1

Innitially yes , you need to query all licences , Groups (memberof) , Permission and Roles assigned to Office 365/Azure under John@acme.com

Get the Licences here , I have a scrtip that exports all Licences assignwed * Get-MsolAccountSku

Import-Csv -Path "C:\scripts\NewAccounts.csv" | foreach {New-MsolUser -DisplayName $.DisplayName -FirstName $.FirstName -LastName $.LastName -UserPrincipalName $.UserPrincipalName -UsageLocation $.UsageLocation -LicenseAssignment $.AccountSkuId} | Export-Csv -Path "C:\scripts\NewAccountResults.csv"

Get-MsolUser -UserPrincipalName -TenantId

Get-MsolUserRole -ObjectId -TenantId

and then move JohnNew@acme.com

Get-AzureADUser -Objectid | Set-AzureADUser -City "New York" -Country "US" -TelephoneNumber "123456789" -StreetAddress "xxx h Floor" -PostalCode "10010" -Department "Marketing" -JobTitle "Employee"

Get-AzADUser -ObjectId 155a5c10-93a9-4941-a0df-96d83ab5ab24 | Update-AzADUser -DisplayName MyNewDisplayName

Import-Csv -Path "C:\scripts\NewAccounts.csv" | foreach {New-MsolUser -DisplayName $.DisplayName -FirstName $.FirstName -LastName $.LastName -UserPrincipalName $.UserPrincipalName -UsageLocation $.UsageLocation -LicenseAssignment $.AccountSkuId} | Export-Csv -Path "C:\scripts\NewAccountResults.csv"

try this and let me know if further help is needed and i will complete it

cheers

pablo

paulvill76
  • 11
  • 3