- Toll Free: 1-866-SONOMA1
- Email Newsletter
- Blog
- YouTube
- Contact Us
Sonoma Partners
Auditing Export To Excel transactions via IIS logs
Posted by Mike Snyder on March 5, 2007 |Whenever I demo Microsoft CRM to prospects, one feature that I make sure that I ALWAYS show is the Export to Excel. Microsoft CRM can of course simply dump data into Excel (like many other CRM applications), but Microsoft CRM allows you to export data into a Dynamic Worksheet or a Dynamic PivotTable. By doing a dynamic Export, the Excel file maintains a live link to the Microsoft CRM database so that you can refresh the data in Excel at any time.
When executives see me demo the export the Excel feature one of the first questions out of their mouths is always "What prevents an employee from exporting all of our customer records into a file and then leaving the company!?". The answer is simple. You can disable the Export to Excel feature for users within their security role settings. But let's assume for a second that your company allows users to Export to Excel and you were curious about what type of data exports your employees have been performing. How could find out this information?
Well Microsoft CRM is really just a big giant web application at its foundation, and therefore it runs within Internet Information Services ("IIS"). And of course IIS records rather detailed log information about web site usage including IP addresses, pages requested, dates, times, querystrings and so on. Therefore to find out what types of Excel exports your Microsoft CRM users are doing, you can just poke around a little in the IIS log files.
If you're familiar with IIS, you probably already know how to find the location of the log files, but I'll give a quick recap for those who are not. On the Microsoft CRM server, open the Internet Information Services Manager and find the Microsoft CRM v3.0 website. Right-click on the website and select Properties. The following dialog will open:
Then select the Properties button, and this window will open:
From here you can see that the log file directory is c:\WINDOWS\system32\LogFiles\ and the folder for this Microsoft CRM website is W3SVC1 (but yours might be different). Now launch Windows Explorer and browse to this directory. You will see a bunch of files in this folder (one for each day) named with the exyymmdd.log naming convention.
Open any of these files with the text editor of your choice. Then search in the file for the text "mode=export". If someone exported data to Excel during that day, you'll see a line that looks something like this:
2007-03-05 00:59:14 W3SVC1 192.168.252.144 GET /_grid/print/print_dlg.aspx mode=export&multipage=0&hasfetch=0&showlive=1&enablelive=1&viewid=%7BE35F1FC9-9450-455B-8F2A-5B59BA193706%7D&viewtype=1039&otc=10016 80 - 192.168.252.200 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+6.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506;+.NET+CLR+1.1.4322) 401 2 2148074254
For detailed information about what all of this stuff means, go read this. For the purposes of this post, we just care about two parts of this:
- The viewid of =%7BE35F1FC9-9450-455B-8F2A-5B59BA193706%7D
- The IP address of 192.168.252.200
One way to determine which view of data that the viewid relates to is to browse to (entering in the name of your Microsoft CRM server and the viewid you retrieved from the IIS log file):
http://<yourcrmserver>/tools/vieweditor/viewManager.aspx?id=<enterviewidhere>
If you copied and pasted correctly, then you'll see the view editor for the view that a user exported! For example, if you see the view editor for the Active Leads view then you know that a user exported the data from the Active Leads view. Now that you know what data was exported, you can use the IP address to determine which computer/user did the export. The NBSTAT -A command in DOS typically does the trick for me to translate an IP address to a NETBIOS computer name.
If you have a large number of Microsoft CRM users, the IIS log files will get quite large. Working with very large log files can be slow, and it can be cumbersome to search for the export information one day at a time. Therefore if you wanted to audit this Excel export information on a regular basis I would strongly recommend that you import the IIS log files into a SQL Server database and then write the appropriate queries, reports, etc.
Comments
Post a Comment
Contact Us for a Quote, or Personalized Demonstrationof Microsoft Dynamics CRM for Your Business.
Contact Us
Previous Post
Back to Blog
Great post!
Posted by: Niths | Mar 8, 2007 6:04:21 AM
Great post; just today I got the requirement from a customer to be able to audit exports. This will do the trick nicely.
To add a suggestion, it appears that IIS will also record the username of the requestor, which on an initial look seems to work as expected. The advantage to this is that a renegade user could do an export from any unlocked workstation, thus the IP address wouldn't tell who the perpetrator was. Of course if the person could find an unlocked workstation belonging to someone else with export permission and automatic authentication turned on he could still pull it off, but only workstations belonging to users with export permission would expose this risk if left unlocked, instead of every workstation with network access to the CRM installation.
Posted by: What About Thad? | Apr 9, 2007 3:00:26 PM
"Only workstations belonging to users with export permission... instead of every workstation with network access..."
That is assuming the former is a subset of the latter.
Posted by: What About Thad? | Apr 9, 2007 3:04:08 PM
Great post! Thank you very much.
Nevertheless, it works only for exports generated from the web client. For exports generated from CRM Outlook client, no such information is logged in IIS. Do you have another solution for these?
And what about exports when the user is offline?
Posted by: Benoît | Jul 30, 2007 9:08:00 AM
Any news regarding auditing the excel export with the outlook client?
Posted by: Jan | May 28, 2008 2:08:13 AM
What about registering exported / printed data from CRM4.0 Server?I tried to audit the log file via IIS logs and I didn't find any information about export but it was done.
Any ideas?
Posted by: Lydia | Jul 25, 2008 2:57:30 PM
Thanks very much for your helpful article
In CRM 4.0, I can not see any "export" keyword in log file
Pls kindly help me with many thanks :)
Posted by: Quang Khai | May 9, 2010 10:34:02 PM