Hey guys
Right first off I have no experience what so ever with VBscripting or Powershell, so I might need my hand held a bit. I think its the only way I will be able to get this to work though. As I tried through just command prompt scripting but it will not work
Basically I have users who bring their own laptops (which are not bound to AD) (such as BYOD) and they want to be able to automatically install papercut and also install printers
I have been able to create a .EXE package which installs papercut client on their machine and it tries to connect to the printers
The part where it tries to connect to the printers through command prompt fails, as it is not asking the user for their domain username and password
Now I have confirmed this by going to file explorer and typing in the server name and it prompts for a password, then I run the script and all the printers connect fine
so its an issue when I have a new machine that has not authenticated to the print server that the script gets stuck
I have been searching on google and people and even a papercut guy replied back to my e-mail providing me a VBscript that should do the job:
printerName = "\server\PrinterName"strUserName = inputBox(“What is your username (domain\username)”)strPassword = inputBox(“What is your password”)set WshShell = WScript.CreateObject(“WScript.Shell”)set WshNetwork = WScript.CreateObject(“WScript.Network”)WshShell.Run “cmd /k net use " & printerName & " /USER:” & strUserName & " " & strPassword,1,true WshNetwork.AddWindowsPrinterConnection printerName
This is all chinese to me. Can anyone please provide me some help in what and where to edit this script and how to maybe run it with powershell or something? I also want to add a few lines before it to install papercut local client ( which I could probably work out)
I tried editing these parts:
\server\PrinterName but it wont work at all, I am sure I am doing it wrong