I am trying to enable an automated method of setting the default printer for
roaming profiles depending on site.

I.E user logs on in Site A they will have PR100 as default when they log on
in Site B they will have PR400. Each site has 50 odd printers so printers
will vary per user...

Any ideas or pointers would be appreciated

Rick

Re: Roaming Profiles & Defalut Printer by Corey_H

Corey_H
Wed Jun 22 15:56:47 CDT 2005

You can set the default printer with the script below. You'll have to
know the printer names, and figure out the logic for the if/thens, but
the basic implementation would be below. As far as site
implementation, you could assign a separate script via GPO's (which can
be attached to sites) specifying a specific printer, or pull site
information for each workstation using:

Set objADSysInfo = CreateObject("ADSystemInfo")
strSiteName = objSysInfo.SiteName

--Script--

strComputer = "."
strPrinter = ""

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = '"&strPrinter&"'")
For Each objPrinter in colInstalledPrinters
objPrinter.SetDefaultPrinter()
Next