Publishing a printer to Active Directory
After you create and share a printer (as shown in the previous recipe), you can publish it to the Active Directory. You publish the printer you created in the last recipe and examine the results in this recipe. When you publish a printer, you can also specify a physical location for the printer. Your users can search for published printers based on location and capabilities (such as color printers).
How to do it...
- Getting the printer to publish and store the returned object in $Printer
$Printer = Get-Printer -Name SalesPrinter1
- Viewing the printer details
$Printer | Format-Table -Property Name, Published
- Publishing and sharing the printer to AD
$Printer | Set-Printer -Location '10th floor 10E4'
$Printer | Set-Printer -Shared $true -Published $true
- Viewing the updated publication status
Get-Printer -Name SalesPrinter1 |
Format-Table -Property Name, Location, Drivername, Published
How it works...
In step 1, you...