RSS

Tag Archives: printer

PowerShell – Manage printers

At work a colleague of mine was looking to modify printer permissions on a Server 2008 R2 terminal server using PowerShell. And to be honest, it was more difficult to do than I had expected.

So naturally, I started looking if someone had already created a script for this same purpose and eventually I found this great script created by Vadims Podans:
PrinterUtils.ps1 / Functions for advanced printer management

By leveraging this script, permissions were easily modified by adding the following lines:
$name = “Printername”
Get-Printer “localhost” $name | Add-PrinterPermission “corp\Domain Users” 0 “print”
Get-Printer “localhost” $name | Remove-PrinterPermission “everyone”
Get-Printer “localhost” $name

My modified script can be found here: http://bjornhouben-web.sharepoint.com/Lists/Scripts/DispForm.aspx?ID=22

Be sure to check Vadims Podans website for other great resources: http://en-us.sysadmins.lv/

Advertisements
 

Tags: , , ,

Powershell – Rename-redirectedprinter

This script renames a redirected printer and sets it as default.

The reason this needs to be done, is because some older programs require a specific (short) printer name and will not work otherwise. With SAPlpd by example the printer name may only consist of x characters, no spaces, etc.

By default however with Remote Desktop Services in Server 2008 R2, a redirected printer will show as “<printername> (redirected <session ID>)” by example “Lexmark X1100 series (Redirected 2)”.

Note:
-Renaming a redirected printer is not supported.
-The script assumes there’s only one redirected printer that matches the comment filter.

All the hard work of determining what had to be done was performed by my colleague Peter Scheilen. I just converted it to PowerShell.

 
2 Comments

Posted by on February 18, 2013 in ICT, Microsoft

 

Tags: , , , , , , , , , , , ,

 
%d bloggers like this: