fix: update profile removal logic to use SID variable directly
This commit is contained in:
@@ -27,7 +27,7 @@ Catch { Write-Error "The provisioning admin account could not be removed`n"+$_.E
|
||||
|
||||
# Fully remove the provisioning admin profile
|
||||
Write-Output "Removing provisioning admin CIM instance"
|
||||
Try { Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.SID -eq $ProvisioningAdmin.SID.Value } -ErrorAction SilentlyContinue | Remove-CimInstance }
|
||||
Try { Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.SID -eq $SID } -ErrorAction SilentlyContinue | Remove-CimInstance }
|
||||
Catch { Write-Error "The provisioning admin profile could not be removed`n"+$_.Exception.Message ; Exit 1 }
|
||||
|
||||
# Delete any remaining provisioning admin directories
|
||||
|
||||
Reference in New Issue
Block a user