/build/static/layout/Breadcrumb_cap_w.png

Is there a way to create a script to run on my K1000 to remove administrative rights for the domain user logged into a PC

When we rolled out our last group of PC's, we made all of the users Local Administrators of their own PC. We would like to reverse this policy and remove the users as local administrators. Is there a way to script this to run through my K1000 so that we do not have to physically go to each machine and manually remove the users?


Thank You,


Andrew


0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 9 years ago
Red Belt
0
Use Group Policy to control membership of built-in groups.
Posted by: chucksteel 9 years ago
Red Belt
0
The command to remove a user or group from a localgroup is:
net localgroup administrators domain\group /delete

You should be able to run this as either a KScript or a shell script. I have done this to add users and groups with a KACE script without any issues.


Posted by: SMal.tmcc 9 years ago
Red Belt
0
If you have an uinque user on each machine and do not have too many off them you can use the command chuck mentioned in a batch file with all those users.  The lines that do not apply just error and move to the next line.  You would want to run this invisible because the errors will go by in the command window if you do not hide it.  This way you can create one script for the group of machines, else you will need to create a script for each user/machine.

http://www.itninja.com/blog/view/how-to-hide-running-a-batch-file-from-a-kscript-with-version-5-5

Sample batch file

net localgroup administrators domain\group /delete
net localgroup administrators domain\user1 /delete
net localgroup administrators domain\user2 /delete
net localgroup administrators domain\user3 /delete
net localgroup administrators domain\user4 /delete
net localgroup administrators domain\user5 /delete
net localgroup administrators domain\user6 /delete
net localgroup administrators domain\user7 /delete
net localgroup administrators domain\user8 /delete
net localgroup administrators domain\user9 /delete

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ