IIS 7 Change DefaultAppPool to Network Service for this error 'System.DirectoryServices.DirectoryServicesCOMException’

You may need to do this when your running you web component WCF service or whatever and you receive unusual errors like System.DirectoryServices.DirectoryServicesCOMException’ when using directory services.

This is due to the fact that by default IIS7 runs as ‘IIS APPPOOL\\DefaultAppPool’ and doesn’t have enough permission. Change to Network service and it should be fine!

Quite simple to do it, just in case your more used to IIS6 :-)

1. Start->Run-> Type 'inetmgr'

2. Expand the server name on the left connections panel and you will seeApplication Pools

3. Click ‘DefaultAppPool’

4. Click ‘Advanced Settings’

5. Goto ‘Process Model’ Section

6. Select 'Identity' = 'Network Service'

Hope that helps!

Keith