Universal Print Powershell Module

👋 Introduction
The UniversalPrintManagement PowerShell module is designed for managing and administrating Universal Print resources from the command line.
INFO
The code samples on the official Microsoft Learn Page do not work at the moment, so I corrected them and you can find them together with the standard commands below or as scipts in my Github.
💿 Installation
Microsoft provides a special Poweshell Module to manage Universal Print.
powershell
Install-Module UniversalPrintManagement
🔛 Microsoft Graph Connection
Connect to the Microsoft Graph with this special Universal Print Powershell Module command.
powershell
Connect-UPService
🛃 Powershell Module Commands
The following command retrieves a list of all available cmdlets in the Universal Print Management module.
powershell
Get-Command -Module UniversalPrintManagement
Below you find the available commands, along with their descriptions.
Sign-in
Cmdlet | Description |
---|---|
Connect-UPService | Connects with an authenticated account to use for Universal Print cmdlet requests. |
Printers
Cmdlet | Description |
---|---|
Get-UPPrinter | Use this cmdlet to get information about a single or list of printers. |
Remove-UPPrinter | Use this cmdlet to unregister printers. |
Printer Properties
Cmdlet | Description |
---|---|
Set-UPPrinterProperty | Use this cmdlet to update mutable properties of a printer. |
Printer Shares
Cmdlet | Description |
---|---|
New-UPPrinterShare | Use this cmdlet to share a printer. |
Get-UPPrinterShare | Use this cmdlet to get information about a single or list of shared printers. |
Remove-UPPrinterShare | Use this cmdlet to unshare printers that have been shared earlier. |
Set-UPPrinterShare | Use this cmdlet to update a printer share to swap a registered printer due for maintenance with a working one. |
User Permissions
Cmdlet | Description |
---|---|
Grant-UPAccess | Use this cmdlet to grant print access to a user or group or all users in the organization. |
Revoke-UPAccess | Use this cmdlet to revoke print access from a user or group or all users in the organization. |
Get-UPAllowedMember | Use this cmdlet to get information about users and groups that have print access to a specific printer. |
Connectors
Cmdlet | Description |
---|---|
Get-UPConnector | Use this cmdlet to get information about a single or list of connectors. |
Remove-UPConnector | Use this cmdlet to unregister connectors. |
Connector Properties
Cmdlet | Description |
---|---|
Set-UPConnectorProperty | Use this cmdlet to update mutable properties of a connector. |
Print Jobs
Cmdlet | Description |
---|---|
Get-UPPrintJob | Use this cmdlet to get information about print jobs that were sent to a printer. |
Print Job Reports
Cmdlet | Description |
---|---|
Get-UPUsageReport | Use this cmdlet to get different types of print usage reports. |
📜 Use Case Samples
Batch share all printers
powershell
Import-Module UniversalPrintManagement
connect-uPService
$printers = get-upprinter
foreach($printer in $printers.results){
new-upprintershare -PrinterId $printer.id -ShareName $printer.displayname -confirm
}
Batch grant all users access to shared printers
powershell
Import-Module UniversalPrintManagement
connect-uPService
$Shares = Get-UPPrinterShare
foreach($share in $shares.results){Grant-UPAccess -ShareID $share.id -AllUsersAccess}
Remove all Shares
powershell
Import-Module UniversalPrintManagement
connect-uPService
$shares = get-upPrinterShare
foreach($share in $shares.results){remove-upprintershare -ShareID $share.id -confirm}