Tuesday, August 28, 2007

Script for showing EAS accounts in 2 groups

If a user is placed into two Active Directory groups that are used by Zantaz EAS, this causes errors during the Distribution List synchronization.


 

Specifically, the user should not be in both the "3-month" retention group, and also the "6-month" retention group.


 

Here is a small script to use 'adfind' to display the user accounts which are in two groups.


 

'adfind' is a utility from www.joeware.net


 


 


 

REM ------ find Duplicate Users in TWO EAS groups ----------------


 

eventcreate /t information /id 1000 /d "c:\adminscripts\list-duplicate-group-easarchive.cmd script is executing"


 

cd /d c:\adminscripts\


 

adfind -b "OU=Chicago,DC=mycompany,DC=NET" -f "(&(objectcategory=person) (&((memberOf=CN=mycompany.chgo.eas.6month.mailbox.dg,OU=Chicago Distribution Lists,OU=Chicago,DC=mycompany,DC=NET))(memberOf=CN=mycompany.chgo.eas.3month.mailbox.dg,OU=Chicago Distribution Lists,OU=Chicago,DC=mycompany,DC=NET)))" -tdc -excldn "inactive" -csv xxx -csvdelim "," -nodn sn givenname samaccountname mail > list-missing-duplicate-temp1.txt


 

cscript c:\adminscripts\mail-duplicate-group-easarchive.vbs


 

eventcreate /t information /id 1000 /d "c:\adminscripts\mail-duplicate-group-easarchive.cmd script is complete"