Jump to content

Script to install printer with another domain credentials


Recommended Posts

Posted

Hi

 

I need to get a printer working from another domain but I cant work out how to add another domain user credentials to a script.

 

Does anyone have an example they could post

 

Thanks

Posted

Worked it out....

 

Option Explicit

Dim objNetwork

Dim strUser, strPassword, strUNCPrinter

strUNCPrinter = "\\server\printer"

strUser = "domain\user"

strPassword = "password"

Set objNetwork = WScript.CreateObject("WScript.Network")

objNetwork.AddWindowsPrinterConnection strUNCPrinter, strUser, strPassword

WScript.Quit

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...