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 groupnames are localized.
E.g. the MS-example uses an english computer, which means you can get the guest group like this:
grp = AD.Children.Find("Guests", "group")
But on a non-english computer, the 'Guest' groupname is localized, meaning for example on my german language OS, the group name for Guests is "Gäste".
Which means for the support example to run on my computer i need to change that line to
grp = AD.Children.Find("Gäste", "group")
then it works.
Now if the OS is any other language, how can I find the name for the guest user ? Or how can i get the guest user name from a sid ?
Note: .NET 2.0, not 3.0 or 3.5
To view users in a local group: Type net localgroup groupname, where groupname is the name of the group you want to list. For example, if the group name is Administrators, you would type net localgroup Administrators. Then press Enter.
A Local Administrator is already outside the domain and has the full power to do anything desired on the location machine, which IS PART of the domain. They can decode any part of the machine they want and even remove sections of it from the control of the domain.
The fastest way to open Local Users and Groups is to type lusrmgr. msc in the search bar. If you prefer, you can also right-click on the Windows start menu and click on Computer Management.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With