Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 13th, 2007, 07:15 AM
Registered User
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting AD Object Advanced ACLs in VB.NET

Hello there,
I am trying to write a VB.NET code to get the advanced security settings for a given Active Directory object (more specifically user ).

I have managed to write the following code that will list the access rules associated with an object. However, the ActiveDirectoryRights property displays generic rights (such as ReadProperty, WriteProperty). It provides no detailed permissions. By detailed permissions I mean those get listed when you click the Security tab then >> Advanced then >> Edit.

How is it possible to write a code in .NET to read/update those detailed permissions?

Any help is greatly appreciated.

Dim col1 As System.Security.AccessControl.AuthorizationRuleCol lection

Dim rule1 As ActiveDirectoryAccessRule

Dim acl1 As New System.DirectoryServices.DirectoryEntry(LDAP://stc.corp/CN=TestUser,OU=Users,OU=MyOU,DC=MyDomain,DC=com )

col1 = acl1.ObjectSecurity.GetAccessRules(True, True, GetType(System.Security.Principal.NTAccount))

For Each rule1 In col1

' Code to read the following properties :

' rule1.IdentityReference.Value

' rule1.PropagationFlags

' rule1.ActiveDirectoryRights.ToString

' rule1.IsInherited

' rule1.InheritedObjectType.ToString



Similar Threads
Thread Thread Starter Forum Replies Last Post
converting .NET error object in VB error object webnet .NET Web Services 0 February 5th, 2007 06:02 AM
Advanced Help! Object Class Programming! I'm stuck gingerj Javascript How-To 0 September 4th, 2006 02:55 PM
Making a COM object in VB.NET Cohadar Pro VB.NET 2002/2003 0 March 30th, 2006 06:49 AM
Printer Object in VB.NET ashu_from_india General .NET 1 March 8th, 2006 07:16 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.