Publishing a printer
After you create and share a printer, as shown in the previous recipe, you can also publish it to the Active Directory. When you publish a printer, you can also specify a physical location for the printer. Your users can then search for published printers based on location, as well as on capabilities (such as color printers). In this recipe, you publish the printer you created in the previous recipe and examine the results.
Getting ready
Before running this recipe, you need to have the PSRV printer server set up (you did this in the Installing and sharing printers recipe). Additionally, you need SalesPrinter1
created.
How to do it...
Get the printer to publish:
$Printer = Get-Printer -Name SalesPrinter1
Display the publication status:
$Printer | Format-Table -Property Name, Published
Set the printer details and publish the printer to AD:
$Printer | Set-Printer -Location '10th floor 10E4' $Printer | Set-Printer -Shared $true -Published $true
View the updated publication status...