Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Launching applications as another user


Message #1 by "Paul Rivers" <riverspa@e...> on Fri, 24 Aug 2001 19:04:03
This may be more tantalizing than useful, but we've got a proprietary config
management program running here that does the following:

1 Prompts user for username & pwd
2 adds that user to the local Admins group 
3 starts a process
4 removes the user from local Admins group

The process started in step 3 is then used to spawn the install routines.
When I asked the dev how he is able to have his program add the local user
to the local admins group, he was cagey about it, & ended up saying "it's
just an API call".  He denied having hard-coded uber-user credentials in his
app (which is the only way I could think to get it done).  I'm afraid that's
all I know about the process--hope that's not too frustrating...

Cheers,

-Roy

P.S. The app in question is written in TestBasic--the programming language
of Microsoft Test (lately sold to Rational & sold as Visual Test)!

-----Original Message-----
From: Paul Rivers [mailto:riverspa@e...]
Sent: Friday, August 24, 2001 12:03 PM
To: professional vb
Subject: [pro_vb] Launching applications as another user


Windows 2000 has a program called SU that allows for the user logged in to 
run applications as another user.  This utilizes a service.  That service 
has to be running in order to use it.  I have been tasked with, and had 
little to no success in coding a solution that will allow us to, with an 
administrative user-id and password available, run a package installation 
with a non-administrative user-id.  In other words, the user will go to 
run a package like IE 5.5 installation.  Since Administrative rights are 
needed to install, they will get a pop-up asking for the user-id and 
password for an Administratuve user.  Once they are prompted, the 
installation will kick off with elevated priviledges.  I've been working 
on this in VC++, but for a host of reasons, I would REALLY prefer to be 
working on this in VB.  Any ideas on how to get the id (once the id and 
password are entered) to be used for the life of the VB app and then die 
at the end?  Thanks.

Paul Rivers

  Return to Index