need a powershell script to remove SIDS from Adminstrators Group On Windows 10 Hybrid AD Joined Devices

Job ID: 31509696

Budget: $10 – $30 USD

I have an open issue w/ MSFT; I have AutoPilot devices w/ Global Admins and Device Admins in the Administrators Group on Windows 10 Devices. I have to remove these SIDS.

Pseudo Code:

If
Get-LocalUser -S-1-12-1-3598938502-1280727568-3632501898-3897530764
Get-LocalUser -S-1-12-1-61017865-1125260692-820944550-834916098
True
Then
Remove-LocalGroupMember -Group "Administrators" -Member "S-1-12-1-3598938502-1280727568-3632501898-3897530764"
Remove-LocalGroupMember -Group "Administrators" -Member "S-1-12-1-61017865-1125260692-820944550-834916098"
Write out removed
Else Write out not found
Related categories: Powershell