Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Windows Server Networking

Help: VBS script to connect to domain printer from outside the dom

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2008, 02:20 PM
Default Help: VBS script to connect to domain printer from outside the dom



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
Reply With Quote
  #2  
Old 04-01-2008, 02:24 PM
JohnBates
Guest
 
Posts: n/a
Default RE: Help: VBS script to connect to domain printer from outside the dom

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!

Reply With Quote
  #3  
Old 04-01-2008, 02:38 PM
JohnBates
Guest
 
Posts: n/a
Default RE: Help: VBS script to connect to domain printer from outside the

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!

Reply With Quote
  #4  
Old 04-01-2008, 03:49 PM
Phillip Windell
Guest
 
Posts: n/a
Default Re: Help: VBS script to connect to domain printer from outside the

"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.
-----------------------------------------------------


Reply With Quote
  #5  
Old 04-01-2008, 05:00 PM
JohnBates
Guest
 
Posts: n/a
Default Re: Help: VBS script to connect to domain printer from outside the

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.
> -----------------------------------------------------
>
>
>

Reply With Quote
  #6  
Old 04-01-2008, 08:23 PM
Phillip Windell
Guest
 
Posts: n/a
Default Re: Help: VBS script to connect to domain printer from outside the

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.
>> -----------------------------------------------------
>>
>>
>>



Reply With Quote
Reply

Tags
connect, dom, domain, printer, script, vbs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.