Re: acl.GetOwner(typeof(NTAccount))
- From: Dominick Baier <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 26 Jul 2006 10:24:11 +0000 (UTC)
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
.
- Follow-Ups:
- Re: acl.GetOwner(typeof(NTAccount))
- From: Joe Kaplan \(MVP - ADSI\)
- Re: acl.GetOwner(typeof(NTAccount))
- References:
- acl.GetOwner(typeof(NTAccount))
- From: sirpooky
- acl.GetOwner(typeof(NTAccount))
- Prev by Date: acl.GetOwner(typeof(NTAccount))
- Next by Date: Re: acl.GetOwner(typeof(NTAccount))
- Previous by thread: acl.GetOwner(typeof(NTAccount))
- Next by thread: Re: acl.GetOwner(typeof(NTAccount))
- Index(es):
Relevant Pages
|