Skip to main content
Question

Restrict users from wiping the laptop

  • October 10, 2024
  • 2 replies
  • 40 views

Forum|alt.badge.img

Hey All,

 

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

2 replies

jack.smith
Forum|alt.badge.img+1
  • All Star
  • 168 replies
  • October 11, 2024

Could use the REAgentc https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/reagentc-command-line-options?view=windows-11

 

Evaluation

# 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

# 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"
}

 


Forum|alt.badge.img

Let me try this one !!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings