Solved

HKEY_CURRENT_USER access to a SystemAccount service

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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