How can I get the local group name for guests/administrators?

后端 未结 5 821
死守一世寂寞
死守一世寂寞 2020-12-29 08:21

Question:

I use the code found at http://support.microsoft.com/kb/306273

to add a windows user. The problem is i need to add the user to a group, but the gro

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 09:09

    As you have pointed out, the names of groups are localised depending on system language.

    For 'well known' groups like 'Administrators' and 'Guests' you should retrieve based on the SID. The SID for Guests is:

    S-1-5-32-546
    

    There is a list of well known SIDs here:

    http://support.microsoft.com/kb/243330

    Code to get the group name from the SID can be found here

提交回复
热议问题