PC Review


Reply
Thread Tools Rate Thread

.NET service running as user (HKEY_CURRENT_USER?)

 
 
Mike
Guest
Posts: n/a
 
      16th Feb 2007
Greetings,

I trust that I am writing to the correct newsgroup or that at least I
can find direction here.

We have an issue with a custom-developed service which we would like
to run as a specified set of user credentials. This is on account of a
DLL resource which utilizes HKEY_CURRENT_USER registry settings in
order to operate. We are operating under the assumption that if the
service runs as a specified user, then that process utilizes the
settings specified under HKEY_CURRENT_USER.

If that isn't feasible, then we need to start looking at HKEY_USERS,
which gets somewhat ugly. How do we glean the key(s) from user
Security Identities (SID)?

Regardless, it would seem that we're faced with utilizing 32-bit API
from within our C# .NET code.

Thanks in advance...

Michael

 
Reply With Quote
 
 
 
 
Chris Mullins [MVP]
Guest
Posts: n/a
 
      16th Feb 2007
I'm somewhat confused as to your problem.

Certainly creating a user account, granting it Service & Batch privlidges,
setting it's password to "never expires" and configuring a Windows Service
to run as that account is no trouble. This works just fine.

So from here, you're just trying to open the Current User registry hive. I'm
not sure if this is your service account (although I suspect it is) or the
interactive user. This can't take more than 5 minutes to test though. Open
the hive from your service (running as "testuser"), and write to a key.
Then, from the interactive account run regedit and take a quick look.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"Mike" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings,
>
> I trust that I am writing to the correct newsgroup or that at least I
> can find direction here.
>
> We have an issue with a custom-developed service which we would like
> to run as a specified set of user credentials. This is on account of a
> DLL resource which utilizes HKEY_CURRENT_USER registry settings in
> order to operate. We are operating under the assumption that if the
> service runs as a specified user, then that process utilizes the
> settings specified under HKEY_CURRENT_USER.
>
> If that isn't feasible, then we need to start looking at HKEY_USERS,
> which gets somewhat ugly. How do we glean the key(s) from user
> Security Identities (SID)?
>
> Regardless, it would seem that we're faced with utilizing 32-bit API
> from within our C# .NET code.
>
> Thanks in advance...
>
> Michael
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running service under the account: User Alex Microsoft C# .NET 1 22nd Oct 2007 06:02 PM
How to set HKEY_CURRENT_USER for every user sp Windows XP General 3 13th Jun 2006 08:56 AM
Reading keys from HKEY_CURRENT_USER from an impersonated Web Service Simon Hart Microsoft C# .NET 12 23rd Mar 2006 05:12 PM
HKEY_CURRENT_USER\...shell folders are corrupted by IE6 running =?Utf-8?B?cWljZQ==?= Windows XP Internet Explorer 0 16th Oct 2004 05:17 AM
Service running as [user] rather than [system] Sims Microsoft Dot NET 15 11th Feb 2004 07:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 PM.