How to remove all access rights from all Users


hi all,

i want remove access(permissions e,g, read/write etc) of users in 1 time, can possible using c#? able using

system.security.principal.identityreference newowner = new system.security.principal.ntaccount("testdomain", "testuser").translate(typeof(system.security.principal.securityidentifier)); 
activedirectoryaccessrule newrule = new activedirectoryaccessrule(newowner, activedirectoryrights.genericall, system.security.accesscontrol.accesscontroltype.allow); 
myou
.objectsecurity.setaccessrule(newrule); 

but in above case want looping users. there api abailable users in active directory?

please help.

thanks

ajit

hi,

 

as question more related development/coding, suggest create new thread in 1 of msdn forum better , accurate answer question. community members , support professionals there more familiar coding , can in more efficient way.

 

msdn forum

 

http://social.msdn.microsoft.com/forums/en-us/categories/

 

thanks understanding.



Windows Server  >  Directory Services



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file