The ImAutoArchiving Flag

picI think the number one request I’ve seen on the Microsoft forums and by other people is the ability to change/manipulate the “Save IM conversations in my email Conversation History folder”.  This can of course be set via the set-csclientpolicy but typically this isn’t the desire of the administrator.  Instead, the administrator would like to blank out (uncheck) the box allow the end-user to login to the client and turn on the feature when/if they want.

If you look at old versions of the client there was a registry key for EnableIMAutoArchiving which could be set that controlled this feature.  However, as of Lync 2013 (and maybe it was true in 2010 also – don’t have a client laying around anymore) this registry key has no affect on the behavior of the client.  So that got me thinking: where exactly is this setting stored?

It’s in the DB Stupid

The first test I did was to uncheck this setting and go into the registry to see if I could find any reference for EnableIMAutoArchiving or  IMAutoArchiving but there is none.  So I moved to a second computer and found that when I logged out and back in, the setting was changed on that new computer.  This told me immediately that this setting was being published into the database.

So a quick look in snooper on registration confirms:

pic2

Here we can clearly see that imAutoArchiving is now set to false.  So where exactly in the database is this being set.  Since this is persistent data we know the data will exist in both RTC and RTCLocal (using a standard edition server for testing).  So a quick dip into the database.

pic3

To discovery the categoryID for otherOptions

pic4

To discovery my resource ID

We need to know the CategoryID and ResourceID to determine anything.

The CategoryDef table contains all of the published information for a user/system.  Everything from ContactCard, CalendarInformation and more.  We need to find the otherOptions category information.  The Resource table contains every user (internal, external, federated) who has ever touched your system.  Within resource, we need to find my own ID.

The two searches above you can see that they are 21 and 145 respectfully.  So than we go to the PublishedStaticInstance table (which contains everything about the user, contacts, buddy list, etc.) and find this:

pic5

There are three rows that are returned for CategoryID 21 (otherOptions).  Each of them contain different information that is available in otherOptions namespace.

NOTE: I am casting the [Data] column otherwise it will just display as binary data and you will not be able to actually view the contents of the column.

So if we copy/paste the Data from row 1 into notepad we see this:

pic6

Here we can clearly see the data sitting in the back-end database just asking to be modified.  The problem is, the data is sitting in a Image column type which isn’t something you can simply run a SQL query against and update.

Stored Procedures

Since we cannot edit the information directly (which wouldn’t be supported but fun to play with in a lab) that means we would need to search through all of the stored procedures and see if we could find anything.  After spending some serious time hunting around I didn’t find anything that fit the bill.  I’m sure the procedure is in there somewhere I just couldn’t find it.

What is OtherOptions

There isn’t really much available on how to update these fields programmatically or direct via SQL.  You can find some data on the Office Dev Center for the oo Namespace here:

http://msdn.microsoft.com/en-us/library/office/dd941485(v=office.13).aspx

But I’m not a full time developer and not sure how to access this information.  It doesn’t even specify what programming process (UCWA, SDK, etc.) would be needed if I wanted to write my own app.

Conclusion

So in the end, the requested feature of automatically unchecking “Save IM conversations in my email Conversation History folder” and then allowing the end-user to turn it on doesn’t appear to be possible through any hacking of the database or otherwise.  I know this will come as a disappointment to many administrators but understanding where the setting exist should help understand why we can’t change it directly.

Unsupported Conclusion

Here goes my normal do this only in a lab and I am not at all responsible for what you do if you do this in your production environment.

There is a tool that I found that supports editing Image columns and specifically the XML file within them.  If you download EMS SQL Studio (I’ve never used this product before – just found it on the innerwebs) you can see and modify the XML in the data column.  Here you can see my XML file:

pic8

I can edit the imAutoArchiving row from true to false and upon logout/login of my Lync client the setting has been changed.  Again, direct editing of the database is NEVER supported.  But maybe a SQL DBA can use this knowledge to find the stored procedure that is called.

8 comments on “The ImAutoArchiving Flag”

  1. James Dotson Reply

    This setting can be found in the exported user data: Use Export-CsUserData for one user then extract the XML files, open and search for otherOptions in the DocItemSet.xml file. The data element is base64 encoded and once decoded will reveal the setting for imAutoArchiving. One could feasibly edit this repackage the files then use Update-CSUserData to place it back in to database. I use a similar technique to update user’s data in home-brewed powershell cmdelts.

    • Richard Brynteson Reply

      This is absolutely another option. I didn’t mention this one primarily because I wanted to show where the information was hiding in the database. But yeah, this should work just as my other solution listed. Keep in mind, both of these would be considered wildly unsupported by Microsoft. 🙂

  2. Pingback: Client Registry Keys (Part One)

  3. Pingback: Client Registry Keys (Part 4)

  4. TechiBlog Reply

    if you want user to have ability to enable or disable this option then create a new client policy and do not set IMAutoArchiving to any value (True / False) let it blank. then all users have this policy will have option to tick or untick “Save IM conversations in my email Conversation History folder” option using Lync Client.

    • Richard Brynteson Reply

      Well yes, but it doesn’t accomplish what most people want. The requested feature is to start with it blank and have users “opt in”. The client defaults to enabled and the above doesn’t clear the box but let users opt-in. We wait and hope…

  5. No Reply

    Can the pics in this article be reuploaded? it doesn’t make much sense without them.

Leave A Reply

Your email address will not be published. Required fields are marked *