System Wipe/Reset for Autopilot Run as System and in ServiceUI

Hi all, i am trying to call
$namespaceName = "root\cimv2\mdm\dmmap" $className = "MDM_RemoteWipe" $methodName = "doWipeMethod" $session = New-CimSession $params = New-Object Microsoft.Management.Infrastructure.CimMethodParametersCollection $param = [Microsoft.Management.Infrastructure.CimMethodParameter]::Create("param", "", "String", "In") $params.Add($param) $instance = Get-CimInstance -Namespace $namespaceName -ClassName $className -Filter "ParentID='./Vendor/MSFT' and InstanceID='RemoteWipe'" $session.InvokeMethod($namespaceName, $instance, $methodName, $params)

to Wipe a PC. However i still want the functionality to use Show-ADTInstallationPrompt via : $Response = Show-ADTInstallationPrompt -Message "Are you 100% sure you want to Wipe the Device? This will Delete EVERYTHING from the Device!" -ButtonRightText "Yes" -ButtonLeftText "No" -Title "Wipe the Device?"

Has anyone had this before? This will only go through if run as SYSTEM but i am afraid serviceUI.exe pushes itself in user context therefore running into permission issue again.

BR Niklas

Hi, I don’t think this will be an issue (even with serviceUI) but the new 4.1 rc version of PSADT doesn’t require ServiceUI anymore so my suggestion is try with that version.

1 Like

Hi , oh wow i did not know that. Currently i have found a workaround which is:
PSADT 1 with my non-interactive script part Triggers PSADT 2 that is present in the Files Dir of PSADT1. Within there ServiceUI is launched and it returns custom Exit codes to my PSADT1 session which then executes the command as System like a charm.

Thanks for the help tho i will 100% check out 4.1

2 Likes