Whoa Grogie, what the hell is DynaVert? – something to do with Prehistoric lizards? – thankfully no!.
DynaVert is a little tool that I have come up with, written in .NET that in essence converts Dynamic Distribution Lists into "Regular” distribution lists in just a few simple clicks!
The inspiration for this tool came from a discussion that took place on the MVP mailing list. In essence an MVP asked if there was any specific tool that could take a Dynamic Distribution list and turn it into a “Regular” distribution list.
The general consensus was, that there was no tool (or at least from that the MVP’s whom participated in the conversation believed) in existence which actually did this (one presumes because maybe people don’t have a burning requirement to do this often– or – folks had not found one).
It occurred to me that this must be possible to achieve at the very least in Powershell – and therefore in .NET.
My first inclination in the design was how could I get the membership (e.g. which users conform to the Conditions of the Dynamic Distribution) of the DDL. It seemed logical to me that using Powershell you could get the DDL membership to output to a PS console – you could then get that information into a variable (or file), and then use it to construct the membership of a new, Regular Distribution Group.
It didn’t take long to find the first pointer that I needed – in essence within the TechNet information article http://technet.microsoft.com/en-us/library/bb232019.aspx gave me the following Powershell code:
$MyDDL = Get-DynamicDistributionGroup -Identity "ComputingServices" Get-Recipient -RecipientPreviewFilter $MyDDL.RecipientFilter
Which produced the following output:
This was good, but what I really needed was to be able to now format this output so I could get it into a variable (or in the end game for the .NET solution a Textbox).
I found that this could be accomplished by modifying the above Powershell to look like the following:
$MyDDL = Get-DynamicDistributionGroup -Identity "ComputingServices" Get-Recipient -RecipientPreviewFilter $MyDDL.RecipientFilter | Select-Object primarySMTPAddress | ft –hidetableheaders
This modified the output to look like the following:
This did of course present me with a slight problem as, although you cannot see it – the actual output contains a lot of white space and two additional lines, which I knew that I was going to have to strip out in C# so I was just left with the SMTP addresses of each member of the Dynamic Distribution List.
However that being said, I now had the core of DynaVert – by being able to get the membership via Powershell it was pretty straight forward to convert that to C# using the same Powershell command processor that exists within both the OOOCTA and ALST and return it to a C# TextBox.
- Exchange Server 2007 or Exchange 2010
- .NET 3.5
- Powershell 2.0
Download the DynaVert Executable file to a location on your Exchange Server (please ensure that the Exchange platform that you have chosen conforms to the System Requirements above)
Double click on the DynaVert executable file (DynaVert.exe) – this will present you with the following Window:
In the field entitled “Source Dynamic Distribution List” provide the name of the DDL that you would like to convert to a Regular Distribution List (in my example my List is called “ComputingServices”) – note the entry should be either the samAccountName or Alias of the list. When you have done this click on the “Check” button.
DynaVert will determine the membership of the list, and populate the “DDL Membership” textbox
You should then populate the “New” distribution list properties of samAccountName and Display Name (the samAccountName should NOT have any spaces) – when you have done this click on the “Convert” button
DynaVert will then construct the basic Powershell code to convert the DDL into a normal Distribution list, you should click on the “Save” button which will prompt you to save a PS1 file to a location on your Exchange Server for execution in the Exchange Management Shell.
NOTE: DynaVert does not (at the moment) execute the code for you, nor does it remove the existing Dynamic Distribution List
When you have clicked on the Save button – DynaVert will clear of the configured values for your session to allow for you to convert more lists should you wish, however if you don’t click on the “Exit” button to terminate the application.
I hope that you like to tool – and as always; and comments / suggestions would be gratefully received – remember, you should always test any of my tools in a lab before using them in production.