Solved

Comparing contents of OUs

Posted on 2007-04-01
3
266 Views
Last Modified: 2010-04-18
Hi there,

I have two OUs containing lists of users.  I think that both OUs contain the same users, but I need to double check this.  I need for both OUs to contain exactly the same users as each other.

I would like to know if there is a way to compare these two OUs so I can see if there are users that exist in one OU but not the other?

Thanks!
0
Comment
Question by:peterkennedy
  • 2
3 Comments
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 18834628
peterkennedy,

you could output the list of each OU to a file using the dsquery commands

Regards,

James
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18835490
This script may help...save as CompareOUs.vbs and after modifiying the OU1 and OU2 LDAP entries, double-click it to run...

'CompareOUs.vbs
Dim arrOU1():OU1="LDAP://OU=FirstOU,dc=domain,dc=com"
Dim arrOU2():OU2="LDAP://OU=SecondOU,dc=domain,dc=com"
x=0
Set colItems = GetObject (OU1)
For Each objItem in colItems
    ReDim Preserve arrOU1(x)
    arrOU1(x)=objItem.Name
    x=x+1
Next
x=0
Set colItems = GetObject (OU2)
For Each objItem in colItems
    ReDim Preserve arrOU2(x)
    arrOU2(x)=objItem.Name
    x=x+1
Next
For x = 0 to ubound(arrOU1)
  If arrOU1(x) <> arrOU2(x) Then
      wscript.echo arrOU1(x) & " appears to be different."
  End If
Next
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18850342
Happy to help - thanx for the grade! :^)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I have never ceased to be amazed how many problems you can encounter on a fresh install of a Windows operating system.  This is certainly case in point& Unable to complete ANY MSI installation.  This means Windows Updates are failing and I can't …
Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now