powershell - 在Powershell中通过IP(不是主机名)重命名计算机

标签 powershell rename hostname

我正在处理一种情况,其中有两台具有相同主机名和不同IP的机器。其中之一需要重命名。我发现可以使用以下命令远程重命名计算机:

Rename-Computer -ComputerName "Srv01" -NewName "Server001" -LocalCredential Srv01\Admin01 -DomainCredential Domain01\Admin01 -Force -PassThru

但这是接受主机名而不是IP。
任何帮助,将不胜感激。

最佳答案

the docs:

-ComputerName

Renames the specified remote computer. The default is the local computer.

Type the NetBIOS name, an IP address, or a fully qualified domain name of a remote > computer. To specify the local computer, type the computer name, a dot (.), or localhost.

关于powershell - 在Powershell中通过IP(不是主机名)重命名计算机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57609633/

相关文章:

shell - 为什么 `help format-list` 与 `format-list | help` 不一样?

powershell - 为什么 tee 变量在后面的 scripblocks 中不可见?

powershell - 如何将带有空格的参数作为数组传递给 Powershell 中的 RoboCopy?

powershell - '['后缺少类型名称

file - 如何使用批处理文件将文件夹中的文件重命名为文件夹名

python - 如何按照列表的顺序重命名文件夹中的多个文件

Java SSL : "fatal error: 80: ... unwrapping net record" after adding the HTTPS EndpointIdentificationAlgorithm

validation - 如何验证主机名(可能是 IP)和端口号(CString)

php - 使用javaScript在linux环境下的Intranet中获取客户端主机名

ruby - 我怎样才能获得为我的 Ruby 程序重命名文件的权限?