如何更改计算机名称并加入域? [英] How to change computer name and join domain?

查看:532
本文介绍了如何更改计算机名称并加入域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何通过C#或VB更改计算机名称并加入域.
而且我有关于联接域和更改计算机名称的vb脚本,它需要一些时间来更改计算机名称和联接域,我想一种有效的方法来实现此目的.
在此先感谢.

Hi,
How to change computer name and join domain by C# or VB.
And I had vb script about the join domain and change computer name,it takes some time to change the computer name and join domain, I wanna a efficient way to do this.
Thanks in Advance.

推荐答案

那将是对安全性的最高程度的侵犯,并且用户需要管理员权限才能执行此操作,但是您必须拨打SetComputerNameEx.转到 PInvoke.Net [ ^ ]并找到适合该方法的互操作原型.
That would be a security violation of the highest magnitude, and the user would need admin privileges to do it, but you''d have to make calls to SetComputerNameEx. Go to PInvoke.Net[^] and find the appropriate interop prototype for the method.


如果您不是WMI的专家,请查看此rename 函数. http://msdn.microsoft.com/en-us/library/aa393056.aspx [ ^ ]

我不确定是否有正确的特权可以帮助您重命名计算机,以及如何从代码中加入域,但是在WMI中还是有很多适合您的东西
If you are not intemedated by WMI then look at this rename function. http://msdn.microsoft.com/en-us/library/aa393056.aspx[^]

Given right privilege that should help you to rename the computer, as to how to join a domain from code, I am not sure, but there many be something for you, again in WMI


您可以从此处 [ ^ ].就像其他任何方法一样,这只是另一个WMI方法调用.但是,当然,运行此命令的用户必须具有Domain Admin权限,或者已经必须为计算机名称设置域帐户.
You can get the general idea of joining a domain from here[^]. It''s just another WMI method call, like any other. But, of course, the user running this has to have Domain Admin permissions, or the domain account already has to be setup for the machine name.


这篇关于如何更改计算机名称并加入域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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