Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

logon/logout utility programming

Posted on 1998-04-14
6
Medium Priority
?
251 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

FW
0
 
LVL 11

Accepted Solution

by:
alexo earned 600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

916 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