August 12, 200818 yr Hi expert peopleI have question I want to add IP printer to the active directoryI am going to active directory users and computers and trying to add the printer But it ask me for network path like “\\server\share”I try to put printer IP address but it’s not accepting itCan anyone tell me what is the best way to add this printer to the domainThe reason to add this printer to the domain is to make it the defult printer via login scriptthe printer is accisable throw the network but i want to add it to the ADI hope to find the solution in your experience
September 6, 200817 yr There are ways to achieve this via vbscript, but the easiest method would be to install the printer on the server and then you can use the \\server\printer method in AD
September 6, 200817 yr You can set a locally installed printer as default via a login script, no need to have it set up as a shared printer.
September 8, 200817 yr Author You can set a locally installed printer as default via a login script, no need to have it set up as a shared printer.can you give more details plzthanks
September 8, 200817 yr Author There are ways to achieve this via vbscript, but the easiest method would be to install the printer on the server and then you can use the \\server\printer method in AD i already did this but it didn't come for the users.also the script i tyied and also dosn't work.i don't know may i do something wrong.
September 8, 200817 yr Run as a user login script:strComputer = "."Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")set objNewPort = objWMIService.get("Win32_TCPIPPrinterPort").SpawnInstance_Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", TrueSet objDriver = objWMIService.Get("Win32_PrinterDriver")'Replace FRIENDLYNAME with the Friendly name or Display name of your printerSet colInstalledPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer Where Name = 'FRIENDLYNAME'")For Each objPrinter in colInstalledPrinters objPrinter.SetDefaultPrinter()NextInstalling IP printers:strComputer = "."Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")set objNewPort = objWMIService.get("Win32_TCPIPPrinterPort").SpawnInstance_Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", TrueSet objDriver = objWMIService.Get("Win32_PrinterDriver")'Install printer where driver is already installed on system'Laserjet 4200'Installs Printer DriverobjDriver.Name = "HP LaserJet 4200 PS" ' Name as displayed in the driver INFobjDriver.SupportedPlatform = "Windows NT x86"objDriver.Version = "3"intResult = objDriver.AddPrinterDriver(objDriver)'Installs Printer PortobjNewPort.Name = "IPADDRESSorFQDNofPRINTER" 'Replace with the FQDN or IP address to the printerobjNewPort.Protocol = 1objNewPort.HostAddress = "IPADDRESSorFQDNofPRINTER" 'Replace with the FQDN or IP address to the printerobjNewPort.PortNumber = 9100 ' replace with appropriate port number 9100 seems to be defaultobjNewPort.SNMPEnabled = TrueobjNewPort.Put_'Install PrinterobjPrinter.DriverName = "HP LaserJet 4200 PS" ' Name as displayed in the driver INFobjPrinter.PortName = "IPADDRESSorFQDNofPRINTER" ' Replace with the FQDN or IP address to the printerobjPrinter.DeviceID = "FRIENDLYNAME" ' Replace with the name you want displayed in the control panelobjPrinter.Location = ""objPrinter.Network = TrueobjPrinter.Put_'Laserjet 4250'Installs Printer Driver for printer with driver not already installedobjDriver.Name = "HP LaserJet 4250 PS" ' Name as displayed in the driver INFobjDriver.SupportedPlatform = "Windows NT x86"objDriver.Version = "3"intResult = objDriver.AddPrinterDriver(objDriver)'Installs Printer PortobjNewPort.Name = "IPADDRESSorFQDNofPRINTER" ' Replace with the FQDN or IP address to the printerobjNewPort.Protocol = 1objNewPort.HostAddress = "IPADDRESSorFQDNofPRINTER" ' Replace with the FQDN or IP address to the printerobjNewPort.PortNumber = 9100 '' replace with appropriate port number 9100 seems to be defaultobjNewPort.SNMPEnabled = TrueobjNewPort.Put_'Install PrinterobjPrinter.DriverName = "HP LaserJet 4250 PS" ' Name as displayed in the driver INFobjPrinter.PortName = "IPADDRESSorFQDNofPRINTER" ' Replace with the FQDN or IP address to the printerobjPrinter.DeviceID = "FRIENDLYNAME" ' Replace with the name you want displayed in the control panelobjPrinter.Location = ""objPrinter.Network = TrueobjPrinter.Put_objPrinter.SetDefaultPrinter()
November 6, 200817 yr I've been trying many different scripts to add printers as a logon script, but this one actuall worked.Now I have one question.Where is it getting the printer drivers from?I've tested the script on a computer that DID NOT have the printer driver already installed, and it still mapped and printed a test page, so now im curious as to where it gets them from before i add the user scripts to my policy.Thanks.
November 6, 200817 yr If it truely does not exists on the system already it should not have installed. Unless you are printer to a print server, then it will download them from the print server. In the two examples I have in the script one installs an HP 4200 which XP already has in the driver database. The second is a 4250 which is not in the driver database and it installs the driver as part of the install and you tell it where to find the drivers at.
November 11, 200817 yr Author I've been trying many different scripts to add printers as a logon script, but this one actuall worked.Now I have one question.Where is it getting the printer drivers from?I've tested the script on a computer that DID NOT have the printer driver already installed, and it still mapped and printed a test page, so now im curious as to where it gets them from before i add the user scripts to my policy.Thanks.can you explain what you did Exactly???
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now