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

wNT
plus

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

Builtin Group SID convert to Name

Keywords: 	 Builtin Group SID convert to Name  wntLsaPolGet

Question:

Hi, I am extracting the SID value for the local administrators group and I want to convert it to the actual group name. I placing the following commands in my script:
admingrprid = wntLsaPolGet("","AccountDomain",2)
grpsid = StrCat(admingrprid, "-544")
admingrp = wntGroupInfo("", grpsid, @LOCALGROUP, 0, 1, 1)
The error I receive is a WIL Extender error:542 Invalid user/group name.

Is this the correct syntax to convert the sid to the actual name?

My test system is on a stand-alone win 2k pro box. This will ultimately be used on systems that are members of an AD Domain.

The SID is extracting perfectly. It is the conversion which has a problem. The following code gives me no problems in regards to performing the same functions on the Builtin Administrator account:

adminrid = wntLsaPolGet("","AccountDomain",2)
accountsid = StrCat(adminrid, "-500")
adminaccount=wntAcctInfo("", accountsid, 2,2)

Answer:

Look in the NT extender help file. Specifically, there is a topic in the help file that discusses SID strings and the components that they are made of. Read the bit about the built-in domain and the group alias names that belong in that category. You will see that all of the built-in groups have a SID prefix of "S-1-32-", which is *different* from the local machine SID prefix that is used for regular user accounts [including the Administrator account].
Article ID:   W15556
File Created: 2003:05:13:11:28:48
Last Updated: 2003:05:13:11:28:48