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