Hi,
I believe there might be problems with IIS Authentication in DirectoryEntry object. Can you please add
DirectoryEntry.AuthenticationType = AuthenticationTypes.Encryption
and see if your issue is resolved.
Starting Windows Server 2003 SP1, all remote IIS communication needs to be encrypted, else you will end with WBEM_ACCESS_DENIED from WMI. If this AuthenticationTypes is not working, try others from the below web page and let me know how it goes.
https://msdn.microsoft.com/en-us/library/system.directoryservices.authenticationtypes(v=vs.110).aspx[
^]
If the issue is still occurring, please try to restart the pool using WMI. Please refer my article
http://www.codeproject.com/Tips/1063552/IIS-Application-Pool-Operations-via-Csharp[
^]