O'Reilly logo

Active Directory, 3rd Edition by Alistair G. Lowe-Norris, Robbie Allen, Joe Richards

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21. IADs and the Property Cache

Each object in a directory has a series of attributes, or properties, that uniquely define it. Although properties can vary from object to object, ADSI supports the manipulation of a core set of six properties common to all objects using the IADs interface. These properties are common to all objects because IADs is the most basic interface in ADSI.

The IADs Properties

The IADs properties are as follows:

Class

The object’s schema class

GUID

The object’s Globally Unique ID (GUID)

Name

The object’s name

ADsPath

The ADsPath to the object in the current namespace

Parent

The ADsPath to the object’s parent

Schema

The ADsPath to the object’s schema class

Each of these properties has a corresponding property method in the IADs interface. You can use the property method, which has the same name as the property, to access that property’s value. Example 21-1 contains code to display the six IADs properties for a user object.

Example 21-1. Using the explicit property methods to display the six IADs properties
Dim objUser 'An ADSI User object
Dim str     'A text string

' User object using the WinNT namespace
Set objUser=GetObject("WinNT://MYCORP/Administrator,User")
str = "Name : " & objUser.Name & vbCrLf str = str & "GUID: " & objUser.GUID & vbCrLf str = str & "Class: " & objUser.Class & vbCrLf str = str & "ADsPath: " & objUser.ADsPath & vbCrLf str = str & "Parent: " & objUser.Parent & vbCrLf str = str & "Schema: " & objUser.Schema & vbCrLf & vbCrLf Set objUser ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required