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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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"
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Printers and Scanners

From novice to tech pro — start learning today.