Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

6.30. Viewing a User’s Managed Objects

Problem

You want to view the objects owned by a user.

Solution

Using a graphical user interface

  1. Open ADSI Edit.

  2. If an entry for the naming context you want to browse is not already displayed, do the following:

  3. Right-click on ADSI Edit in the right pane and click Connect to.

  4. Fill in the information for the naming context, container, or OU you want to add an object to. Click on the Advanced button if you need to enter alternate credentials.

  5. In the left pane, browse to the naming context, container, or OU the object you want to view. Once you’ve found the object, right-click on it and select Properties.

  6. View the managedObjects attribute.

Using a command-line interface

> enumprop /ATTR:managedObjects "LDAP://<UserDN>"

Using VBScript

' This code displays the managed objects for a user
' ------ SCRIPT CONFIGURATION ------
strUserDN = "<UserDN>"  ' e.g. cn=jsmith,cn=Users,dc=rallencorp,dc=com
' ------ END CONFIGURATION ---------

on error resume next
set objUser = GetObject("LDAP://" & strUserDN)
Wscript.Echo objUser.Get("cn") & "'s Managed Objects:"
colObjects =  objUser.GetEx("managedObjects")
if Err.Number = -2147463155 then
   Wscript.Echo " none"
else
   for each strObjectDN in colObjects
      Wscript.Echo " " & strObjectDN
   next
end if

Discussion

The managedObjects attribute is linked to the managedBy attribute that can be set on certain objects in Active Directory like computers and groups. Setting the managedBy attribute provides a quick and dirty way to define who ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata