CoreyThomasMCSEMCSAMCDBA
Fri Mar 07 16:19:04 CST 2008
I'll agree with Richard here. Domain accounts will be have a SID that is
rather long compared to the local accounts. When I'm querying machines, I
typically look for SID's that are longer than 16 characters. Then I query
the SID to get domain\user names. If you need code for that, let us know.
-Corey Thomas
MCSE/MCSA/MCDBA
"Richard Mueller [MVP]" wrote:
> notta wrote:
>
> > I'm using HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> > NT\CurrentVersion\ProfileList to list all the users on a remote machine
> > and
> > then use that information to get other information from Active Directory.
> > How
> > can I find out which accounts are local accounts and which are domain
> > accounts? I don't want to waste time hitting the AD for the local
> > accounts.
> > Any advice to determine which are domain accounts?
>
> SID values are very different for local and domain accounts. Local SID's
> will be similar to "S-1-5-19", while domain SID's are much longer, similar
> to "S-1-5-21-4173817940-1596382273-4091973628-1136". I think any SID
> starting with "S-1-5-21-" is a domain account.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -
http://www.rlmueller.net
> --
>
>
>