Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Location based printing script

$
0
0

Normal 0 false false false false EN-US X-NONE X-NONE

Im a new VMware View Admin and Im having an issue with location based printing. It is not consistently working and instead of spinning my wheels on that I want to try and write a script that runs at every startup or login and either maps a printer based on the machine name of the client device (found in the registry). The client machine name attribute doesn’t get added in until the user logins. Also I already have a computer name convention in place so that the computer name has the location in it. The naming convention variables are Location/Year/DeviceType/NumberSequence, Example: HomeOffice13D001; SouthOffice13D002; Shipping13D003; Admin13D004

So this is what I need the script to do step by step.

  1. Find the machine name of the client device. Located at HKCU\Volatile Environment\ViewClient_Machine_Name
  2.  Match the machine variable to a “printer table” that I have setup. Currently have it in spreadsheet, Which looks like this: 

 

 

Client machine namePrinter namePrinter location
Computer 1Printer 1\\PrintServer\Printer1
Computer 2Printer 2\\PrintServer\Printer2
Computer 3Printer 3\\PrintServer\Printer3
Computer 4Printer 4\\PrintServer\Printer4
Computer 5Printer 5\\PrintServer\Printer5
Computer 6Printer 6\\PrintServer\Printer6
Computer 7Printer 7\\PrintServer\Printer7
Computer 8Printer 8\\PrintServer\Printer8
Computer 9Printer 9\\PrintServer\Printer9

          3. Then installs the needed printer and makes it the default printer.

 

I can change the printer table to a xml table if needed. Also if it would be easier for all the printers to be installed locally so the script would just change the default printer based on the location I can do that. But if I switched to local printers I wouldn’t able to kill the print jobs from my Windows Print Server.

If anyone can help me get started or tell me that I’m going about this all the wrong my just let me know. Thanks


Viewing all articles
Browse latest Browse all 10624

Trending Articles