AutomoxAutomox

Restrict users from wiping the laptop

Arunchandar N
October 10, 2024 at 5:21 am UTC
#Worklets#automox#Restrict wiping#Wipe

Hey All,

 

Is there a way we can restrict users from wiping their laptops? Does anyone has prevented this with worklets?

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (2)

jack.smithOctober 11, 2024
#1
powershell11 lines
# Get the output from reagentc.exe /info and trim any extra whitespace
$string = (& reagentc.exe /info).trim()

# Parse values from the string using regex
$regex = 'Windows RE status:\s+(\w+)'
$matches = [regex]::Matches($string, $regex)
$WindowsREStatus = $matches.Groups.Value[1]

IF($WindowsREStatus -ne 'Enabled'){
    exit 1
}

Remediation

powershell26 lines
# Get the output from reagentc.exe /info and trim any extra whitespace
$string = (& reagentc.exe /info).trim()

# Parse values from the string using regex
$regex = 'Windows RE status:\s+(\w+)'
$matches = [regex]::Matches($string, $regex)
$WindowsREStatus = $matches.Groups.Value[1]

IF($WindowsREStatus -ne 'Enabled'){
    Write-Output "Windows Reset is Enabled. Disabling."
    & reagentc.exe /disable
}

# Validate
# Get the output from reagentc.exe /info and trim any extra whitespace
$string = (& reagentc.exe /info).trim()

# Parse values from the string using regex
$matches = [regex]::Matches($string, $regex)
$WindowsREStatus = $matches.Groups.Value[1]

IF($WindowsREStatus -ne 'Enabled'){
    Write-Output "Remediation Fialed."
}else{
    Write-Output "Windows Reset Status set to $WindowsREStatus"
}

 

Arunchandar NNovember 1, 2024
#2

Let me try this one !!