Discussion Locked

Login Script

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need a login script to add a group to the local administrators group on PC's. I want it to work when users login to the PC and save the visit to each PC manually.

I know this can be done through the global policy but it might interfere with other things that we have in place already. Reasons below:

Have to create an OU, set a local policy, don?t want to do it because global policy will not apply to those, that might cause issues.

Cannot visit each PC because of remote sites.

6 replies

by jtakiwi

To add a domain security group called "workstation admins" for example to the local administrators group on a member pc, add these lines to your logon batch file:

net localgroup Administrators | find /i "your domain name\workstation admins" > nul

if not %errorlevel%==0 (net localgroup Administrators "your domain name\workstation admins" /ADD > nul)

Remember to replace "your domain name" with your actual domain name. Note, Quotes only required where spaces are involved.

by darts32

jtakiwi, I inserted a pause after the code ran that you provided. Access was denied when the batch file ran under the users name.

by bfilmfan

I say forget running the network and jtakiwi can take us fishing at Lake Eufala.

Then we can sit in the boat, have drinks and lie about the bass we ain't catchin'...

This discussion is closed to new replies.