I am trying to get a vbs script that will map a network printer to a specific computer and user name. The domain has 4000+ users, 5000+ computers and 1500 printers. I would like to create a VBS script that would ask the USER to:
-Enter computer name:
-Enter user name
-Enter Network printer address
(For example: \\server\printer name)
- Type yes or no to make the printer the default.
I found a vbs script that does some of the above, but only on a local pc. Is there any way to change the code to incorporate all of the above:
Code:
Set WshNetwork = CreateObject("WScript.Network")
strFullPath = Inputbox("Please enter the full path of your network printer here:","")
'Use the above line if you have multiple print servers. Use the following 2 lines if you always
'print from the same print server. Just type in your server name below and save before running.
strPrintSrvrPath = ""
'strPrinterName = Inputbox("Please enter the name of your network printer here:","")
If strFullPath = "" Then
strFullPath = strPrintSrvrPath & strPrinterName
End If
WshNetwork.AddWindowsPrinterConnection strFullPath
Msgbox "Printer " & strFullPath & " Installed"
Bookmarks