Jump to content

Recommended Posts

Posted

Started the sync process for 365 and despite following the instructions other people have suggested here http://www.edugeek.net/forums/cloud-services/131205-setup-dir-sync-office-365-a.html and stipulating only certain OU's I have found that my entire population of users have been synced which is obviously not what I wanted. Have no idea why its done that but never mind.

 

Question is what is the best method to remove those not required? thanks in advance

Posted

During our setup I found just removing all of the unlicensed users and just starting again was the easiest way.

 

Once connected to O365 by Powershell execute the following commands.

$LiveCred = Get-Credential (enter credentials)

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUrips.outlook.com/powershell -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session

import-module MSOnline

Connect-MsolService (enter credentials)

Get-MsolUser -all | Where-Object {$_.isLicensed -ne "true"}| Remove-MsolUser -Force

  • Thanks 1
Posted

Thanks @ellsandell thats working a treat and removing everyone now. Do i need to do anything else once they all appear within the deleted users list in O365?

 

Hopefully the next import will go a little smoother.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...