Solved

XP Printer sharing.

Posted on 2004-10-18
18
1,900 Views
Last Modified: 2012-05-05
This is going to be an easy one. I'm tired of looking stuff up today and have alot of work. So I'll leave this to you guys.

I have a Windows 2000 Server (SP4) and about 20-25 XP Pro clients. This is a school cad drawing class mini network . Their on their own network with a Router. Currently everything except the printers is setup and working perfectly. There are 3 printers in which I need to have on every client. Right now they are all installed on the server and shared from there. Each client machine has Deep Freeze on it which erases all the settings/files changes that are made on the workstations. I logged on to the workstations under the local machine and the domain. I added the printers and when I log off and log on the domain as a different user the printers arn't there. This is a classroom with 6 periods and about 80-100 students total. So far I can only get the printers to stay if I log on the same PC with the same Login. I am missing something easy here. The Deep Freeze program is off when I do all the changes so we can pretty much ignore the fact that I have it. All the clients were imaged, and I just started working here so I don't know anything about the setup. I've done this 1000 times before and never came across this problem.

Simplified: I need all 3 printers on all setup to use on the workstations, and available for all users. If at all possible to do scripts or anything to simplify the process for me would be a bonus. The points are maxed because I want this done today. I have a billion projects to clean up for this school. If I don't get it done today then I'll probably drop this question and just figure it out when I get more time.
0
Comment
Question by:DoTheDEW335
  • 8
  • 6
  • 3
  • +1
18 Comments
 
LVL 22

Expert Comment

by:Bartender_1
ID: 12339515
Does it have to be via script?
You should be able to specify the default printer in the group policy.

Hope this helps!

:o)

Bartender_1
0
 
LVL 5

Accepted Solution

by:
georgecooldude earned 250 total points
ID: 12339532
net use LPT1: \\servername\printername /yes

put the above in the logon script. It is a .bat script.


This might be of use:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q314499


0
 
LVL 22

Expert Comment

by:Bartender_1
ID: 12339560
If it must be via script, try this:

Prncnfg.vbs Configures or displays configuration information about a printer. Used without parameters, prncnfg.vbs displays command-line help for the prncnfg.vbs command.

To display configuration information about a printer

Syntax
cscript prncnfg.vbs -g [-s RemoteComputer] -p PrinterName [-u UserName -w Password]

Parameters
-g
Required. Specifies that you want to display configuration information about a printer.
-s RemoteComputer
Specifies, by name, the remote computer that manages the printer about which you want to display information. If you do not specify a computer, the local computer is used.
-p PrinterName
Required. Specifies, by name, the printer about which you want to display information.
-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer that hosts the printer about which you want to display information. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.
/?
Displays help at the command prompt.
Remarks
This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.
If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").
Examples
To display configuration information for the printer named ColorPrinter_2 whose print queue is hosted by the remote computer named HRServer, type:

cscript prncnfg.vbs -g -s HRServer -p ColorPrinter_2

To configure a printer

Syntax
cscript prncnfg.vbs -t [-s RemoteComputer] -p PrinterName [-u UserName -w Password] [-r PortName] [-l Location] [-m Comment] [-h ShareName] [-f SeparatorText] [-y DataType] [-st StartTime] [-ut EndTime] [-o Priority] [-i DefaultPriority] [{+ | -}shared] [{+ | -}direct] [{+ | -}published] [{+ | -}hidden] [{+ | -}rawonly] [{+ | -}queued] [{+ | -}keepprintedjobs] [{+ | -}workoffline] [{+ | -}enabledevq] [{+ | -}docompletefirst][{+ | -}enablebidi]

Parameters
-t
Required. Specifies that you want to configure a printer.
-s RemoteComputer
Specifies, by name, the remote computer that manages the printer you want to configure. If you do not specify a computer, the printer is configured on the local computer.
-p PrinterName
Required. Specifies, by name, the printer you want to configure.
-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer on which you want to configure a printer. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.
-r PortName
Specifies the port to which the printer is connected. If this is a parallel or a serial port, then use the ID of the port (for example, LPT1 or COM1). If this is a TCP/IP port, then use the port name that was specified when the port was added. For more information, see Related Topics.
-l Location
Specifies the printer location, such as "Copier Room."
-m Comment
Specifies the comment string.
-h ShareName
Specifies the share name.
-f SeparatorText
Specifies a file that contains the text that appears on the separator page.
-y DataType
Specifies the data types that the printer can accept. For more information on data types, see Related Topics.
-st StartTime
Configures the printer for limited availability. Specifies the time of day after which the printer is available. If you send a document to a printer when it is unavailable, the document is held (spooled) until the printer becomes available. You must specify time as a 24-hour clock. For example, to specify 11 P.M., type 2300.
-ut EndTime
Configures the printer for limited availability. Specifies the time of day after which the printer is no longer available. If you send a document to a printer when it is unavailable, the document is held (spooled) until the printer becomes available. You must specify time as a 24-hour clock. For example, to specify 11 P.M., type 2300.
-o Priority
Specifies a priority that the spooler uses to route print jobs. A print queue with a higher priority receives all its jobs before any queue with a lower priority.
-i DefaultPriority
Specifies the default priority assigned to each print job.
{+ | -}shared
Specifies whether this printer is shared on the network.
{+ | -}direct
Specifies whether the document should be sent directly to the printer without being spooled.
{+ | -}published
Specifies whether this printer should be published in Active Directory. If you publish the printer, other users can search for it based on its location and capabilities, such as color printing and stapling.
{+ | -}hidden
Reserved function.
{+ | -}rawonly
Specifies whether only raw data print jobs can be spooled on this queue.
{+ | -}queued
Specifies that the printer should not begin to print until after the last page of the document is spooled. The printing program is unavailable until the document has finished printing. However, using this option ensures that the whole document is available to the printer.
{+ | -}keepprintedjobs
Specifies whether the spooler should retain documents after they are printed. Enabling this option allows a user to resubmit a document to the printer from the print queue instead of from the printing program.
{+ | -}workoffline
Specifies whether you should be able to send print jobs to the print queue even if your computer is not connected to the network.
{+ | -}enabledevq
Specifies whether print jobs that do not match the printer setup (for example, PostScript files spooled to non-PostScript printers) should be held in the queue rather than being printed.
{+ | -}docompletefirst
Specifies whether the spooler should send to the appropriate queue print jobs with a lower priority that have completed spooling before sending to the same queue print jobs with a higher priority that have not completed spooling. If this option is enabled and no documents have completed spooling, the spooler will send larger documents before smaller ones. You should enable this option if you want to maximize printer efficiency at the cost of job priority. If this option is disabled, the spooler always sends higher priority jobs to their respective queues first.
{+ | -}enablebidi
Specifies whether the printer sends status information to the spooler.
/?
Displays help at the command prompt.
Remarks
This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.
If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").
Examples
To configure a printer named ColorPrinter_2 so that the spooler in the remote computer named HRServer keeps print jobs after they have been printed, type:

cscript prncnfg.vbs -t -s HRServer -p ColorPrinter_2 +keepprintedjobs

Hope this helps!

:o)

Bartender_1

0
 
LVL 5

Expert Comment

by:georgecooldude
ID: 12339562
And another link that may be of use to you:

http://www.tycho7.com/Software/Win2k/logon_scripts.htm
0
 
LVL 22

Expert Comment

by:Bartender_1
ID: 12339576
Whoops, wrong command, this is the correct one for adding a printer:

cscript prnmngr.vbs -a -p PrinterName [-s RemoteComputer] -m DriverName -r PortName [-u UserName -w Password]

Parameters
-a
Required. Specifies that you want to add a local printer.
-s RemoteComputer
Specifies, by name, the remote computer to which you want to add a local printer. If you do not specify a computer, the printer is added to the local computer.
-p PrinterName
Required. Specifies, by name, the local printer that you want to add.
-m DriverName
Required. Specifies, by name, the driver for the local printer you want to add. Drivers are often named for the model of printer they support. See the printer documentation for more information.
-r PortName
Required. Specifies the port to which the printer is connected. If this is a parallel or a serial port, use the ID of the port (for example, LPT1 or COM1). If this is a TCP/IP port, use the port name that was specified when the port was added. For more information, see Related Topics.
-u UserName -w Password
Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer to which you want to add a local printer. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.
/?
Displays help at the command prompt.
Remarks
This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.
If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

Hope this helps!

:o)

Bartender_1
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12339998
1st of all thanks for the suggestions and quick responses. (I posted this before I went to lunch)

This does not have to be a script solution. If there is an easier one shoot it out! I'm trying to find the easiest way to do this. Now that I think about it, I'd rather not have a script unless I have to. I also forgot to meantion that I have each user in a group for their period. Eg. 10 students in the 1st class are in the group Mod 2 (1st class for this subject but 2nd period of the school day)

Bartender_1: I'll check the group policy thing but there are 3 printers so I'm not sure that will work for a solution.

Georgecooldude: I was going to use that as a last resort. I am hopeing to find a better solution than that (although it isn't a bad solution)
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12340043
Georgecooldude: That 2nd link is a good one for the solution you provided. Even if I don't use your solutions, so far the two of you definatly will get some of the action.
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12340089
(This sounds silly but i'm having a brain fart)

If I use a script is there a policy or somthing I can change to make it so every user who logs on to the domain runs that script automatically? I really am trying to not go to each user's properties and add the script.
0
 
LVL 22

Assisted Solution

by:Bartender_1
Bartender_1 earned 250 total points
ID: 12340112
This command will allow you to add printer drivers, and specify the default printer to computers:
check the /y parameter

---------------------------------------------------------

a[file] binary file name
/b[name] base printer name
/c[name] unc machine name if the action is on a remote machine
/dl delete local printer
/dn delete network printer connection
/dd delete printer driver
/e display printing preferences
/f[file] either inf file or output file
/ga add per machine printer connections
/ge enum per machine printer connections
/gd delete per machine printer connections
/h[arch] driver architecture one of the following: Alpha | Intel | IA64
/ia install printer driver using inf file
/id  install printer driver using add printer driver wizard
/if install printer using inf file
/ii install printer using add printer wizard with an inf file
/il install printer using add printer wizard
/in add network printer connection
/j[provider] print provider name
/k print test page to specified printer, cannot be combined with command when installing a printer
/l[path] printer driver source path
/m[model]  printer driver model name
/n[name] printer name
/o display printer queue view
/p display printer properties
/q quiet mode, do not display error messages
/r[port] port name
/s display server properties
/Ss Store printer settings into a file *
/Sr Restore printer settings from a file *
   * Store or restore printer settings option flags that must be placed at the end of command:2 PRINTER_INFO_2
7 PRINTER_INFO_7
c Color Profile
d PrinterData
s Security descriptor
g Global DevMode
m Minimal settings
u User DevMode
r Resolve name conflicts
f Force name
p Resolve port
 
 
/u  use the existing printer driver if it's already installed
/t[#] zero based index page to start on
/v[version] driver version one of the following:
Windows 95, 98 and Me | Windows NT 4.0 | Windows NT 4.0 or 2000 | Windows 2000 or XP | Windows XP
/w  prompt the user for a driver if specified driver is not found in the inf
/y set printer as the default
/Xg get printer settings
/Xs set printer settings
/z  do not auto share this printer
/Y do not auto generate a printer name
/K changes the meaning of /v and /h to accept 0,1,2,3, respectively:
Windows IA64 | Windows NT x86 | Windows NT Alpha_AXP | Windows 4.0
/Z share this printer, can only be used with the /if option
/? On-Line Help
@[file] command line argument file
/Mw[message] show a warning message before committing the command
/Mq[message]  show a confirmation message before committing the command
/W[flags] specifies flags and switches for the wizards (for APW & APDW)r make the wizards to be restart-able from the last page
 
/G[flags] specifies global flags and switchesw suppress setup driver warnings UI (super quiet mode)
 


Examples:


Run server properties:
rundll32 printui.dll,PrintUIEntry /s /t1 /n\\machine

Run printer properties:
rundll32 printui.dll,PrintUIEntry /p /n\\machine\printer

Run add printer wizard localy:
rundll32 printui.dll,PrintUIEntry /il

Run add printer wizard on \\machine:
rundll32 printui.dll,PrintUIEntry /il /c\\machine

Run queue view:
rundll32 printui.dll,PrintUIEntry /o /n\\machine\printer

Run inf install:
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "AGFA-AccuSet v52.3"

Run add printer wizard using inf:
rundll32 printui.dll,PrintUIEntry /ii /f %windir%\inf\ntprint.inf

Add per machine printer connection:
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer /j"LanMan Print Services"

Delete per machine printer connection:
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer

Enumerate per machine printer connections:
rundll32 printui.dll,PrintUIEntry /ge /c\\machine

Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 or XP" /f %windir%\inf\ntprint.inf

Add printer driver using inf:
rundll32 printui.dll,PrintUIEntry /ia /K /c\\machine /m "AGFA-AccuSet v52.3" /h "Windows NT x86" /v 3

Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 or XP"

Remove printer driver:
rundll32 printui.dll,PrintUIEntry /dd /K /c\\machine /m "AGFA-AccuSet v52.3" /h "Windows NT x86" /v 3

Set printer as default:
rundll32 printui.dll,PrintUIEntry /y /n "printer"

Set printer comment:
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" comment "My Cool Printer"

Get printer settings:
rundll32 printui.dll,PrintUIEntry /Xg /n "printer"

Get printer settings saving results in a file:
rundll32 printui.dll,PrintUIEntry /f "results.txt" /Xg /n "printer"

Set printer settings command usage:
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" ?

Store all printer settings into a file:
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat"

Restore all printer settings from a file:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat"

Store printer information on level 2 into a file :
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat" 2

Restore from a file printer security descriptor:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" s

Restore from a file printer global devmode and printer data:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" g d

Restore from a file minimum settings and resolve port name:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" m p

The above is copied from: http:Q_21101041.html

Hope this helps!

:o)

Bartender_1
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 22

Expert Comment

by:Bartender_1
ID: 12340458
Put it in the netlogon folder share of your server. Then you can specify that logon script for each account.

Hope this helps!

:o)

Bartender_1
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12340539
Bartender_1

<<Put it in the netlogon folder share of your server. Then you can specify that logon script for each account>>

That is what I was going to do but I'm looking for something easier than going to the user manager and going through 100 users and putting in a script for each one. I'd like to just add it to 1 thing that makes everyone use the script on logon.
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12344335
Not 1 other person has a comment for this?!?!? I'll give it till round noon time EST and if nothing else is posted i'll split it between you two.
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12347828
Ok well I waited even longer, and still didn't get a reply I hope you'll feel this is fair that I split it. I am accepting Bartender_1 as he has alot of time into this. I am still giving George's comments an assist. I wish I could have found a way to put this into a 1 shot thing (logon script that is executed for everyone that connects to the domain without having to edit 100 users and put a logon script in thier profile) but oh well. I'm going to do what I planned on doing all along. I just wish I didn't have to edit 100 users, because I will have to do it all over again next year.  Thanks for your time and input on this.
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12347884
I am sorry I read that all wrong, I wanted Georges as the accept because it is what I was planning on doing and it's much more simple than Bartender_1's method, which both of your suggestions require me to goto each user and add the script in their profile. I hope this is ok, I split the points 250 to each.
0
 
LVL 5

Expert Comment

by:georgecooldude
ID: 12347905
thanks! :-)
0
 
LVL 22

Expert Comment

by:Bartender_1
ID: 12348732
I'm sorry I was unable to provide a complete solution for you.

Thanks for the points!

Cheers!

:o)

Bartender_1
0
 
LVL 11

Author Comment

by:DoTheDEW335
ID: 12359375
Bartender_1 nothing to be sorry about. You provided alot of information you should be proud if anything. I'm glad the point awarding was ok with you both! Thanks again for your input.
0
 
LVL 18

Expert Comment

by:luv2smile
ID: 12403351
For future reference:

The accepted answer ONLY is for MS DOS programs that need to print to a networked printer. This method will NOT make the printer show up in control panel- printers.

To accomplish this, you need a different method. Here is the one I use that is widely used. Mapping printers is very simple and does not take a lot of lines of code:

http://www.computerperformance.co.uk/Logon/LogonScript_Printer.htm

And the best way to map printers is thru a logon script that can be applied to users thru the use of group policy.

In the group policy snap in:

User Config- Windows Settings- Scripts (logon/logoff)- then double click on logon:

click show files and then copy the script file you've created into this folder:

Then exit the window and click the "add" button....you should then see the script listed when you click browse...select in then hit ok.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now