![]() For the below script to work correctly the CSV must have a header title UPN with the users email address in the fields below I deleted users I didn’t want to delete, what can I do? $Users = Import-CSV File.CSV Or if you have the users in a CSV file you can use the below script to import and remove each user from the CSV file. To do this you can either use Excel to CONCATENATE the commands required as below Removing users using a CSV Import ![]() Now you are ready to remove the accounts. Using Excel to create the commands to remove the users ![]() To confirm you are connected run the command Get-MsolUser which should return a list of all the users on the tenant. Now you have the prerequisites installed you can run the command Connect-MsolService to connect to MSOnline.Īt this point you will be prompted with a login box, enter your tenant admin account details and click Next. Once installed close PowerShell and reopen. Now run the command Install-Module -Name MSOnline when asked to press Y to agree to the install Connecting to MSOnline Installing MSOnlineįirst you are going to need to install the MSOnline PowerShell commands, this can be done using the PowerShell Gallery. If you have a long list of users to remove from Office 365 using PowerShell is going to be the easiest way to achieve this with very little effort. 6.1 Found priceless insights in this blog? Support the author’s creativity – buy them a coffee!
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |