|
||||||||
|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|
I'm trying to connect a standalone workstation that is not a member of the
domain to a printer that is shared by a domain member. All networking settings are correct the workstation can see the printer and I can even add it with: rundll32 printui.dll PrintUIEntry /ga /n \\server\printername at which point it asks for username/password to connect since the workstation is not part of the domain. What I need to do write a script to connect to this printer automatically. As you all know asking my users to remember yet another username/password leads to more calls "I forgot user/pass" or "Why doesn't my printer work". I found the way to specify username/password in a drive mapping script: object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword]) Is there something like this for printers? The only thing I could find was: Set WshNetwork = WScript.CreateObject("WScript.Network") PrinterPath = "\\printserv\DefaultPrinter" WshNetwork.AddWindowsPrinterConnection PrinterPath No where have I found a way to specify what username/password to use for the connection. On the domain I have created a user level account with permission to access the printer that I can hard code into the script with minimal security exposure. Any assistance is greatly appreciated! JohnBates |
|
#2
|
|||
|
|||
|
I have found one thing but it is for DOS according to MSDN:
http://msdn2.microsoft.com/en-us/lib...3c(VS.85).aspx object.AddPrinterConnection(strLocalName, strRemoteName[,bUpdateProfile][,strUser][,strPassword]) "JohnBates" wrote: > I'm trying to connect a standalone workstation that is not a member of the > domain to a printer that is shared by a domain member. All networking > settings are correct the workstation can see the printer and I can even add > it with: > > rundll32 printui.dll PrintUIEntry /ga /n \\server\printername > > at which point it asks for username/password to connect since the > workstation is not part of the domain. > > What I need to do write a script to connect to this printer automatically. > As you all know asking my users to remember yet another username/password > leads to more calls "I forgot user/pass" or "Why doesn't my printer work". > > I found the way to specify username/password in a drive mapping script: > > object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], > [strUser], [strPassword]) > > Is there something like this for printers? The only thing I could find was: > > Set WshNetwork = WScript.CreateObject("WScript.Network") > PrinterPath = "\\printserv\DefaultPrinter" > WshNetwork.AddWindowsPrinterConnection PrinterPath > > No where have I found a way to specify what username/password to use for the > connection. On the domain I have created a user level account with > permission to access the printer that I can hard code into the script with > minimal security exposure. > > Any assistance is greatly appreciated! |
|
#3
|
|||
|
|||
|
I have also come across the create same username/password on the
domain/workstation workaround however I cannot do that. The security protection plan requires each user to have a separate username/password and it must be changed every 90 days. "JohnBates" wrote: > I have found one thing but it is for DOS according to MSDN: > http://msdn2.microsoft.com/en-us/lib...3c(VS.85).aspx > > object.AddPrinterConnection(strLocalName, > strRemoteName[,bUpdateProfile][,strUser][,strPassword]) > > "JohnBates" wrote: > > > I'm trying to connect a standalone workstation that is not a member of the > > domain to a printer that is shared by a domain member. All networking > > settings are correct the workstation can see the printer and I can even add > > it with: > > > > rundll32 printui.dll PrintUIEntry /ga /n \\server\printername > > > > at which point it asks for username/password to connect since the > > workstation is not part of the domain. > > > > What I need to do write a script to connect to this printer automatically. > > As you all know asking my users to remember yet another username/password > > leads to more calls "I forgot user/pass" or "Why doesn't my printer work". > > > > I found the way to specify username/password in a drive mapping script: > > > > object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], > > [strUser], [strPassword]) > > > > Is there something like this for printers? The only thing I could find was: > > > > Set WshNetwork = WScript.CreateObject("WScript.Network") > > PrinterPath = "\\printserv\DefaultPrinter" > > WshNetwork.AddWindowsPrinterConnection PrinterPath > > > > No where have I found a way to specify what username/password to use for the > > connection. On the domain I have created a user level account with > > permission to access the printer that I can hard code into the script with > > minimal security exposure. > > > > Any assistance is greatly appreciated! |
|
#4
|
|||
|
|||
|
"JohnBates" <(E-Mail Removed)> wrote in message
news:819149ED-4C78-454E-95F7-(E-Mail Removed)... >I have also come across the create same username/password on the > domain/workstation workaround however I cannot do that. The security > protection plan requires each user to have a separate username/password > and > it must be changed every 90 days. If they are being that picky about security, accounts, and passwords,...then why are you even attempting this with a non-domain member? Make the machine a domain member. Log into it with a Domain Accoutnt that has the correct access to the printer. ....Or use a printer with its own nic and IP# and print to the TCP/IP port and forget about "sharing". -- Phillip Windell www.wandtv.com The views expressed, are my own and not those of my employer, or Microsoft, or anyone else associated with me, including my cats. ----------------------------------------------------- |
|
#5
|
|||
|
|||
|
Well I can't connect it to the domain because the workstation is mobile and
has to be used at 3 different stations that are 3 different domains. Getting them to spend $$ on a printer with a nic or even a print server isn't going to happen when the stations each have one that works fine. "Phillip Windell" wrote: > "JohnBates" <(E-Mail Removed)> wrote in message > news:819149ED-4C78-454E-95F7-(E-Mail Removed)... > >I have also come across the create same username/password on the > > domain/workstation workaround however I cannot do that. The security > > protection plan requires each user to have a separate username/password > > and > > it must be changed every 90 days. > > If they are being that picky about security, accounts, and passwords,...then > why are you even attempting this with a non-domain member? > > Make the machine a domain member. Log into it with a Domain Accoutnt that > has the correct access to the printer. > > ....Or use a printer with its own nic and IP# and print to the TCP/IP port > and forget about "sharing". > > -- > Phillip Windell > www.wandtv.com > > The views expressed, are my own and not those of my employer, or Microsoft, > or anyone else associated with me, including my cats. > ----------------------------------------------------- > > > |
|
#6
|
|||
|
|||
|
Then you will probably have to set the Sharing to allow "Everyone" or the
user will just have to enter valid credentials for the share. -- Phillip Windell www.wandtv.com The views expressed, are my own and not those of my employer, or Microsoft, or anyone else associated with me, including my cats. ----------------------------------------------------- "JohnBates" <(E-Mail Removed)> wrote in message news:3424780E-1ACD-411C-8A51-(E-Mail Removed)... > Well I can't connect it to the domain because the workstation is mobile > and > has to be used at 3 different stations that are 3 different domains. > Getting > them to spend $$ on a printer with a nic or even a print server isn't > going > to happen when the stations each have one that works fine. > > "Phillip Windell" wrote: > >> "JohnBates" <(E-Mail Removed)> wrote in message >> news:819149ED-4C78-454E-95F7-(E-Mail Removed)... >> >I have also come across the create same username/password on the >> > domain/workstation workaround however I cannot do that. The security >> > protection plan requires each user to have a separate username/password >> > and >> > it must be changed every 90 days. >> >> If they are being that picky about security, accounts, and >> passwords,...then >> why are you even attempting this with a non-domain member? >> >> Make the machine a domain member. Log into it with a Domain Accoutnt that >> has the correct access to the printer. >> >> ....Or use a printer with its own nic and IP# and print to the TCP/IP >> port >> and forget about "sharing". >> >> -- >> Phillip Windell >> www.wandtv.com >> >> The views expressed, are my own and not those of my employer, or >> Microsoft, >> or anyone else associated with me, including my cats. >> ----------------------------------------------------- >> >> >> |
![]() |
| Tags |
| connect, dom, domain, printer, script, vbs |
| Thread Tools | |
| Display Modes | |
|
|