Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

security - Credentials for ServerManager.OpenRemote

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You must enable the remote server for remote configuration. Microsoft.Web.Administration uses AHADMIN DCOM service, so this should be open for remote access.

First, make sure you can change AHADMIN properties: https://serverfault.com/questions/242714/how-can-i-enable-ahadmin-properties

Then, follow these steps or use the provided script: http://mvolo.com/connecting-to-iis-70-configuration-remotely-with-microsoftwebadministration/

Also, check you have remote access permissions for AHADMIN using dcomcnfg. See how here http://support.microsoft.com/kb/176799 and here http://help.eprint.net/dcomconfig.htm


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...