Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I work with Windows security groups without knowing their localized names in advance?

I've searched around online but can't find what I'm after. Basically, during an install, we fire off a separate executable that basically brute forces a few folders to be read/write enabled for the user group "EVERYONE".

Now, the person that wrote this never took into consideration system language. I had a call with a customer in France that kept failing installation because "EVERYONE" isn't what we would expect.

I'm after an API call to Windows that would return a security group name which would be "safe" to use in a localized environment. Essentially I'm looking to safely edit this code so instead of hardcoding in "EVERYONE", we call a function instead.

like image 576
sxthomson Avatar asked Jun 27 '12 16:06

sxthomson


People also ask

What is the difference between security group and distribution group?

Distribution groups are used for sending email notifications to a group of people. Security groups are used for granting access to resources such as SharePoint sites. Mail-enabled security groups are used for granting access to resources such as SharePoint, and emailing notifications to those users.

Can you apply GPO to security group?

It's not possible to apply a group policy to a security group . However, you can change the permissions on group policy so that only certain users/groups have read and apply privileges.

How do security groups work in Active Directory?

Security groups can provide an efficient way to assign access to resources on your network. By using security groups, you can: Assign user rights to security groups in Active Directory. Assign user rights to a security group to determine what members of that group can do within the scope of a domain or forest.


1 Answers

The fundamental mistake here is not so much the use of EVERYONE, but rather that the code is using names at all. Instead of using names you should use the well-known SIDs. In your case you need S-1-1-0.

like image 74
David Heffernan Avatar answered Nov 08 '22 20:11

David Heffernan