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...

  1. Get the printer to publish:
    $Printer = Get-Printer -Name SalesPrinter1
  2. Display the publication status:
    $Printer | Format-Table -Property Name, Published
  3. Set the printer details and publish the printer to AD:
    $Printer | Set-Printer -Location '10th floor 10E4'
    $Printer | Set-Printer -Shared $true -Published $true
  4. View the updated publication status:
    Get-Printer -Name SalesPrinter1 |
        Format-Table -Property Name, Location, Drivername, Published
  5. See the shared printer status:
    Get-SmbShare -Name SalesPrinter1

How it works…

In step 1, you retrieved the printer details for the SalesPrinter1 printer that you set up in the Installing and sharing printers recipe. There's no output from this step.

In step 2, you display the printer details and can see that the printer is unpublished, which looks like this:

How it works…

In step 3, you use the Set-Printer cmdlet to set the location details for the printer and publish the printer in AD. This step updates the printer details in the AD and produces no output.

In step 4, you view the details of the printer, which looks like this:

How it works…

There's more...

Publishing a printer to AD allows users to locate printers near them using the Add Printer dialog to search for published printers. For example, if you log into the client computer, CL1, you can get to this dialog by clicking Start | Settings | Devices | Printers & scanners to bring up the Add printers & scanners dialog. From this dialog box, click Add a printer or scanner. Wait until the search is complete, then click on The printer that I want isn't listed, which brings up the Add Printer dialog, like this:

There's more...

From this dialog box, click on Next to bring up the Find Printers dialog, which looks like this:

There's more...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.37.151