tagwar Posted August 12, 2008 Posted August 12, 2008 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
Richie_OLSJ Posted September 6, 2008 Posted September 6, 2008 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
IcemanND Posted September 6, 2008 Posted September 6, 2008 You can set a locally installed printer as default via a login script, no need to have it set up as a shared printer.
tagwar Posted September 8, 2008 Author Posted September 8, 2008 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
tagwar Posted September 8, 2008 Author Posted September 8, 2008 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.
IcemanND Posted September 8, 2008 Posted September 8, 2008 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()
tagwar Posted September 9, 2008 Author Posted September 9, 2008 thank you very muchi will do this right awaythanks again
LouisCipher777 Posted November 6, 2008 Posted November 6, 2008 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.
IcemanND Posted November 6, 2008 Posted November 6, 2008 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.
tagwar Posted November 11, 2008 Author Posted November 11, 2008 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???
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now