如何在同一网络中的另一个系统的cmd上执行命令

时间:2013-11-07 08:03:22

标签: windows powershell cmd command-prompt remote-access

如何在没有cmd等软件帮助的情况下,在同一网络中的另一台计算机的PsExec执行命令。
我有系统名称和登录系统的凭据。 有没有办法使用命令提示符 PowerShell

执行此操作

感谢您的帮助

2 个答案:

答案 0 :(得分:0)

最好的方法是使用WinRM和Invoke-Command cmdlet。在此处阅读更多相关信息:http://technet.microsoft.com/en-us/library/hh849719.aspx

它允许你写一些类似的东西:

 Invoke-Command -ComputerName server01 -Credential domain01\user01 -ScriptBlock {Get-Culture}

答案 1 :(得分:0)

使用WMI:

 $WMI_Params = 
  @{
     Class        = 'Win32_Process'
     Name         = 'Create'
     ArgumentList = 'Notepad.exe'
     Credential    = $Creds
   }


Foreach ($Computer in $Computers)
 { Invoke-WmiMethod @WMIParams -ComputerName $Computer }