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

后端 未结 5 817
死守一世寂寞
死守一世寂寞 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条回答
  •  猫巷女王i
    2020-12-29 08:56

    You can use this code, the returned value is correct for non-english systems:

    var guestsGroup = new SecurityIdentifier(WellKnownSidType.BuiltinGuestsSid, null).Translate(typeof(NTAccount)).Value;
    

提交回复
热议问题