Discussion Locked

Login Script

0 helpful
7 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.

7 replies

by lowlands

Create a vbscript with some like this:

On Error Resume Next
'===============================================================================
'Add Workstation Administration Group to Local Administrators
'================================================strComputer = "."
Set objLocalGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objADGroup = GetObject("WinNT:///,group")
objLocalGroup.Add(objADGroup.ADsPath)
'================================================
wscript.Quit

You can add this to the domain login script with a GPO. I am not sure I understand the interference part.

by darts32

Lowlands, we 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.

by lowlands

If you have a list of all the PC's, you could manually copy the script to the PC's. Then either add it to the startup folder, or maybe even set a runonce registry setting.
The problem with this would be that you'd have to keep doing this as workstations get added to your domain.

This discussion is closed to new replies.