Link to home
Start Free TrialLog in
Avatar of joshual
joshual

asked on

logon/logout utility programming

I am running Windows NT workstation, ver 4.0.Assuming

I  am a normal User and also an Administrator. Normally, I login as a User to do my normal job. Sometimes, I need to login as an Administrator  to perform some administrative job that  the User has no rights. Currently, I need to *close all my programs* and logo as a User and re-login as an Administrator.

If I have explain my situation clearly, here is my question.

I want to write a program that allows me to re-login without closing all my programs. ***I need sample source code in VC.****

Thanks

Joshua
Avatar of nebeker
nebeker

>> I want to write a program that allows me to re-login without closing all my programs. <<

I don't think this can be done.  However, I think I've seen somewhere a program that let's you run a particular program as another user (as long as you have that user's password).  Is this what you're looking for?  (It doesn't sound like you really want to log in as administrator - you just want to run a program from that account, right?)


Re-login without closing all programs is not possible . By the way what you want to do? I can't see clearly what you want to automate ? Let me tell you what i got from your qs.
You want to login as different user( admin) while not closing the current programs. Then as admin you want to perform some operation and again logoff and work as normal user back.
If this is the case then i tell you it is not possible.If you have got something else in your mind please let me know.


uash is not entirely correct.  While it can't be done, it can be faked...

You can run progragrams in a security context of another user or make your program impersonate another user.  Take a look at the functions CreateProcessAsUser(), LogonUser(), ImpersonateLoggedOnUser() and RevertToSelf().

Is this what you need?
Avatar of joshual

ASKER

I believe alexo got it right.

FW
ASKER CERTIFIED SOLUTION
Avatar of alexo
alexo
Flag of Antarctica image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm also thinking about this problem. But allways I run into trouble with the SE_TCB_NAME and some other rights (The user should: "Act as operatingsystem"). You must give the user these rights to perform some of the above functions. Normal users don't should have these rights! (I think). Now my idea was to grant this rights temporarely to the user - but what a fake - you also need to be admin to do this.
I think, I give up with this problem, but if you, joshual, might resolve this problem, and the program may run in the way we think about it, please notify me (wandrey@deges.de) I find a way to transfer some points to you, say maybe 100 for the source?!
regards
Willy