Hi,
I am trying to run the following command with Powershell to remove a specific user from the Administrators group:
Remove-LocalGroupMember -Group Administrators -Member chnlocaladmin
When I run this with elevated permissions (SYSTEM) in Powershell on the machine itself, it works perfectly fine. However, deploying it via a worklet in Automox does not work.
My worklet:
Evaluation Code:
1. Exit 1
Remediation Code:
1. Remove-LocalGroupMember -Group Administrators -Member chnlocaladmin
When I run this manually, the local user is still part of the administrators groups. I gave it a few minutes to run and still nothing. Running the same command locally works fine.
Any ideas what could be going wrong?