Solved

HKEY_CURRENT_USER access to a SystemAccount service

Posted on 2000-02-29
2
316 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
[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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

756 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