Solved

logon/logout utility programming

Posted on 1998-04-14
6
202 Views
Last Modified: 2010-04-10
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
0
Comment
Question by:joshual
6 Comments
 
LVL 5

Expert Comment

by:nebeker
ID: 1184267
>> 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?)


0
 

Expert Comment

by:uash
ID: 1184268
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.


0
 
LVL 11

Expert Comment

by:alexo
ID: 1184269
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?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:joshual
ID: 1184270
I believe alexo got it right.

FW
0
 
LVL 11

Accepted Solution

by:
alexo earned 200 total points
ID: 1184271
Got by email:
> You have given a comment to my question "logon/logout utility programming".
> Your comment was the answer I was looking for but I can't give you the points b'cos it was a comment.
> Could you return to expert-exchange to answer my Q so that the points can be given
to you?

Sure thing!  Always glad to help.
0
 

Expert Comment

by:wandrey
ID: 2816611
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
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now