MiisApp – Dynamic Menus

To try and decrease my code maintenance on MiisApp I introduced a number of dynamic menus that were built at application startup, and then refreshed periodically.

Now I don’t want to go into all the code specifics here. I am not a software developer, and the code I wrote for this application was very site-specific. However I do hope that this will give some ideas about what is possible (and there are some sections of the code linked inline below).

Insert Jobs

The Insert Jobs menu allowed certain tasks to be inserted into the job queue. The user would insert something simple like “Export AD” and my scheduling script would expand it into any pre- and post-steps, as well as the actual MA export.

Pending Exports

With the Pending Exports menu I wanted to display simple lists of the Adds, Deletes and Modifies waiting to go out at the next Export. This is nowhere near as advanced as the Pending Export viewer in Identity Manager, but MiisApp was intended for people who needed to see some of what the server was doing, without being given full Console access.

I was somewhat surprised when I found that there is no suitable WMI method for querying the CS and retrieving the pending exports. Eventually I managed to get the information I wanted by querying the MIIS database.

I wrote a PendingExports class which creates a Form that lists the objects as Add, Delete or Update. The menu item code that instantiates (there’s a big programmers word – hope I’m using it right) the form is here.

Import/Export Logs

I’ve posted before about the importance of keeping a backlog of your import and export log files, rather than relying on the Run History. I also shared my method for converting the log files so they can be displayed by a stylesheet.

If you’d done all this you would have the log.xsl stylesheet in the MaData folder, and a history of timestamped log files in the sub-folders. I also tend to enhance this with a Scheduled Task that archives off the log files overnight, so that the folders only contain the log files for today.

I think it is very nice to give access to these log files to the people who may be on the receiving end of shouty users with earth-shatteringly important directory-update needs. You could, of course, just share the MaData folder, but people who have to talk to upset users have enough to think about already – so I incorporated the logs in my MiisApp menus.

The idea was that the menus would refresh periodically to contain a drop-down of all the possible MAs, with subfolders listing all the export and import logs from today. Depending on how many log files you generate in a day this may or may not be user-friendly.

I’ve included the code to generate a menu of export logs here. I’d like to include a picture as well, but for various reasons it’s not happening right now.

I should mention that the menu is a bit ugly as it includes the full path to the log file in the menu text, eg \serverMaDataADexport20070726151243.xml. It’s ugly, but the code is far simpler if the text contains the path. A far cleverer programmer than me could no doubt do something with a new menu object that contained an extra property for the file path, leaving the menu text far more attractive.

I would have really like to provide a search function for the logs too, but I didn’t get that far before moving on from that job. Perhaps in the future I’ll get another crack at writing (or contributing to) the kick-ass client application for MIIS.