Remove users from local administrators group

(imported topic written by Kanboo)

Each user was added to the local admin group by mistake. Under the gun to get them out of there./ Need help with the following code that is constantly failing:

RunAsCurrentUser.exe “net.exe localgroup administrators aa%username% /delete”. The net command works from DOS but not from bigFix.

Any other suggestions/other code that were successful? appreciate it. Thanks!

(imported comment written by BenKus)

Hey Kanboo,

I don’t think you will need to use RunAsCurrentUser… Maybe just try this:

// only run if a user is logged in

continue if {exists current user}

waithidden cmd.exe /C net localgroup administrators aa{name of current user} /delete

Ben

(imported comment written by Kanboo)

Thanks Ben: appreciate it. The code works however one has to hard code the name of the suer in:aa{name of current user}.

The problem is that we’ve got about 400 hundred clients to do that to. I tried %username% but BF does not understand that variable. The thought of applying the fixlet 400 times seems impossible. A login script in AD is applied to all users loging into a particular container. BF does see the PCs that are affected but we need to find a script that does it. Bummer!

Thanks!

(imported comment written by Zakkus)

Hey Kandboo

There may be a little misunderstanding. The line “{name of current user}” is actually actionscript code that you should keep in your action (and not an indication for you to hard code the value yourself). Those curly brackets indicate relevance substitution, which should behave the same as having that environment variable in there.

-Zak

will this remove a domain account from local admin group when computer is “off network”?