Reputation: 31
I've just installed PowerShell 4.0 on my Win7 SP1 box, (up from the 2.0 native version). PowerShell 3.0 was supposed to have included a bunch of handy printer-specific functions such as Add-Printer, Add-PrinterDriver, etc., but running a 'Get-Command' on my box doesn't show any of the commands I'm looking for.
Do I have to install PowerShell 3.0 to get them?
Upvotes: 3
Views: 8124
Reputation: 21
PowerShell to share and unshare the printers http://winplat.net/2015/12/04/powershell-to-share-and-unshared-the-printers/
Set-Printer -Name DummyPrinter -Shared $True -Published $True -ShareName MyDummyPrinter
Set-Printer -Name DummyPrinter -Shared $True -Published $True -ShareName MyDummyPrinter -ComuterName PrintSvr01
Where,
DummyPrinter
is the name of the print queue,
MyDummyPrinter
is the desired shared name and
PrintSvr01
is the remote server that hosts the printer.
Please note, the parameter -Publish
enabled the option ‘List in Directory’. You can omit if you do not want the option.
get-printer -ComputerName PrintSvr01 | foreach{Set-Printer -name $_.name -Shared $true -ShareName $_.name -Published $true -ComputerName PrintSvr01}
To unshare, set the –Shared parameter to $False
Set-Printer -Name DummyPrinter -Shared $True -ComuterName PrintSvr01
Upvotes: -1
Reputation: 6605
"PrintManagement" module, which includes the commands you mentioned was available with PowerShell v3 on Windows 8 / Windows Server 2012 In a sense, it's tied to the Operating System, not directly to the PowerShell version.
CommandType Name ModuleName
----------- ---- ----------
Function Add-Printer printmanagement
Function Add-PrinterDriver printmanagement
Function Add-PrinterPort printmanagement
Function Get-PrintConfiguration printmanagement
Function Get-Printer printmanagement
Function Get-PrinterDriver printmanagement
Function Get-PrinterPort printmanagement
Function Get-PrinterProperty printmanagement
Function Get-PrintJob printmanagement
Function Read-PrinterNfcTag printmanagement
Function Remove-Printer printmanagement
Function Remove-PrinterDriver printmanagement
Function Remove-PrinterPort printmanagement
Function Remove-PrintJob printmanagement
Function Rename-Printer printmanagement
Function Restart-PrintJob printmanagement
Function Resume-PrintJob printmanagement
Function Set-PrintConfiguration printmanagement
Function Set-Printer printmanagement
Function Set-PrinterProperty printmanagement
Function Suspend-PrintJob printmanagement
Function Write-PrinterNfcTag printmanagement
Upvotes: 4