【问题标题】:How to get DCOM Configuration permission?如何获得 DCOM 配置权限?
【发布时间】:2018-02-27 15:15:05
【问题描述】:

请帮我搞定

DCOM 配置权限。

为了获得启动/访问权限,我使用了DCOMperm.exe,但我无法获得配置权限。

【问题讨论】:

  • 您对屏幕截图中的用户界面有什么不了解的地方?
  • @TomW 截图只是 OP 正在谈论什么信息的指针,他希望得到他通过代码突出显示的那些信息。
  • @TomW 我想使用 C# 获取配置权限。您知道如何获取这些信息吗?

标签: c# wmi


【解决方案1】:

在下面添加了代码来获取这些数据:

 using (DataTable comTable = new DataTable())
            {
                comTable.Columns.Add(new DataColumn("AppId"));
                comTable.Columns.Add(new DataColumn("Name"));
                comTable.Columns.Add(new DataColumn("Local Service"));
                comTable.Columns.Add(new DataColumn("Authentication Level"));
                comTable.Columns.Add(new DataColumn("RunAsUser"));
                comTable.Columns.Add(new DataColumn("Identity"));
                comTable.Columns.Add(new DataColumn("Access Permissions"));
                comTable.Columns.Add(new DataColumn("Launch and Activation Permissions"));

                comTable.DefaultView.Sort = "Name ASC";
                string query = ControlConstant.GETDCOMCONFIG;

                using (var moDisposer = new ManagementObjectDisposer())
                {
                    var managementObj = moDisposer.Search(query, msScope);

                    foreach (ManagementBaseObject dConfig in managementObj)
                    {
                        if (!string.IsNullOrEmpty(Convert.ToString(dConfig["Caption"])))
                        {
                            string szAppId;
                            DataRow row = comTable.NewRow();
                            szAppId = Convert.ToString(dConfig["AppID"]);
                            row["AppId"] = Convert.ToString(dConfig["AppID"]);
                            row["Name"] = Convert.ToString(dConfig["Caption"]);
                            row["Local Service"] = Convert.ToString(dConfig["LocalService"]);
                            row["Authentication Level"] = Convert.ToString(dConfig["AuthenticationLevel"]);
                            row["RunAsUser"] = Convert.ToString(dConfig["RunAsUser"]);
                            row["Identity"] = Convert.ToString(dConfig["RunAsUser"]);
                            row["Access Permissions"] = Utility.LaunchProcess(Utility.GetRootFolder() + "\\DComPerm.exe", "-aa " + szAppId + " list").ReadToEnd();
                            row["Launch and Activation Permissions"] = Utility.LaunchProcess(Utility.GetRootFolder() + "\\DComPerm.exe", "-al " + szAppId + " list").ReadToEnd();
                            comTable.Rows.Add(row);
                        }
                    }
                }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-22
    • 1970-01-01
    • 2013-05-10
    • 2019-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多