Re: Programming the User-Account_Property using C#
- From: "Chris Noble" <chris.noble@xxxxxxxxxxxxxxxx>
- Date: Sat, 10 Mar 2007 14:52:43 -0000
Thanks Willy
Thanks - this was exactly what I needed. It works fine and its a great deal
less code than my previous version from 5/6 years ago.
When I've finished this I am unlikely to have to stray into into this area
again for a good few years. It will probably be something like VS 2010 with
Framework 10 and yet another new technology! Unless you work regularly with
a particular technology it is difficult to know what approach to take to
solve a particular problem and to find examples on the MS site. SDDL is a
new one for me. I will have to look it up.
I now have to work out how to 'mail enable' a user and create a mailbox for
them. I used CDOEXM before. I hope there is a Framework class now to handle
all this.
Thanks again for your help
Regards
Chris
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:uNIqnGpYHHA.408@xxxxxxxxxxxxxxxxxxxxxxx
"Chris Noble" <chris.noble@xxxxxxxxxxxxxxxx> wrote in message
news:eWCiognYHHA.2268@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Willy
But I'm still confused.
In my earlier version the algorithm to do this went roughly like this:
Get Security Descriptor for the object.
Using the security descriptor get the DACL for the object.
Create an ACE and add:
access mask ADS_RIGHT_DS_CONTROL_ACCESS
trustee (NT Authority\\Self)
access type ADS_ACE_TYPE_ACCESS_DENIED_OBJECT
set accessflags to to CHANGE_PASSWORD_GUID (no inheritance)
add ACE to DACL
Set Security Descriptor for the object.
Do I still need to do all this.
I am finding it difficult to translate the old terms into the new ones.
I can't see how to get to the ACEs from the DirectoryEntry
This is excatly what you need to do, except that now in v2 you have a
class which makes it a lot easier.
Take a look at the ActiveDirectorySecurity class (and not
DirectorySecurity as per my previous answer) in
System.Security.AccessControl.
And here is a C# sample (scroll down the page):
http://msdn2.microsoft.com/en-gb/library/ms180915.aspx
but there are easier ways to do this using the SDDL format.
Willy.
.
- Follow-Ups:
- Re: Programming the User-Account_Property using C#
- From: Chris Noble
- Re: Programming the User-Account_Property using C#
- References:
- Programming the User-Account_Property using C#
- From: Chris Noble
- Re: Programming the User-Account_Property using C#
- From: Willy Denoyette [MVP]
- Re: Programming the User-Account_Property using C#
- From: Chris Noble
- Re: Programming the User-Account_Property using C#
- From: Willy Denoyette [MVP]
- Programming the User-Account_Property using C#
- Prev by Date: c# mail question
- Next by Date: Re: c# mail question
- Previous by thread: Re: Programming the User-Account_Property using C#
- Next by thread: Re: Programming the User-Account_Property using C#
- Index(es):
Relevant Pages
|