Tag Archives: Office 365

Duplicate Users in Office365

4 Dec

 

Both saying synced with AD however only one account exists

I’ve had to manually delete users from O365 during a DirSync deployment. Use PowerShell on the server running DirSync to run these commands:

Import-Module MSOnline

Connect-MsolService  [Enter your Office 365 admin credentials when prompted]

remove-msoluser –userprincipalname UID@UPN.com

If the account is in Deleted Users in Office 365, append the last command with -RemoveFromRecyclebin

Advertisements

Domain Rename

27 Jul

Today I did this live in a production environment for only  the second time in my career.

By large I followed the instructions here

I will add the additional steps I took shortly

 

UPN still points to old domain in ADUC

 

You can simply use for that MS DS Tools. On a DC in command-line type

to prepare users list

dsquery user -samid * -limit 0 | dsget user -samid | find /v "dsget" | find /v "samid" >>c:\users.txt

Select allOpen in new window

and now, you can simply update users

for /f %i in (c:\users.txt) do dsquery user -samid %i | dsmod user -upn %i@NewDNSDomainName -c