Here is something really Q-N-D for you Alan. Any chance to
help out you intel guys I'm all there, I have intel all over my house.
:o)
Basically you take adfind and you do a schema dump from
both dc's you are concerned about...
adfind -h server1name -schema -f
"&(objectcategory=attributeschema)(objectcategory=attributeschema)" >
File1.txt
adfind -h server2name -schema -f
"&(objectcategory=attributeschema)(objectcategory=attributeschema)" >
File2.txt
Then take the quick and dirty perl script for normalizing
schema dumps below and run it something like
schemanorm /in:file1.txt
/out:file1.norm
schemanorm /in:file2.txt
/out:file2.norm
If comparing two different schema from different forests
(versus the schema on two DCs in the same forest) you also want the /diff switch
so
schemanorm /in:file1.txt /out:file1.norm
/diff
schemanorm /in:file2.txt /out:file2.norm
/diff
Then use WINDIFF to compare the two norm files.
That should do it for you. Let me know if it helps
out.
joe
__QUICK AND DIRTY PERL SCRIPT FOR NORMALIZING SCHEMA
DUMPS__
$diffforest=0;
map {
if (/\/in:(.+)/i) {$in=$1};
if (/\/out:(.+)/i) {$out=$1};
if (/\/diff/i) {$diffforest=1};
} @ARGV;
if (/\/in:(.+)/i) {$in=$1};
if (/\/out:(.+)/i) {$out=$1};
if (/\/diff/i) {$diffforest=1};
} @ARGV;
if ($diffforest) {print "DIFFERENT FORESTS\n"};
open ifh,"<$in";
open ofh,">$out";
$currentdn="";
%info=();
%hash=();
%info=();
%hash=();
foreach $t (<ifh>)
{
if ($t=~/^dn:/)
{
if ($currentdn ne "")
{
@i=();
foreach $g (sort keys %info)
{
push @i,"$g: ".$info{$g};
}
push @i,"\n";
$hash{$normcdn}=join("",@i);
}
%info=();
$currentdn=$t;
print $currentdn;
$normcdn=$currentdn;
$normcdn=~s/(dc=.+)/<DOMAIN>/i;
next;
}
next unless $t=~/^>/;
@a=split(/:/,$t);
next if $a[0]=~/^>uSNChanged/;
next if $a[0]=~/^>uSNCreated/;
next if $a[0]=~/^>whenChanged/;
if ($a[0]=~/^>(distinguishedName|objectCategory)/i)
{
$a[1]=~s/(dc=.+)/<DOMAIN>/i;
}
if ($diffforest)
{
next if $a[0]=~/^>objectGUID/;
next if $a[0]=~/^>whenCreated/;
}
$info{$a[0]}=$a[1];
}
@i=();
foreach $g (sort keys %info)
{
push @i,"$g: ".$info{$g};
}
push @i,"\n";
$hash{$normcdn}=join("",@i);
print "Writing...\n";
foreach $w (sort keys %hash)
{
print ofh $w;
print ofh $hash{$w};
}
foreach $w (sort keys %hash)
{
print ofh $w;
print ofh $hash{$w};
}
-------------
http://www.joeware.net (download joeware)
http://www.cafeshops.com/joewarenet (wear joeware)
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Isham, Alan A
Sent: Tuesday, March 16, 2004 11:52 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Schema diff tool
Is anyone familiar with a directory tool ($$$ or
freeware) that allows one to compare directory
schemas and identify changes at a metadata level?
For example,
schema1
extAttrib1
index = y
gc enabled = y
schema2
extAttrib1
index = n
gc enabled = y
schema diff tool finds there is a difference on extAttrib1 on the index value because schema1 == y and schema2 == n
Thanks for your reply in advance!
For example,
schema1
extAttrib1
index = y
gc enabled = y
schema2
extAttrib1
index = n
gc enabled = y
schema diff tool finds there is a difference on extAttrib1 on the index value because schema1 == y and schema2 == n
Thanks for your reply in advance!
| Alan A
Isham Intel Corporation in USA-CA-Folsom |
