Help Needed: PowerShell Script to Remotely Map Printers

0
12
Asked By CuriousCoder42 On

I've hit a wall with CoPilot and Gemini, so I'm turning to you all for help! I'm looking for a PowerShell script that prompts for a hostname, retrieves info about who is currently logged in or who last logged in, and then asks for both the printer share and the specific printer to map it to the user's profile. It would also be great if the script could have the option to remove a printer. I'm really hoping this is something that can be accomplished!

3 Answers

Answered By TechieTommy On

Have you thought about using Group Policy for this? It's a lot easier and cleaner than trying to do it all through PowerShell. You can deploy printers using GPO with minimal hassle. Check out some guides if you haven't already!

CodeCrafter87 -

Totally agree, PowerShell can handle it, but GPO often makes everything a breeze. If a script is a must for you, are you planning to use it as a login script? Seems like it might be overcomplicating your setup.

Answered By PrinterPal On

From what I know about PowerShell scripts for printer mapping, you'll need to ensure the script is running under the user's context. While a login script would work per target device, running it remotely adds a layer of complexity. You could possibly modify the user's registry hive for this purpose, but that’s where things get tricky.

Answered By NetworkNinja On

Are you dealing with a standalone network printer that's not registered in Active Directory? If so, you’ll need to use `Add-PrinterPort` to create a TCP/IP port and then `Add-Printer` to map it to the driver and assign a name to it.

ScriptSlinger -

You're on the right path, but I’m curious about how you plan to execute this remotely and under the context of the logged-in user.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.