>I'll leave it to Brian or Deji or one of the other vbscript guys to come up with the equiv vbscript code.

>Once you get to here, the next step is inevitably to start asserting that the addresses are valid in format and characters and labels, etc. That is when it starts to get tough.

 

I have a tool to do this task that’s almost done, at least finding dupes. When it’s testable, I’ll post here.

 

As far as part 2, I’m open to ideas to add a /illegal switch or something.

 

Happy New Years!

--Brian

 

Thanks.

 

--Brian Desmond

[EMAIL PROTECTED]

Payton on the web! www.wpcp.org

 

v - 773.534.0034 x135

f - 773.534.8101

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of joe
Sent: Wednesday, December 29, 2004 4:59 PM
To: [email protected]
Subject: RE: [ActiveDir] How to find duplicate proxy address in Active Directory

 

Hmm I think I previously posted a script that does this to the list, at least that basic functionality.I can't find it though so here is a basic one again. We have definitely discussed this a couple of times previously though.

 

 

It is pretty simple functionality, simply form a query of

 

base: ""

port: global catalog aka 3268

filter: proxyaddresses=*

 

then parse through all of the returned proxyaddresses and slap them into a hash with the proxy address normalized as the key. If the hash entry exists, tack on the new DN to the value. At the end chase through all hash entries looking for entries with multiple values. In perl I recommend using a hash value of an array to make it easiest.

 

The adfind ldap query dumped to a testpa.txt file would look like

 

adfind -gc -b "" -f proxyaddresses=* proxyaddresses > testpa.txt

 

Of course for more advanced checking, you probably also want to make sure legacyExchangeDNs don't dupe any X500 proxyaddresses because that would be a bad dupe as well. I will leave that as an exercise for the class.

 

 

Anyway, dump the above command to a text file. Use ADCSV to convert to a CSV file. Tell ADCSV to use # to separate multivalue attribs because semicolon's won't work for this case.

 

adcsv /infile:testpa.txt /mvdelim:#

 

Should give you a text file like:

 

DN;proxyAddresses;
"CN=$jricha34,CN=Users,DC=joe,DC=com";"SMTP:[EMAIL PROTECTED];X400:c=US;a= ;p=joeware;o=Exchange;s=?jricha34;";
"CN=Public Folder Store (2K3EXC01),CN=SG1,CN=InformationStore,CN=2K3EXC01,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=joeware,CN=Microsoft Exchange,CN=Serv
ices,CN=Configuration,DC=joe,DC=com";"smtp:[EMAIL PROTECTED];smtp:[EMAIL PROTECTED];SMTP:[EMAIL PROTECTED];X400:c=US;a= ;p=joeware;o=Exchange;s=2K3EXC01-IS;";
"CN=Microsoft System Attendant,CN=2K3EXC01,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=joeware,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=joe,DC
=com";"smtp:[EMAIL PROTECTED];smtp:[EMAIL PROTECTED];SMTP:[EMAIL PROTECTED];X400:c=US;a= ;p=joeware;o=Exchange;s=2K3EXC01-SA;";
"CN=postmaster,OU=MailUsers,OU=joeware2,OU=Exchange,DC=joe,DC=com";"smtp:[EMAIL PROTECTED];SMTP:[EMAIL PROTECTED];smtp:[EMAIL PROTECTED];X400:c=US;a= ;p=joeware;o=Exchange;
s=postmaster;";

<SNIP>

 

Now build a perl script that looks through all lines of the file and shoves the values into the hash and then outputs the hash entries that have multiple values. Here would be a basic script to do it.

 

$pahash=();
foreach $thisline (<>)
 {
  ($dn,$pa)=($thisline=~/"(.+?)";"(.+)"/);
  map {$pahash{lc($_)}[++$pahash{lc($_)}[0]]=$dn} split(/#/,$pa);
 }

 

foreach $thiskey (sort keys %pahash)
 {
  next unless $pahash{$thiskey}[0]>1;
  print "Duped: $thiskey\n";
  for $thisentry (1..$pahash{$thiskey}[0]) {print "  ".$pahash{$thiskey}[$thisentry]."\n"};
 }

 

I'll leave it to Brian or Deji or one of the other vbscript guys to come up with the equiv vbscript code.

 

Once you get to here, the next step is inevitably to start asserting that the addresses are valid in format and characters and labels, etc. That is when it starts to get tough.

 

 

   joe

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manjeet
Sent: Wednesday, December 29, 2004 4:02 PM
To: [email protected]
Subject: [ActiveDir] How to find duplicate proxy address in Active Directory

All,

 

I am facing a lots of problem due to duplicate proxy address in active directory. Some of my user's mails are bouncing back due to this. I have tried Active directory search but no result found. I am looking for a good tool by which I can search out the duplicate proxy address and delete them.

 

I was trying dupproxy.exe but its giving error than can not open LDAP.

 

 

Your early help will pe appericiated.

 

Thank You,

Manjeet


Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.

Reply via email to