PowerShell相關問題

1、winrm問題一覽

https://blog.csdn.net/weixin_40943540/article/details/89344265

2、設置

   Enable-PSRemoting -Force

   //解決,跳過檢查網絡

   Enable-PSRemoting -Force -SkipNetworkProfileCheck

3、添加一個TrustedHosts表,相當於一個信任列表。

    Set-Item wsman:\localhost\Client\TrustedHosts -value 10.167.46.38

    set-item -force wsman:\localhost\listener\listener*\port 5986

    netstat -nao | findstr "5985"

    winrm set winrm/config/client  '@{TrustedHosts="10.167.46.111"}'

4、針對winrm service 進行基礎配置

    winrm quickconfig

    查看winrm service listener:

    winrm e winrm/config/listener

    爲winrm service 配置auth:

    winrm set winrm/config/service/auth '@{Basic="true"}'

     爲winrm service 配置加密方式爲允許非加密:

     winrm set winrm/config/service '@{AllowUnencrypted="true"}'

5、powershell轉化成c#

https://yq.aliyun.com/articles/511407

https://codeday.me/bug/20180207/131861.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章