View Single Post
Old 10-07-2008   #1 (permalink)
daystrom
Member


Join Date: Oct 2008
Vista Ultimate 32, Ultimate 64, Server 2008
 
 

Pipe compare-object results into something useable

I'm sure this can be done but I don't know where to start...

This will eventually make it's way into Exchange Management Shell. What I need to do is compare two text files that contain email addresses, one per line.

If file A contains an email address that file B doesn't have, add it as a contact in AD.
If file B has an email address that isn't in file A, remove its contact from AD.
Then overwrite file B with file A so the next day's run will be in sync.

I'm trying to build distribution lists that contain external addresses. In Exchange 2007 you need to have a contact in your AD to add the user to a distribution list.

I'm trying to automate the whole create/delete a contact in AD. Our ERP system which runs on Sun OS generates the source text file with email addresses nightly (whether there has been a change or not). If I could use this output and compare its content with a second file I may be able to accomplish what I want.

Can this be done?
Todd
My System SpecsSystem Spec