PowerShell 远程连接与其它技巧

简介: 远程连接 •1.通过WinRM quickconfig配置可以通过WinRM访问 •2.访问WSMAN,将主机名配置到TrustedHosts •3.通过Enter-PSSession连接主机   WMI远程连接 •执行远程命令Invoke-Command -ComputerName 192.

远程连接

•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 即可

目录
相关文章
|
安全 Windows 数据安全/隐私保护
PowerShell远程连接到Windows
命令行远程连接到Windows
10595 0
|
4月前
|
存储 Ubuntu Linux
windows可以安装Ubuntu,ubuntu上也可以安装Powershell
powerhsell除了可以在windows上使用外,还可以在Ubuntu上部署开发环境。下面介绍Ubuntu上安装powershell的方法。
60 0
|
6月前
|
Shell Linux 开发工具
windows中cmd和PowerShell批处理命令
之前在 Git 批量删除本地分支,有用到 Linux 或 MacOS 下的批处理命令,这个命令中的 grep、xargs 本身是 Shell script,在 windows 中的 cmd 和 PowerShell 中是不能用的
53 0
|
9月前
|
JavaScript Windows
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
|
9月前
|
Windows
使用PowerShell获取Windows当前锁屏壁纸
使用PowerShell获取Windows当前锁屏壁纸 如果原始图片丢了,用这段代码就可以提取当前锁屏壁纸了!
103 0
|
应用服务中间件 nginx Windows
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
|
XML 监控 数据格式
利用powershell进行windows日志分析
0x00 前言   Windows 中提供了 2 个分析事件日志的 PowerShell cmdlet:一个是Get-WinEvent,超级强大,但使用起来比较麻烦;另一个是Get-EventLog,使得起来相当简单,可以实时筛选,接下来,我们利用PowerShell 来自动筛选 Windows 事件日志。
2447 0