WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Registry
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Find a Particular Hive


Question:

I need to find a hives that is different everytime I install the same Operative System ( Windows 2000 server ). I saw that there are some hives that changes on every installation; for example one is this: S-1-5-21-1220945662-839522115-725345543-500 I need to know ( automatically ) this name because I need to make a program that access to some keys and data under that hive.

Answer:

That SID value is for the Administrator account. Please read the help topic "About SID [Security Identifier] values..." in the Win32 Network extender help file. It will explain thing for you.

The wntLsaPolGet() function can be used to retrieve either "PrimaryDomain" or "AccountDomain" names & SID values for a computer. The primary domain is the domain to which the computer belongs if it is a part of a domain. The account domain is the local system's name for its local accounts. If you get the account domain SID value, then you know the local system SID value that can be used to build SID values for local accounts by appending on "-" and the RID value for the local accounts.

If you have a series of "ntuser.dat" files in various user profiles on the system, you can retrieve the ownership information for the hive file via wntOwnerGet(), which should tell you how owns it. Converting the owner account's name into a SID value will allow you to compare the value with the SID value you are interested in so that you can determine if the hive needs to be loaded or not intot he registry. Please note this last step is only necessary if there are no processes running under that user's credentials, as having even one process running under the user's credentials usually results in their registry hive being loaded by the system.


Article ID:   W17206
File Created: 2007:07:03:14:28:46
Last Updated: 2007:07:03:14:28:46