Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

check if OU is protected from accidental deletion

I was working with OU's and just trying to find out

Is there any way I can check whether OU is protected from accidental deletion or not?

I googled it but couldn't found any solution.

I am looking for solution in C# not scripting.

Thanks in advance

like image 936
sunder Avatar asked Oct 27 '25 20:10

sunder


1 Answers

You need to open the ACL on the object (the ntSecurityDescriptor attribute) and look for a Deny Everyone Delete. The ActiveDirectorySecurity class gives you a managed wrapper around this - http://msdn.microsoft.com/en-us/library/system.directoryservices.activedirectorysecurity.aspx.

like image 187
Brian Desmond Avatar answered Oct 29 '25 11:10

Brian Desmond



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!