远程连接

•1.通过WinRM quickconfig配置可以通过WinRM访问

•2.访问WSMAN,将主机名配置到TrustedHosts

•3.通过Enter-PSSession连接主机

 

WMI远程连接

•执行远程命令Invoke-Command -ComputerName 192.168.1.110 -ScriptBlock{$p=get-process}

•访问远程对象 [WMI]'\\chsword-pc\root\cimv2:Win32_Process.Handle="1804"'

 

Profile

•$Profile即为存储 Profile文件的地址

•通过notepad $profile可以编辑

 

执行脚本

•将脚本存为ps1文件

•执行set-executionpolicy remotesigned 允许脚本执行

•输入 .\xxx.ps1 即可

相关文章:

  • 2022-12-23
  • 2021-06-18
  • 2022-02-01
  • 2021-12-10
  • 2021-11-15
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
相关资源
相似解决方案