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.

Get the SID of a Workstation


Question:

I would like to get the SID of a workstation. I tried the wntAcctInfo() function in the wwwnt34i dll, but I am not sure that what it returns is the workstation's SID. I believe it returns the SID for the user that is passed in the function. How can I get the workstation's SID, not a specific user's?

Answer:

Take a look at wntLsaPolGet() and the "PrimaryDomain" class of information.

More info on Workstation SID's:

Workstations and Member servers have their own SID values. Domain controllers share a single SID value that is the domain SID.

Whenever accounts are created on a workstation or a member server, the machine's SID is used as the base portion of the SID to which the account's RID is appended on to. The same thing happens with domain accounts, except it is the domain SID that gets used.

You can use the wntLsaPolGet() function to get the local account domain name & SID value. Pass in a value of "AccountDomain" for the class and a value of "2" for the element. The return value will be the SID value for the server specified in the function call.


Article ID:   W16518
File Created: 2005:02:18:12:21:14
Last Updated: 2005:02:18:12:21:14