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
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
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
You can try with the below command by launching the powershell as a administrator on the local machines.
Add-Printer -Name "mxdw 2" -DriverName "Microsoft XPS Document Writer v4" -PortName "portprompt:" -ConnectionName \\server\printername
This command adds a printer with name "mxdw2" to the local computer. The "mxdw" printer uses the "Microsoft XPS
People need to install a printer, because they use BYOD.
If you Write a PowerShell script, asking for the users domain name, if they have any?
It' also need to have permissions to the printer share.
Then you can make a PowerShell script that ask for the domain name like this.
Then you can use the command.
If you don't want to give out the username and password then I can help you With that to.
You must be logged in to reply to this topic.