Professional Windows Server 1002003 Security A Technical Reference [Electronic resources]

Roberta Bragg

نسخه متنی -صفحه : 415/ 361
نمايش فراداده

prncnfgnew in WS2003

Displays information about printers and configures them.

Syntax

prncnfg -g -s RemoteComputer -p PrinterName 
prncnfg -t -s RemoteComputer -p PrinterName [-r PortName] [-h ShareName] 
[-i DefaultPriority] ... [{+ | -}{direct | published | shared |
workoffline ...}]

Options

-g

Displays printer settings

-s RemoteComputer

Name of print server.

-t

Configures printer.

-p PrinterName

Name of printer.

-r PortName

COM, LPT, or TCP/IP port of printer.

-h ShareName

Share name of printer.

-i DefaultPriority

Default priority for new jobs.

direct

Prints directly to printer (doesn't spool).

published

Publishes printer in Active Directory.

shared

Shares printer on network.

workoffline

Users can submit jobs to print queue even if their computers are offline.

Examples

Display information about printer named

SalesPrinter managed by local computer:

prncnfg -g -p SalesPrinter
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Server name
Printer name SalesPrinter
Share name 
Driver name HP Color LaserJet
Port name LPT1:
Comment
Location
Separator file
Print processor WinPrint
Data type RAW
Parameters
Priority 1
Default priority 0
Printer always available
Attributes local shared published enable_bidi do_complete_first
Printer status Idle
Extended printer status Unknown
Detected error state Unknown
Extended detected error state Unknown

Share

SalesPrinter with share name

SPRT :

prncnfg -t -p SalesPrinter -h SPRT +shared
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Configured printer SalesPrinter

Verify the result:

prncnfg -g -p SalesPrinter
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Server name
Printer name SalesPrinter
Share name SPRT <---NOTE
Driver name HP Color LaserJet
Port name LPT1:
Comment
Location
Separator file
Print processor WinPrint
Data type RAW
Parameters
Priority 1
Default priority 0
Printer always available
Attributes local shared enable_bidi do_complete_first
Printer status Idle
Extended printer status Unknown
Detected error state Unknown
Extended detected error state Unknown

Notes

  • This command is a

    .vbs script and requires CScript to run. You can make CScript your default script host by typing the following at the command prompt:

    cscript //h:cscript //s
  • This command requires Administrator credentials. If logged on with different credentials, use -u UserName -w Password to specify suitable credentials.

See Also

Printing , prndrvr, prnjobs, prnmngr, prnport, prnqctl