无法在计算机上打开服务控制管理器''。此操作可能需要其他权限 [英] Cannot open Service Control Manager on computer ''. This operation might require other privileges

查看:1822
本文介绍了无法在计算机上打开服务控制管理器''。此操作可能需要其他权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我收到此错误无法在计算机上打开服务控制管理器''。使用ServiceController检索远程计算机的服务时,此操作可能需要其他权限。我有远程机器的管理优先权。

代码..

Hi,
I am getting this error Cannot open Service Control Manager on computer ''. This operation might require other privileges while using ServiceController to retrieve the services of remote machine. I have administrative previleges for remote machine..
Code..

ServiceController[] lFnGetServicesInServer(string lStrServer)
        {
            try
            {
                ServiceController[] lArrObjServiceController = null;
                System.Security.Principal.WindowsImpersonationContext impersonationContext = null;
                impersonationContext = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
                lArrObjServiceController = ServiceController.GetServices(lStrServer.Trim());
                return lArrObjServiceController;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion

    }





关于此认证的任何想法...

谢谢

Sreenath



Any Ideas on this authentication plzz…
Thanks
Sreenath

推荐答案

计算机名称显示为空('')。

您可以在方法签名上放置一个断点,然后检查是否传递了正确的服务器名称值in。
The computer name appears to be empty ('').
You can put a break point on the method signature and then check if the correct server name values are being passed in.


由于您确定您已正确通过管理员优先级和服务器名称,请尝试重新启动计算机。它可能有所帮助!
As you are sure that you have admin previleges & server name is correctly passed,please try restarting the machine.It may help!


服务器和客户端计算机应具有相同的用户帐户,以访问服务列表。
Server and Client machine should have same user account, to access the Service List.


这篇关于无法在计算机上打开服务控制管理器''。此操作可能需要其他权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆