手机
当前位置:查字典教程网 >脚本专栏 >PowerShell >PowerShell小技巧之启动远程桌面连接
PowerShell小技巧之启动远程桌面连接
摘要:以WindowsServer2012R2为例,其实非常简单。先启用远程连接:(gwmi-classwin32_terminalservice...

以Windows Server 2012 R2为例,其实非常简单。先启用远程连接:

(gwmi -class win32_terminalservicesetting -namespace "rootcimv2terminalservices").setallowtsconnections(1)

然后再启用几条防火墙规则即可,用PowerShell(需要管理员权限)更显其威武:

PS> Get-NetFirewallRule -Name RemoteDesktop* | select DisplayName,Direction,Enabled DisplayName Direction Enabled ----------- --------- ------- 远程桌面 - 用户模式(TCP-In) Inbound False 远程桌面 - 用户模式(UDP-In) Inbound False 远程桌面 - 远程监控(TCP-In) Inbound False PS> Get-NetFirewallRule -Name RemoteDesktop* | Set-NetFirewallRule -Enabled true

【PowerShell小技巧之启动远程桌面连接】相关文章:

PowerShell数组操作简明教程

PowerShell多线程执行前后台作业的例子

PowerShell脚本性能优化技巧总结

PowerShell 入门基础教程

PowerShell把IP地址转换成二进制的方法

Powershell小技巧之获取变量列表

Powershell小技巧之使用Copy-Item添加程序到开机启动

PowerShell中对函数参数的命名建议

Powershell小技巧之通过EventLog查看近期电脑开机和关机时间

Powershell小技巧之使用Get-ChildItem得到指定扩展名文件

精品推荐
分类导航