在域访问与本地凭据的远程注册表(远程机器) [英] accessing a remote registry with local credentials (of the remote machine) on the domain

查看:383
本文介绍了在域访问与本地凭据的远程注册表(远程机器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题有点长,但我会尽量解释:
我试图从一台计算机连接(连接到域)到另一台机器也连接到域,但失去了<在Kerberos的code> supportedencryptiontypes 。
路径:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters

The title is a bit long but i will try to explain: i'm trying to connect from one machine (which is connected to a domain) to another machine which also connected to a domain but lost the supportedencryptiontypes of the kerberos. path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters

基本上,当该值改变我的域管理员不能管理这台计算机或访问它,如果这台机器是不是在域了。
但当我这个值改回正确的值(当我与本地管理员用户本地连接)我得到充分的管理权,似乎一切都很好,很正常一次。

basically, when this value changes i as domain admin can't manage this computer or access it, as if this machine is not on the domain anymore. but when i change back this value to the proper value (when i connect locally with local admin user) i get the full management rights and it seems that everything is fine and dandy again.

所以基本上我想要做的是远程改变这个值,这意味着连接到本机与它自己的本地管理员凭据的注册表,并更改回值。

so basically what i'm trying to do is changing this value remotely, that means connect to the machine's registry with it's own local admin credentials and change back the value.

我不会张贴任何代码ATM,因为我没有,除了远程访问注册表以登录用户的凭据当前的正常方式。

i'm not posting any code ATM because i have none, except the normal way of accessing a registry remotely with a current logged on user credentials.

会后,如果需要,当然这个代码

will post this code if needed of course.

推荐答案

我发现用于该目的口碑不错的类在SO:的 http://stackoverflow.com/a/1197430/4547223

I found a nice class for that purpose here at SO: http://stackoverflow.com/a/1197430/4547223

我写了一个快速的样品与此类成功:

I wrote a quick sample with this class with success:

...
using Microsoft.Win32;
using System.Net;
...

string hostName = 192.168.1.1;

using (new NetworkConnection(@"\\" + hostName + @"\admin$", new NetworkCredential(@"ad\administrator", "TopSecret")))
{
    using (RegistryKey remoteHklm = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, hostName))
    {
        using (RegistryKey serviceKey = remoteHklm.OpenSubKey("System\\CurrentControlSet\\Services", true))
        {
            if (serviceKey != null)
            {
                foreach (string key in serviceKey.GetSubKeyNames())
                {
                    Console.WriteLine(key);
                }
            }
        }

    }
}

这篇关于在域访问与本地凭据的远程注册表(远程机器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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