Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Anyone know of a quick printer script to rename networked printers on clients?

 

There is one over at Microsoft but I can't seem to get it working.

 

I am a novice when it comes to scripts.

 

Any pointers would be really great.

 

Ste.

Posted

Well, if your printer is connected to a Windows 2000 or Windows NT 4.0 print server i have bad news for you: you can’t rename a printer using a script, at least not using the technologies included in the operating system. (There might, or might not, be third-party tools that enable you to do this on those older versions of Windows.) If your printer is connected to a computer running Windows XP or Windows Server 2003, however, the news is much better.

try this it might help


 

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colPrinters =  objWMIService.ExecQuery _
   ("Select * From Win32_Printer Where DeviceID = 'HP'")

For Each objPrinter in colPrinters
   objPrinter.RenamePrinter("ArtDepartmentPrinter")
Next

Set colPrinters = objWMIService.ExecQuery _
   ("Select * From Win32_Printer Where DeviceID = 'ArtDepartmentPrinter' ")

For Each objPrinter in colPrinters
   objPrinter.ShareName = "ArtDepartmentPrinter"
   objPrinter.Put_

Posted

Thanks callumtuckey

 

Thats the script from Microsoft, I can get it to rename local printers no problem, but had no luck networked printers.

 

Was hoping to get it to rename networked printers so networked printers are not called Technology on server etc, just Technology.

 

I'll take a closer look tomorrow, might have missed something.

Posted
Was hoping to get it to rename networked printers so networked printers are not called Technology on server etc, just Technology.

I don't think you can do this using renaming... It may be a GPO setting or something but I suspect the "..on server" part is mandatory.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...