I created a text file and removed all the groups except SYSTEM group.
When I am running the following code:
public static void CheckPermissions(string filePath)
{
FileSecurity acl = new FileInfo(filePath).GetAccessControl();
IdentityReference group = acl.GetGroup(typeof(SecurityIdentifier));
}
It shows that my group is:
{S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-513}
Which according to Microsoft is the group of DOMAIN_USERS.
But when I am looking through the GUI, it seems that it has only the SYSTEM group:

According to Microsoft, it because it gets the primary group of the owner, and not the group of the file: