windows – 无法使用powershell重命名计算机
发布时间:2020-12-14 00:06:58 所属栏目:Windows 来源:网络整理
导读:$script = { Rename-Computer -ComputerName "ADMINIS-ID1PS7V" -NewName "SERVER1" }$computerName = "ADMINIS-ID1PS7V"$username = "Administrator"$pw = "123!@#qaZ"# Create Credentials$securepw = ConvertTo-SecureString $pw -asplaintext -force$cre
$script = { Rename-Computer -ComputerName "ADMINIS-ID1PS7V" -NewName "SERVER1" } $computerName = "ADMINIS-ID1PS7V" $username = "Administrator" $pw = "123!@#qaZ" # Create Credentials $securepw = ConvertTo-SecureString $pw -asplaintext -force $cred = new-object -typename System.Management.Automation.PSCredential -argument $username,$securepw # Create and use session $session = New-PSSession -credential $cred -ComputerName $computerName Invoke-Command -Session $session -ScriptBlock $script Remove-PSSession $session >我在机器上禁用了防火墙. 我一直在: Fail to rename computer 'ADMINIS-ID1PS7V' to 'SERVER1' due to the following exception: Access is denied. + CategoryInfo : OperationStopped: (ADMINIS-ID1PS7V:String) [Rename-Computer],InvalidOperationException + FullyQualifiedErrorId : FailToRenameComputer,Microsoft.PowerShell.Commands.RenameComputerCommand + PSComputerName : ADMINIS-ID1PS7V
为什么要远程(invoke-command)使用具有-computername参数的cmdlet?你试过直接运行命令吗?
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-phone-7 – 谁在Windows Phone 7中设置了线程文化?
- 为什么禁用Windows网络适配器向Akamai发出HTTP请求?
- 我可以在Microsoft Hyper-v虚拟机中运行Android Studio(And
- windows-7 – 在Qt Creator中使用Qt标准图标
- windows – OpenGL – 直接渲染到位图
- windows10服务器管理器不能启动怎么解决
- Windows批处理 – 删除隐藏文件
- WIN2000 Apache php mysql 安装及安全手册
- 这些Windows环境变量的含义是什么?HOMEDRIVE,HOMEPATH,HOM
- 在WINDOWS上编译Objective-C时出现错误“Foundation.h:找不
推荐文章
站长推荐
热点阅读