Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > OU Help Please

Reply
Thread Tools Display Modes

OU Help Please

 
 
Thomas R Grassi Jr
Guest
Posts: n/a

 
      12-08-2009

How do you display all the OU's in AD on a Windows 2003 R2 Standard DC SP2
Server?

I thought I created one during the install of Sharepoint 3 but it seems to
not be there.

So what command or interface shows the OU defined?

Any thioughts or ideas

Thanks

Tom


 
Reply With Quote
 
 
 
 
Florian Frommherz [MVP]
Guest
Posts: n/a

 
      12-08-2009
Howdie!

Thomas R Grassi Jr schrieb:
> How do you display all the OU's in AD on a Windows 2003 R2 Standard DC SP2
> Server?
>
> I thought I created one during the install of Sharepoint 3 but it seems to
> not be there.
>
> So what command or interface shows the OU defined?


Active Directory shows you all OUs of the domain, by default. If you
can't see it, it might not be there.

If it's just a simple OU (no Group Policies linked to it or custom
permissions), there's no further magic behind.

Two possible further steps from here:
(1) Check whether it got deleted. You can check that with LDP and the
"Show deleted objects" control of with ADRestore from Sysinternals. If
it got deleted, you can restore it. Or re-create it.

(2) Start ADSIEdit and browse the directory. It should display the OU in
case it is marked as "hidden" for the ADUaC mmc snap-in.

Cheers,
Florian
--
Microsoft MVP - Group Policy
eMail: prename [at] frickelsoft [dot] net.
blog: http://www.frickelsoft.net/blog.
ANY advice you get on the Newsgroups should be tested thoroughly in your
lab.
 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      12-08-2009

"Thomas R Grassi Jr" <> wrote in message
news:%...
> How do you display all the OU's in AD on a Windows 2003 R2 Standard DC SP2
> Server?
>
> I thought I created one during the install of Sharepoint 3 but it seems to
> not be there.
>
> So what command or interface shows the OU defined?
>
> Any thioughts or ideas
>
> Thanks
>
> Tom


If your AD is complicated with many nested OU's, it might be easier to query
for all objects where (objectCategory=organizationalUnit). For example, a
VBScript program that uses ADO to query AD:
==========
Option Explicit
Dim adoCommand, adoConnection, strBase, strFilter, strAttributes
Dim objRootDSE, strDNSDomain, strQuery, adoRecordset, strName

' Setup ADO objects.
Set adoCommand = CreateObject("ADODB.Command")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open "Active Directory Provider"
adoCommand.ActiveConnection = adoConnection

' Search entire Active Directory domain.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBase = "<LDAP://" & strDNSDomain & ">"

' Filter on all OU objects.
strFilter = "(objectCategory=organizationalUnit)"

' Comma delimited list of attribute values to retrieve.
strAttributes = "distinguishedName"

' Construct the LDAP syntax query.
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
adoCommand.CommandText = strQuery
adoCommand.Properties("Page Size") = 100
adoCommand.Properties("Timeout") = 30
adoCommand.Properties("Cache Results") = False

' Run the query.
Set adoRecordset = adoCommand.Execute

' Enumerate the resulting recordset.
Do Until adoRecordset.EOF
' Retrieve values.
strName = adoRecordset.Fields("distinguishedName").Value
Wscript.Echo strName

adoRecordset.MoveNext
Loop

' Clean up.
adoRecordset.Close
adoConnection.Close
==========
You can also use the filter with Joe Richards' free adfind utility. See this
link:

http://www.joeware.net/freetools/tools/adfind/index.htm

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59