0

我有一台 HyperV 服务器,上面托管了 10 多个虚拟机。它们都使用基本映像,因此它们没有连接到域,也没有配置 NIC。有没有一种方法可以让我从主机运行命令来配置虚拟机 NIC 并加入域,就像我实际登录一样?

如果我只是从 HyperV 中弹出虚拟机,这很容易完成:

###Joining domain###

$domain = "mydomain.gbl"
$cred = get-credential mydomain\defaultuser

Add-Computer -DomainName $domain -Credential $cred

现在,如果我只有几台机器,这种方法是可以的,但是由于我有很多甚至更多需要配置的机器,我正试图找到一种方法来自动化这些任务。

也许我可以在主机上的虚拟机上创建计划任务?

4

1 回答 1

0

Since you're running Server 2008 your only option (AFAICS) would be to configure the network interfaces of the VMs with static MAC addresses (e.g. with the PowerShell Management Library for Hyper-V), set up a DHCP to provide the VMs with IP addresses. After that you should be able to do something e.g. with PsExec if the Windows Firewall is disabled on the VMs. If it isn't, you'll have to log in manually. You need at least some basic configuration for remote management.

于 2013-04-03T19:40:35.650 回答