Re: acl.GetOwner(typeof(NTAccount))



IIRC admins are treated differently when it comes to ownership

if bob (a normal user) is the owner of a file, you will also find bob in the ownership info
if alice (an administrator) is the owner of a file, the admins groups shows up in the ownership info.

I don't think you can get to the name of the owner if it is an administrator (or was there a settings somewhere to control this?) - i am short of a test environment at the moment - so i can't verify.

dominick


Hi All,

I have a file system watcher on a remote machine. When people create
files/folders on the remote machine I need to see which user was
responsible. As there are a number of users who are admins often when
a file is created the following code shows BUILTIN\Administrators

FileSecurity acl = File.GetAccessControl(e.FullPath);
NTAccount user = (NTAccount)acl.GetOwner(typeof(NTAccount));
string UserName = user.Value;
I know there is a way to get the Domain\USerName of the user but I
cant for the life of me remember. Anyone?

- Paul C



.



Relevant Pages

  • Re: deleting users my document folders after disabling redirection
    ... Yes, but once you're the owner, you can remove the deny, right? ... admins to browse peoples' private folders. ... changing ownership is a right that could be taken away from certain ... Advanced and go to the Owner tab. ...
    (microsoft.public.windows.server.sbs)
  • Re: Adding XP in another partition users into Vi$ta
    ... If Windows didn't support some mechanism for allowing a group of users to set the owner on a file, the Windows backup program could not correctly restore backups. ... If that were possible, an unscrupulous user could take ownership, do something wrong, and then cover his tracks by giving ownership to someone else. ... It is true that a program can write new information in the Owner field of an objects security descriptor if the process has WRITE_OWNER access to the object, but WRITE_OWNER access permits the caller to change ownership only to the user SID in the callers access token or, if the user is a member of the Administrators group, to the Administrators SID. ... When logged in as a standard user, when you elevate you are logging in with the credentials you supply to the elevation prompt and the elevated program is running under those credentials. ...
    (microsoft.public.windows.vista.security)
  • Re: Firefox lock file?
    ... You may want to just change all ownership of everything in your *home* ... your files via Nautilus is to add the 'Owner' column to your Nautilus ... Research it first, read 'man chown' etc., *and backup your home folder ...
    (Ubuntu)
  • Re: OT: Fotopic
    ... the legal position over the ownership of images contained on their ... regardless of the original ownership. ... back to the actual owner, ...
    (uk.railway)
  • Re: Adding XP in another partition users into Vi$ta
    ... "The Owner tab shown in Figure 12.19 has no option for giving ownership ... Administrators group, to the Administrators SID. ... When logged in as a standard user, when you elevate you are logging ...
    (microsoft.public.windows.vista.security)