Pubprn.vbs


Applies To: Windows Server 2008,Windows Vista

Publishes a printer to the Active Directory Domain Services.

For examples of how this command can be used, see Examples.

Syntax


Copy Code

Cscript Pubprn.vbs {<ServerName> | <UNCPrinterPath>}
"LDAP://CN=<Container>,DC=<Container>"

Parameters

Parameter

Description

<ServerName>

Specifies the name of the Windows server that hosts the printer that you want to publish. If you do not specify a computer, the local computer is used.

<UNCPrinterPath>

The Universal Naming Convention (UNC) path to the shared printer that you want to publish.

"LDAP://CN=<Container>,DC=<Container>"

Specifies the path to the container in Active Directory Domain Services where you want to publish the printer.

/?

Displays help at the command prompt.

Remarks


Copy Code

Cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Pubprn.vbs

Examples

To publish all printers on the \\Server1 computer to the MyContainer container in the MyDomain.Company.Com domain, type:


Copy Code

Cscript Ppubprn.vbs Server1 "LDAP://CN=MyContainer,DC=MyDomain,DC=Company,DC=Com"

To publish the LaserPrinter1 printer on the \\Server1 server to the MyContainer container in the MyDomain.Company.Com domain, type:


Copy Code

Cscript Ppubprn.vbs \\Server1\LaserPrinter1 "LDAP://CN=MyContainer,DC=MyDomain,DC=Company,DC=Com"

Additional references

Command-Line Syntax Key

Print Command Reference