19 July 2012

Checking Which User Account is Accessing a File

It's often useful to find out which account is accessing a file, e.g. a CRM Plugin in writing to a log file and you need to determine which Windows account is trying to access the file (in this example it will be the user that the CRM Asynchronous service is running under).

Here's a quick how-to to easily find out this information:

1. Download Process Monitor from Technet, unzip it, and run Procmon.exe
2. Select File and uncheck Capture Events
3. Select Edit --> Clear Display
3. Select Filter --> Filter
4. Under "Display entries matching these conditions:" select the following:
  • Path
  • is
  • [path and filename of the file to monitor]
5. Click Add
6. Click OK
7. Select File and check Capture Events
8. Run the code that will attempt to access the file
9. Go back to Process Monitor and select File and uncheck Capture Events
10. In the events list there will be rows showing the filename, double click on one these
11. From the Event Properties window select the Process tab
12.The user that attempted to access the file is shown.

30 March 2012

Entities Not Appearing in Settings After Import

In CRM 4.0 and now 2011 I've had an issue when I import customisations/solutions which have entities that are setup to appear in the Settings area. The problem is they just don't appear!

This has been one of those niggles that I've always been aware of but never done anything about, put simply it's always been quicker to just tick the settings box, save, and publish. Well this morning something has changed and I did a bit of digging.

Apparently you need to include the SiteMap in your export, even if it's not been changed, and hey presto the entities appear in settings as they should.