"Mick" <> wrote in message
news

C05BC00-F632-416F-8039-...
>I have a number of computer objects in an OU. I want to create a logon
>script
> that sets the default printer for these PCs no matter who logs on to them.
> How do I do this and can you give an example please? Thanks for any
> replies.
You can configure a logon script in a GPO assigned to the OU, but this would
apply to all users in the OU, no matter which computer they use. Also, users
in another OU that logon will get the script. You cannot do this is in a
Startup script. You almost need to use a GPO applied to the domain, and
check for the OU of the computer in the logon script. For example the
VBScript logon script could be similar to (not tested):
=========
Option Explicit
Dim objSysInfo, strComputerDN, objComputer, strParent
Dim objNetwork
Set objNetwork = CreateObject("Wscript.Network")
' Retrieve DN of local computer.
Set objSysInfo = CreateObject("ADSystemInfo")
strComputerDN = objSysInfo.ComputerDN
' Retrieve ADsPath of parent OU of computer)
Set objComputer = GetObject("LDAP://" & strComputerDN)
strParent = objComputer.Parent
' Check for specific computer parent OU.
If (strParent = "LDAP://ou=West,dc=MyDomain,dc=com") Then
' Assign default printer.
objNetwork.AddWindowsPrinterConnection "\\PrintServer\Laser2"
objNetwork.SetDefaultPrinter "\\PrintServer\Laser2"
End If
======
I hope this helps.
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--