Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinguished Name

Status
Not open for further replies.
Jan 12, 2004
5
0
0
US
How can you determine the accurate distinguished name of and AD object? I'm using a script to modify an group but it's saying there is no such object on the server...code:80072030
 
Try this :

Code:
'This script accompanies the book Windows Management Instrumentation
'by Matthew Lavy and Ashley Meggitt (New Riders, 2001)
'The code is copyright 2001, Matthew Lavy & Ashley Meggitt
'You are free to use and modify the script at will
'provided you understand that all code here is made available AS IS, with
'NO WARRANTY WHATSOEVER. The authors take NO RESPONSIBILITY AT ALL for
'problems that result from the use of this script or any part thereof

'allcommonnamesagain.vbs - display the names of all
'users in an Active Directory, using WMI
Option Explicit
Dim refWMI
Dim colEveryone
Dim refUser
set refWMI = GetObject("winMgmts:root\directory\LDAP")
set colEveryone = refWMI.ExecQuery("SELECT * FROM DS_User")
For Each refUser in colEveryone
	WScript.Echo refUser.DS_distinguishedName
Next
Set colEveryone = Nothing
Set refWMI = Nothing

change the DS_User type to DS_Computer or whatever type you need...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top