无法启动Forefront Identity Manager Service

今天发现SharePoint的User Profile有问题,仔细检查发现是Forefront Identity Manager Service stop了,没有启动。然后手动启动它时,总是不成功,报的错误是:

Service cannot be started. System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:5725/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied
   at System.Net.HttpListener.AddAll()
   at System.Net.HttpListener.Start()
   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   --- End of inner exception stack trace ---
   at Microsoft.ResourceManagement.WindowsHostService.OnStart(String[] args)
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

Google后的解决方案是管理员模式下运行如下命令:

netsh http delete urlacl http://+:5725/

netsh http delete urlacl http://+:5726/

netsh http add urlacl url=http://+:5725/ user=运行这个服务的账号 (在我的环境中是就是farm account)

netsh http add urlacl url=http://+:5726/ user=运行这个服务的账号

因为对netsh命令不熟悉,所以深入研究了下。

Forefront Identity Manager Service其实就是host了自定义的WCF服务的windows 服务,而这个WCF服务需要使用Http协议向外提供服务。因此需要向HTTP.sys注册和侦听相应的URL(IP+端口)。但由于运行这个windows 服务的账号没有权限配置Http.sys,所以会出现这个错误。因为需要使用netsh工具(一个专门用来配置HTTP.sys的工具,是server 08引入的,之前对应的工具为:Httpcfg.exe)的urlacl命令授予相应的权限。

参考:

http://social.technet.microsoft.com/Forums/en/ilm2/thread/51446cf1-5e94-40a9-aa42-8caf9dc12e96

http://blog.csdn.net/ggw128/archive/2010/09/09/5872424.aspx

原文地址:https://www.cnblogs.com/ITHelper/p/2075742.html