Archives for category: Office 365

When decommissioning a Small Business Server you need to remove the SBS client software from all computers. To remove this software by the masses you can follow the steps below

  1. Open a new notepad and copy and paste the following to silently remove the client software
    1. MsiExec.exe /X {E4FF4DF1-F99C-49AC-B398-BE0887432846} /qn
  2. Save the file as “SBS-Client.REM.bat”
  3. Create a new Group Policy Object and Link it to the top level domain.
  4. Edit the GPO and go to ComputerConfiguration,Windows Settings, Scripts, Startup
  5. Click show files and copy the “SBS-Client.REM.bat” file created earlier then close the file explorer window that came up
  6. Now click on Add in the Startup Properties Screen and select the “SBS-Client.REM.bat” then click OK twice
  7. Close the Group Policy Management Editor and the GPO should look like this
  8. SBS-Client-Removal-1
  9. Tell your users to reboot their computers and it should uninstall automatically.

Hard Match Multiple Office 365 Accounts

1. Save the following as a Get-ImmutableID.PS1 script

###########################################################################################################StartScript###############################################################################################################
[System.Console]::ForegroundColor = [System.ConsoleColor]::White
clear-host
Import-module activedirectory

write-host
write-host This Script will Get the ObjectGUID for a user and convert
write-host it to the Immutuable ID for use in Office 365
Write-Host
write-host Please choose one of the following:
write-host
write-host ‘1) Get ID for a Single User’
write-host ‘2) Get IDs for all Users’
write-host ‘3) Cancel’ -ForegroundColor Red
write-host
$option = Read-Host “Select an option [1-3]”

switch ($option)
{
‘1’{
write-verbose “Option 1 selected”
$GetUser = Read-Host -Prompt ‘Enter UserName’
$Users = get-aduser $GetUser | select userprincipalname,@{label=”ImmutableID”;expression={[System.Convert]::ToBase64String($_.objectguid.ToByteArray())}}
$Users
}

‘2’{
Write-host
Write-host Type the Path location to Export the results: i.e. c:\service\IMID.csv

$Path = Read-Host -Prompt ‘Enter Path’

$Users = get-aduser -filter * | select userprincipalname,@{label=”ImmutableID”;expression={[System.Convert]::ToBase64String($_.objectguid.ToByteArray())}}
$users
$users | export-csv $Path

}
‘3’{
write-verbose “Option 3 selected”
break
}
}

###########################################################################################################EndScript################################################################################################################
2. Select your option

3. Save the CSV file to a directory i.e. C:\Service\IMID.csv

4. Open the CSV file and remove whatever UPN’s and IMID’s that you don’t want to change. Also replace all the “@domain.local” with “@domain.onmicrosoft.com” and save the file

5. Save the following as Set-IMID.ps1

###########################################################################################################StartScript###############################################################################################################

$users = import-csv “C:\Service\IMID.csv”
ForEach ($item in $users)

{
$UPN = $item.(“UserPrincipalName”)

$IMID = $item.(“ImmutableID”)

“Set-MsolUser -UserPrincipalName $UPN -ImmutableId $IMID”
}

###########################################################################################################EndScript################################################################################################################

6. Connect to Office 365 via Powershell

7. Change directory to the location of set-IMID.PS1

8. Type .\Set-IMID.PS1

9. It will print out all the results for you. Copy and and paste them back into the powershell