Add / remove printers on existing SBS 2003 R2 network - this is probaby real basic but I need help!

My SBS networks are very steady state.  But I have 1 where the 2 original network printers are 1 - being removed and another is being moved to a desktop.

ANd a new network printer is coming in.

without going to every desktop (we have local profiles, not roaming), how do I:

remove the 2 old printers from each person's list of printers
Add this new printer to each person's list of printers (I know how to add it to the server and share it, but then how does that show up on each machine.  I know when setting up SBS with the wizards, you set up the printer first and then the users get the printers that exist at that point.  but going forward how do you add / remove printers to each user's profile)?

ANd the 1 printer that is being connected to a desktop and shared to a couple pcs in that room.  How do we keep xp from automatically adding that printer to everyone's profile because it's a shared printer on the same subnet - you know - you get that 'auto HP laserjet....' icon that was created automatically by the xp desktop.

Who is Participating?
EddyGurgeConnect With a Mentor Commented:
While I am no real expert on this topic, I did just do almost this exact same thing last week.  In this case it was the removal and replacement of a shared network printer. The following vbs script is what I used to remove the old one, and add the new one.  I added this to the login group policy of the OU

Set objWSHNetwork = CreateObject("WScript.Network")  'create network object
strConnectString = "\\server1\NewPrinterShareName"
strResult = objWSHNetwork.AddWindowsPrinterConnection(strConnectString)
strConnectString = "\\server1\OldPrinterShareName"
On Error Resume Next
strResult = objWSHNetwork.RemoveWindowsPrinterConnection(strConnectString)
Oh, and I should mention the script actually adds the new one, THEN deletes the old one.  Not sure if that was clear or not from the script.
babaganooshAuthor Commented:
thanks for the info.  I came across this - I don't know the first thing about vb script.  this also sets the default printer.

yours, every time you log in, (tries to) delete the old printer?  That's OK?

how does yours with the strconnectstring differ from this net.....

Dim net
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\spock\LJ4014n"

' Set the default printer now
' net.SetDefaultPrinter "\\spock\lj4014n"

and I guess i'd add
net.RemoveWindowsPrinterConnection "\\spock\lj4050"
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

babaganooshAuthor Commented:
ok, on an xp box, I got an error about the last line - remove

And the default pritner comment is remmed out, right?  I think that was because some people didn't want the 4050 as their default.

I'll use your script I guess : ) ?
babaganooshAuthor Commented:
but again - what is the difference in your script and mine (mine being the net. command at the start... and your delete command works)
I'm not a script expert at all, but I do notice that in the one I use, the printer name is put into a variable, then used in the command.  On the description pages for these commands from Microsoft, it also uses a variable, instead of a string when connecting and disconnecting.  Check here:

As far as it trying to remove the printer every time, I've had no issues at all.  I didn't see an IfExist type method to add, but it seems to work perfectly now.  I figure after a few months, I'll just rem the script out anyway.

babaganooshAuthor Commented:
Thanks for the info.  

I may have missed something - you said 'I added this to the login group policy of the OU'

I set this up as a file called printer.vbs and then called it from the logon batch file.  are you doing something different?

And I had to remove 'windows'  from your

command.  which is how it shows in that link you included!  

Yeah, I don't know the first thing about scripts myself.  just enough to take code someone else used, and maybe change some fields to do what I want it to do!

amazing, I think - they have all these wizards in sbs but nothing for something like this - adding a printer once the network is up and running and deleting old printers.

I'm not fully up on the variances between SBS and regular 2003 server, but it sounds like basically the same thing.  Since I didn't already have any kind of login batch file, I just added the printer script.  As long as you can get it running, that's all that really matters.
babaganooshAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.