I need to del everyone’s adminitrator authority from their computer
the computer name is the same as the username
i write a command: net localgroup administrators sei%username% /delete
when run this command in cmd.exe , it works
but when i use bigfix
wait \seinas\Appsoft\SoftwareDistribution\RunAsCurrentUser.exe --w cmd.exe /c "net localgroup administrators sei%username% /delete"
it doesn’t works
I need some helps~~
Is there any specific reason this needs to be run as the current user on the PC? If the name of PC is the same as the user you’re trying to demote, try this:
waithidden cmd.exe /c "net localgroup administrators sei\{computer name} /delete"
Couldn’t you do:
wait cmd.exe /c "net localgroup administrators sei\{name of current user} /delete"
I would expect that you need local administrator permission to perform this so if you run as the current user you aren’t elevating to Admin rights to do it.
If you have bes interpret the computername, you won’t need the % symbols ; cmd doesn’t need to use variable substitution because we have the literal computername.
I agree, you may have issues with runascurrentuser not elevating.
But substituting in {name of current user} may take out the real administrators too.
To be clear, the admin account named for the computer, is a domain account and not a local account, right?
If the commandline version works with %username% thats the same as name of current user but of course you would need to protect the action to not delete Administrator etc
Now it works
I now what the problem is
I tried the command in the fixlet Debugger but it didn’t work
I tried it in the bigfix console it worked…
thanks everyone!!