Solved

logon/logout utility programming

Posted on 1998-04-14
6
239 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Technology Partners: 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
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 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.

632 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