Hi, today I want to show you how to share a printer using PowerShell. The cmdlet I will use is Set-Printer. This cmdlet allows to establish or update the configuration of the specified printer.

Set-Printer

To share a printer with PowerShell, use the Set-Printer cmdlet with the following syntax:

The workaround in a local computer

With the Get-Printer cmdlet, we obtain the list of installed printers and their basic properties. The “Shared” column shows us if the printer is already shared.

Get-printer

Now that we have the printer’s data that we want to share, we use the Set-Printer cmdlet. Run PowerShell console as administrator, and then type:

Set-Printer

Then you can verify the job with the Get-Printer cmdlet.

The workaround in a remote computer

To share the printer from a remote server, use the -ComputerName parameter to specify the name or IP of the remote computer. The syntax is the following:

Set-Printer

Again, we verify that the printer is shared with the Get-Printer cmdlet with the -ComputerName parameter.

If you want to know more about the Set-Printer cmdlet, check out this link: https://docs.microsoft.com/en-us/powershell/module/printmanagement/set-printer?view=win10-ps