Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mapping printers to specific computers in domain 1

Status
Not open for further replies.

sonuteklists

Technical User
Jul 20, 2004
233
US
Can anyone kindly provide me with steps/ howtos to set up a logon script that would map printers.
I need to know the entire process on how it is done as I havent done it before including setting up the required GP for only some computers in the domain. Right now I only need to map computers and maybe a couple of shared Novell drives .
Thanks.
 
OK, so here is your most basic of scripts to do what you are asking. Copy and pste this info into a text file and call it login.vbs. Change the UNC paths as needed.

Code:
Dim WSHNetwork
Set WSHNetwork = CreateObject("WScript.Network")
'Install Printer
WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"
'Map a drive
WSHNetwork.MapNetworkDrive "U:", "\\server\users",True

Now open up your GPMC. Create a new GPO by right clicking in the GPO list and choose Create and Link a New GPO.

When it is created highlight it, then right click and choose edit.

Drill down to User Configuration, Windows Settings, Scripts. Double click login. Click show files. Paste your login script there and close the files box. Click the add button and select your login script.

You are for the most part done. All you really need to work out is the security of who you want it to be applied to. To do that, from within the GPO right click the GPO name in the top of the GPO screen and choose properties. On the security tab you set the permissions. I always advise adding Administrator tot hr list and choosing to Deny Policy Applicaiton. If you ever modify the policy and restrict anything you wil be very glad you did this so you don't lock the admin ID out of anything.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Mark,
Thanks a lot. I will play around and let know of what happens. In the meanwhile, I need a clarification.

I have a printserver on which I have installed and shared many printers (atleast a dozen). On the client machines I have installed the printers by going to and then 'connect'ing to each of the printers to install them.
Now if I move the printserver to the domain, will anything be affected. Would I have to reinstall and share the printers on the printserver and will I have to repeat the process on all the individual client machines as well.

Also, will this affect the script you have mentioned above. Does if matter if the printserver is in a workgroup or in the domain.

How will this look like if the printer is on a printserver,
WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"

Let say, I have installed and shared it as "HPColor"
Please advise.
Thanks.
 
The only thing that matters is the Print Servers name. If it was say "PrintServer" outside the domain and you add it to the domain. Your path would be \\printserver\printername or in your case \\PrintServer\HPColor. But moving it to the domain if the server name remains the same shouldn't cause any issues.

Aaron
 
A few other things. Please excuse my ignorance.

I didnt find GPMC in MMC. I only found the Group POlicy Object Editor. Is there something else I am missing and need to install.

How do I control the security for the mapped drives as in who will have what access. Is this how ??
Edit: "To do that, from within the GPO right click the GPO name in the top of the GPO screen and choose properties. On the security tab you set the permissions"

Thanks.
 
Never mind about the GPMC. I downloaded and installed it, but I still need answer for the other question.
Thanks
 
Some updates.
For some reason, it did not work.
I did everything as outlined, but it did not map the printers.

I tried to (in windows explorer) open \\printserver\printername, and it asked me for credentials. Even after giving the credentials, it didnt take me anywhere and gave me the same prompt again.
What should I do.

Also, how do I delete previously mapped printers/shares before mapping them afresh at logon OR should I ??

Shouldnt I be appying this policy to computers and not users. I mean, shouldnt the security be applied to a group of computers ?? Can it be ??

Please advise.
Thanks.
 
I am sorry it hasnt worked for me yet.
Even when I try to map \\printserver\printername I get an access denied error.
Read through some doc in microsoft.com, hasnt helped.
Can anyone help me with the right link, doc, howto to et this done from start to finish, step-by-step.
I want to map printers from a workgroup printserver to the domain computers using group policy. I need a detailed guide to achieve this from start to finish.
The printserver is not part of the domain and I wont make it part of the domain until I am absolutely sure that it affect the current users who are using the printserver. Has anyone moved a workgroup based printserver to the domain without affecting the users who are not part of the domain ??
Markdman, any advice.
Thanks,
 
the issue that you are having is that your users do not have rights to the workgroup printer. short of manually added all accounts and user name. (don't even mention the pain involved with keeping passwords sync'd)


Add the machine to the domain, there would be no issues at all regarding legacy access, however the server could then have GPo applied to it. and the script provided by markdmac would work. providing that you have granted users access to the relevant printers

GPO is part of AD and as such can not be used to manage any machine outside of the domain/forest
 
Couple of things I'd like clarification on please.

First off, is the print server an appliance or a computer?

Second, do you have the drivers for these printers installed? A user will typically get the error you describe if the system connects them to a network printer and the user does not have the rights to install the drivers for said printer.

I hope you find this post helpful.

Regards,

Mark
 
Mark,
The printserver is a computer.
On the printserver, I have the drivers installed, installed the printer, and shared the printer.
I have installed the printer as a normal user from client laptops and desktops ...
Also, on the DC on which I have the GP, after I reboot and login, I get some error about the GP, about permissions, I guess. Dont know the exact way it goes, will post the exact message later as soon as I can.
Thanks.
 
wait.. could this be done TO computers in an OU.. so if you have roaming users, say that go from a library to a class, the users can print to the printer that is located in there room, by using groops?? and this login script for speret ou's of computers??
 
OK, so the print server is a computer. What OS is it running? Is it XP? Does it have all the drivers loaded that your clients will require?

I would suggest that you backup your printers using printmig and then move the machine into the domain. You will fight a lot less battles that way since the security will then be centralized.


I hope you find this post helpful.

Regards,

Mark
 
It is running Windows 2000 Server.

Also, after login I get the following error regarding the GP.

Windows Script Host Window
Script: Login.vbs
Line: 4
Char:1
Error: Permission Denied
Code: 800A0046
Source: Microsoft VBScript Runtime Error

Here's Login.vbs

Dim WSHNetwork
Set WSHNetwork = CreateObject("WScript.Network")
'Install Printer
WSHNetwork.AddWindowsPrinterConnection "\\printserver\Xerox Phaser 6250DP"
WSHNetwork.AddWindowsPrinterConnection "\\printserver\HP LaserJet 4050 Series PS"
WSHNetwork.AddWindowsPrinterConnection "\\printserver\HP 8150"

Thanks.
 
First thing for you to do is to try executing the script manually. If you get the same error then your problem is security related and as I posted earlier you probably have a problem where the user does not have rights to install the drivers.

Are your workstations all Win2K or XP also? Does your print server have the XP drivers loaded? That would be important.

Again, I suggest that you move the computer to the domain to see if that will rectify any permissions problems, but you also need to make sure that all of the drivers are loaded locally on the computers that will get the printers mapped.

You should check out MSKB 314486 for information on how to push out the drivers without having to go to each PC.




I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top