Home All Groups Group Topic Archive Search About

Windows 2003 Adding printerport and printer

Author
19 Oct 2005 3:24 PM
Jo Becaus
Dear,

I have registered the prnadm.dll file and used the objects to create a
printer TCP/IP port and printer on a windows 2003 server.

Problem is that the user doesn't have sufficient privileges to execute
the objects whoam create the TCP/IP port and printer on the server.

So I am looking for a way to set specific credentials when creating the
object in vbs.

set oPort   = CreateObject("Port.Port.1")
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
oMaster.PortAdd oPort ...

How can I have the above created objects set with specific credentials
so it works with an account with enough priviliges.

Kind Regards, Silent-One


*** Sent via Developersdex http://www.developersdex.com ***

Author
20 Oct 2005 4:25 PM
Dave Kreskowiak
It is possible to do something like this, but, AFAIK, not from VBScript. 
VBScript doesn't have the ability to create objects using an alternate
principle.

At least not without using a custom written component to act as a proxy...

--
<i><b>RageInTheMachine9532</b></i><font size="-2">
"<i>...a pungent, ghastly, stinky piece of cheese!</i>" <b>-- The Roaming
Gnome</b></font>


Show quoteHide quote
"Jo Becaus" wrote:

>
>
> Dear,
>
> I have registered the prnadm.dll file and used the objects to create a
> printer TCP/IP port and printer on a windows 2003 server.
>
> Problem is that the user doesn't have sufficient privileges to execute
> the objects whoam create the TCP/IP port and printer on the server.
>
> So I am looking for a way to set specific credentials when creating the
> object in vbs.
>
> set oPort   = CreateObject("Port.Port.1")
> set oMaster = CreateObject("PrintMaster.PrintMaster.1")
> oMaster.PortAdd oPort ...
>
> How can I have the above created objects set with specific credentials
> so it works with an account with enough priviliges.
>
> Kind Regards, Silent-One
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>