Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6134461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:21:31+00:00 2026-05-23T17:21:31+00:00

Our setup has an embedded manifest that triggers the UAC before the application starts.

  • 0

Our setup has an embedded manifest that triggers the UAC before the application starts. (The applications runs as an admin user). However, if the setup needs to install the .NET Framework, we have to continue the setup after a reboot. For this reason, we have to create a registry key in the current user’s RunOnce.

Unfortunatly, HKEY_CURRENT_USER points to the Administrator’s registry. We need to find out the user that is currently logged in and started the installation. (Th normal USER clicked the setup.exe, an ADMIN entered his details in the UAC prompt. We need to find out who the USER was)

I’ve tried all the usual methods (Environment.UserName, WindowsIdentity.GetCurrent())

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:21:32+00:00Added an answer on May 23, 2026 at 5:21 pm

    You can use the LsaEnumerateLogonSessions function to retreive what you need. However, it is a winapi C function call. If you need a managed version of it, I belive you can look at the source code for Cassia, which uses this function in its terminal services API. The call should be the same. You can also look here.

    Also you can use the NetWkstaUserEnum WINAPI function. You can find a managed wrapper for it here

    With Cassia library this code works fine:

    ITerminalServicesManager manager = new TerminalServicesManager();
    ITerminalServicesSession session = manager.CurrentSession;
    
    string userInfo = session.DomainName + "\\" + session.UserName;
    NTAccount account = session.UserAccount;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A little setup: Our shop has a mixture of different platforms. Almost all of
In our setup there are two different websites in IIS 7 setup that point
I am developing a PHP application using our XAMPP setup as a test server.
I have a VB6 ActiveX DLL that has run fine on all our machines
I currently use svn at work. Our setup is: everyone has a working copy
I have a clone of another python project (that has a setup.py etc.) in
The way we have our security setup in Sitecore, we have departmental roles that,
I'm trying to configure Capistrano so that it works for our server setup. We
My program is located at http://server2.abcd.com/myprogram/ . Our webmaster has set up a subdomain:
Our setup is standard nginx (ver 0.7.59) + thin upstream servers on Debian lenny.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.