PowerShell远程管理Windows Server(1):域环境

简介:

*此次是实战使用于WMF3.0以上版本

一、理论原理

使用PowerShell远程管理Windows Server是Windows Management Framework的核心思想:使用Powershell充当远程客户端,使用WinRM作为接收的服务端,来对远程的Windows Server进行远程操作;实验图如下:

image


二、操作准备

1.WinRM的开启和关闭:http://281816327.blog.51cto.com/907015/1394799

2.WinRM的配置:http://281816327.blog.51cto.com/907015/1394891


三、实战

1.在“iis01-op”上开启Windows Server的WinRM监听;

image

2.从iis02_op远程到iis01-op;

    A.在iis02_op的powershell中输入“enter-pssession –computer iis01-op –credential contoso.test\adminstrator”,然后回车,弹出的对话框中输入contoso.test\adminstrator的密码;

image

   B.点击''OK”后,可以看到我们已经远程到iis01-op的powershell上;

image

3.远程操作“Ipconfig”事例;

    A.在iis01-op上输入ipconfig,可以看到IP为192.168.11.53;

image

    B.在iis02_op上远程到iis01-op的powershell会话中输入ipconfig,得到同样的IP地址192.168.11.53;

image

4.退出远程操作;

   A.在客户端退出;在iis02_op远程的powershell中输入“enter-pssesion”,即退出远程会话;

image

   B.在服务端退出;在iis01-op的powershell中输入“get-process –name *wsmpro* |stop-process”将关闭所有进入到iis01-op上的远程会话;

image





本文转自 bannerpei 51CTO博客,原文链接:http://blog.51cto.com/281816327/1397239,如需转载请自行联系原作者

相关文章
|
1月前
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
385 2
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
|
1月前
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
196 0
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
|
1月前
|
存储 SQL 人工智能
Windows Server 2025 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 10 月更新)
348 0
|
2月前
|
运维 安全 网络安全
Windows Server 2019拨号“找不到设备”?Error 1058解决指南
Windows Server 2019拨号报错1058?别急!这不是硬件故障,而是关键服务被禁用。通过“服务依存关系”排查,依次启动“安全套接字隧道协议”“远程接入连接管理”和“路由与远程访问”服务,仅需4步即可恢复PPPoE或VPN拨号功能,轻松解决网络中断问题。
261 1
|
2月前
|
存储 SQL 人工智能
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
1014 3
Windows Server 2025 中文版、英文版下载 (2025 年 9 月更新)
|
2月前
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 9 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 9 月更新)
317 2
|
1月前
|
Unix Shell Windows
Windows PowerShell技巧:使用findstr实现类似grep的功能
显示带有线路编号**: `/N`选项将显示每条结果前面带有其在线路上出现位置编号。
362 7
|
1月前
|
存储 Windows
Windows PowerShell操作:如何删除环境变量
此外,还有一些第三方工具可以用来管理环境变量,这些工具通常提供了更为用户友好的界面来添加、编辑或删除环境变量,但是使用PowerShell可以更直接地控制这些设置,并且可以很容易地集成到脚本中以自动化环境配置的管理。
303 7
|
2月前
|
安全 Linux iOS开发
SonarQube Server 2025 Release 5 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
SonarQube Server 2025 Release 5 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
184 0
SonarQube Server 2025 Release 5 (macOS, Linux, Windows) - 代码质量、安全与静态分析工具
|
3月前
|
Linux 虚拟化 iOS开发
Windows Server 2025 OVF (2025 年 8 月更新) - VMware 虚拟机模板
Windows Server 2025 OVF (2025 年 8 月更新) - VMware 虚拟机模板
394 3
Windows Server 2025 OVF (2025 年 8 月更新) - VMware 虚拟机模板

热门文章

最新文章