The Problem: LCM CSV Files are completely useless!
A client asked me to provide them with a nice, clean report that they could open in Excel to view group membership. I forwarded them the stock LCM output file with great shame. I then opened up my laptop and decided enough was enough and took to creating a better CSV.
Step 1: Figuring out the information you need.
Once you’ve completed an LCM migration and produced a Groups resource file, open it up. Everything above the first #group_children token has group information but is not related to group membership. So we’re going to get rid of that. Then we’ll get rid of blank lines, the #group_children tokens, and every header line, which includes:
Step 2: Look at this code
Here is the complete batch script that modifies the stock LCM resource file for groups:
Instead of copying and pasting the text again and agian, I’m just going to refer to the code by line number.
Line 1 sets the file name. The name of the file produced by an LCM migration for Native Directory groups is Groups.csv. With this batch I’m assuming:
- Your file name is still Groups.csv.
- The batch is in the same directory as Groups.csv.
If (1) is not true, change the file name. If (2) is not true, simply modify the file variable to reflect the directory in which the csv file resides and change the file name if it’s no longer Groups.csv.