Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

install print queue on pc

$
0
0

hi all,

if I go on my test computer and try this script, it works and the print queue is set in windows:

 

$Printer = "\\PrintServer\Queue"

$net = new-object -com wscript.network

$net.AddWindowsPrinterConnection($Printer)

 

now if I try the same remotely, using the next script, it says that the printer name is not valid. 

 

$sb = {$Printer = "\\PrintServer\Queue"

$net = new-object -com wscript.network

$net.AddWindowsPrinterConnection($Printer)}

invoke-command -computername PCName -scriptblock $sb

 

can someone tell me what is wrong here? I'm using a domain user account and I have access to the print queue.

thanks!


Viewing all articles
Browse latest Browse all 6937

Trending Articles