Solved

logon/logout utility programming

Posted on 1998-04-14
6
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

738 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