Computers groups and logon script

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am looking to create logon scripts based on computers and not users. I am
thinking that I can create a group with just computer objects of a site
inside and setting up a GPO that will execute a logon script when anyone logs
on to any of the computers in the group.

Does anyone know if this is possible or is there a better way to do this?
 
Yes, you can do this using a computer startup script in Group Policy.

It's not quite as you describe, though. Consider that computers log in to
Active Directory just like users do, and remove the link in your mind
between a user and a computer. The computer startup script runs when the
computer starts up and logs on. By the time a user gets to log in, the
computer startup script will already have run.

While it's possible to filter a GPO based on group membership, it is more
normal to user organizations units to group the machines together.

Hope this helps

Oli
 
Hi,

Added to what Oli said. You can set a startup script to execute ONLY when a
Computer restarts, OR you can enable "Loopback" mode in the GPO on the OU
where the computers reside. If you set loopback Mode to "Merge" and then put
a logon script in the User Config of the Computers GPO then when a user logs
into that specific computer the GPO will apply "merged" with the Users GPO's.

Cheers,

Lara
 
Little clarification...I am pretty much trying to map networked printers
based on a computer location. Location being an OU of computers. I would like
to use a GPO to run the script. My users jump from station to station like
hot potatoes on a daily basis. I am really trying to get the correct network
printers mapped when they move from site to site, computer to computer.

From what I gathered from Oli is...I would be attempting to map a network
printer when the computer logs itself in and before the user. Interesting.
Does this work? For some reason, I am thinking no. I could be wrong.

From what I gathered from Lara is...I would be enabling loopback to tack on
another GPO after every other GPO is executed in the proper order. This is a
little foreign to me, but I this is the ticket for me.

Thanks for the help.
 
Hi,

I do this. I have thousands of users that roam from computer to computer. I
install the printers via Computer rather than user.

1> Create a BAT file with the following. The first installs and the second
sets the "default". This is in case you have roaming profiles and your users
have multiple printers in their profile.

rundll32 printui.dll,PrintUIEntry /in /q /n "\\Server\Printer"
rundll32 printui.dll,PrintUIEntry /y /q /n "\\Server\Printer"

2> Put BAT file above in NETLOGON Share (inside sysvol - scripts folder).
Open Active Directory.
3> Create an OU for computers (if you don't have already). Move computers
all into OU. In Computers OU, Create "Child-OU's for computers in certain
areas that will need the same printer. Eg. Room 112 Computers.
4> Create a GPO for the Upper Computers OU. Under the Computer Config-Admin
Templates-System-Group Policy - Enable the "Loopback processing mode" and set
to MERGE.
5> Create GPO's for the Child OU's. Eg. Room112. Under Computer
Conf-Windows Settings-Scripts - point to the Above Batch file that you
created. You can click the Arrow and go upto mydomain.local and into
Scripts(netlogon share). Under User Config in the SAME GP add a logon script
to the same batch file.

Restart computers. Machine will restart and run startup script - adding
printer and copying drivers to local machine (you will see the printer add if
you watch). User Logs on and printer is then "re-added" and "set default".
The reason for this step is that with Windows 2000 just adding to the
computer is enough but it doesn't show with XP. You need it in the logon as
well to set the default.

Cheers,

Lara
 
Back
Top