Solved

HKEY_CURRENT_USER access to a SystemAccount service

Posted on 2000-02-29
2
310 Views
Last Modified: 2013-12-03
I'm writing a service that will run as the System Account, but I need to have access to HKEY_CURRENT_USER for whoever is logged on at any given time.  Is impersonating the logged on user considered the 'appropriate' thing to do?  And if so, does anyone have any source code that could demonstrate doing this?

Thanks,
Jon Stelly
0
Comment
Question by:jonpants
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 2572394
If you are running your service under the Local System Account (the default) you will have full access to the registry on the machine the service is running on.  There is no need to impersonate another user.

HKEY_CURRENT_USER is a mirror of the appropriate hive under HKEY_USERS.  If you want to change data for a particular user, change it under HKEY_USERS from your service.
0
 

Author Comment

by:jonpants
ID: 2589783
Thanks, I got it working now.  I'm just going through HKEY_USERS/SID/...  It works like a champ.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio Debugging 3 121
Visual Studio 2015 locks debug executable 9 135
SignTool Error with Windows 10 5 120
Licensing Sharepoint 2016 for developers 11 28
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

23 Experts available now in Live!

Get 1:1 Help Now