[] to add a new network printer
PS> (New-Object -ComObject WScript.Network).AddWindowsPrinterConnection("\\Printserver01\Xerox5")
[] to set the default printer
PS> (Get-WmiObject -ComputerName . -Class Win32_Printer -Filter "Name='HP LaserJet 5Si'").SetDefaultPrinter()
or,
PS> (New-Object -ComObject WScript.Network).SetDefaultPrinter('HP LaserJet 5Si')
[] to remove a printer connection
PS> (New-Object -ComObject WScript.Network).RemovePrinterConnection("\\Printserver01\Xerox5")
Monday, January 19, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment