Yeah.. I feel bad making mark work so hard to help me. We found this article and implemented this instead...
http://www.grouppolicy.biz/2010/01/how-to-use-group-policy-preferences-to-dynamically-map-printers-with-roaming-profiles/
Your way will probably be a more efficient way to remove all the networked printers... I'm just confused where to put that in the following code. I've tried a variety of different options.. can't seem to figure it out :
set objNetwork = WScript.CreateObject("WScript.Network")
sIP = GetIP()
If...
So this is the most ideal code for this situation? This seems like it would clear the existing printers before adding the new ones, correct?
case "146","147"
objNetwork.RemoveWindowsPrinterConnection "\\NESVR-PRT01\FLR1_HP_CLR1"
objNetwork.RemoveWindowsPrinterConnection...
You can identify where a computer is by the IP address. Each floor has 2 subnets designated to it differentiated by the 3rd octet.
10.231.144 & 145 = 1st floor
10.231.146 & 147 = 2nd floor
10.231.148 & 149 = 3rd Floor
Yes Mark that helps a lot thank you... I do have 1 last question. I will attach 1 floor of printers, I have another 2 to add... I want to make it so that it will remove other floor printers if a PC is connect to a new floor. (Ex, there a PC on floor 1 that moves to floor 2... will remove floor 1...
Sorry if that was confusing... this is what it looks like now with an error on line 15 stating "the network path was not found."
FYI, "\\nesvr-prt01\!Print drivers\Omaha Printers\add_2nd_flr_printers.bat" is a shared path on our printer server that everyone can access
Dim objShell
Set...
Haha.. figured it out after I thought about it. Now with the following code I get an error on line 13 that says "the printer name is invalid." but I think it is because I'm am trying to run a .bat file. I replaced \\nesvr-prt01\!Print drivers\Omaha Printers\add_2nd_flr_printers.bat with...
Okay Mark, that seems easier than what I had... how would you replace that in the current code so that it is functional? I tried the following but get an error on line 6. Sorry I'm so new at scripting, literally picked it up this last week.
set objNetwork =...
Ok so I updated a few things... I do not get any error codes but when I run the vbscript the printer scripts from the print server are not running so I'm assuming something isn't right.. do you have any idea what that might be?
set objNetwork = WScript.CreateObject("WScript.Network")
sIP =...
Sounds good.. I made a few tweaks. My goal is to have this be a logon script where it pulls the IP from the workstation and then determines, based on the third octet of the IP, which printer script to run. Does that make sense? I appreciate your help.
dim NIC1, Nic, sIP
Set NIC1 =...
Honestly, I don't know anything about scripting so I was hoping to just use some of the code that was in the previous post. Here's what I have...
Set objShell = CreateObject("Wscript.Shell")
set objExec = objShell.Exec("%comspec% /c ipconfig.exe")
set objNetwork =...
thread329-1642011
Does anyone know what the resolution to this thread was for the network printing portion? I'm in the same spot as this guy was... I am looking for a VBScript that automatically adds printers based on the third octet in the IP address to determine which set of printers get...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.