Networking Forums

Networking Forums > Computer Networking > Windows Networking > Help: VBS script to connect to domain printer from outside the dom

Reply
Thread Tools Display Modes

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

 
 
JohnBates
Guest
Posts: n/a

 
      04-01-2008, 01:20 PM
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
 
 
 
 
JohnBates
Guest
Posts: n/a

 
      04-01-2008, 01:24 PM
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
 
JohnBates
Guest
Posts: n/a

 
      04-01-2008, 01:38 PM
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
 
Phillip Windell
Guest
Posts: n/a

 
      04-01-2008, 02:49 PM
"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
 
JohnBates
Guest
Posts: n/a

 
      04-01-2008, 04:00 PM
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
 
Phillip Windell
Guest
Posts: n/a

 
      04-01-2008, 07:23 PM
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

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help: vista connect to domain's printer andifebr@gmail.com Windows Networking 1 10-09-2008 07:57 PM
Specifying script as printer backend loial Linux Networking 4 04-25-2006 08:12 PM
Rename printer script Reedler Windows Networking 0 06-02-2005 08:12 PM
Auto setup and connect network printer using logon script. kinghew Windows Networking 1 07-31-2003 02:41 AM
Printer connect at Logon with a Script with Windows 98SE Robi Windows Networking 0 07-18-2003 09:54 PM



1 2 3 4 5 6 7 8 9 10 11