I'm trying to use ServerManager.OpenRemote (from Microsoft.Web.Administration) but am unable to find documentation on how to give it different credentials from the current user. I tried SimpleImpersonation (from How do you do Impersonation in .NET?) and it gives me the same error:
System.UnauthorizedAccessException - Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine [...] failed due to the following error: 80070005 [...]."
Firewall on the remote machine is off. UAC is disabled.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…