[20]Window PowerShell DSC学习系列---- start-dscconfiguration 中遇到 Access Denied的解决方案
来源:互联网 发布:淘宝外卖超出配送范围 编辑:程序博客网 时间:2024/06/07 15:22
当我们执行start-DscConfiguration -computername psdsc-window201 -Path c:\DSC\TestFile -Wait -Verbose -force
这条命令的时候,会遇到下面的问题
问题的根源有很多,解决的也不相同办法,主要有以下解决方法:
@执行下面的命令从而确保该开启的服务都已经开启Enable-PSRemoting
其输出的界面信息如下:PS C:\windows\system32> Enable-PSRemoting
WinRM Quick Configuration
Running command "Set-WSManQuickConfig" to enable remote management of this computer by using the Windows Remote
Management (WinRM) service.
This includes:
1. Starting or restarting (if already started) the WinRM service
2. Setting the WinRM service startup type to Automatic
3. Creating a listener to accept requests on any IP address
4. Enabling Windows Firewall inbound rule exceptions for WS-Management traffic (for http only).
Do you want to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
WinRM is already set up to receive requests on this computer.
WinRM is already set up for remote management on this computer.
Confirm
Are you sure you want to perform this action?
Performing the operation "Set-PSSessionConfiguration" on target "Name: microsoft.powershell SDDL:
O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;RM)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This lets selected users remotely run Windows
PowerShell commands on this computer.".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "Set-PSSessionConfiguration" on target "Name: microsoft.powershell.workflow SDDL:
O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;RM)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This lets selected users remotely run Windows
PowerShell commands on this computer.".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "Set-PSSessionConfiguration" on target "Name: microsoft.powershell32 SDDL:
O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;RM)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This lets selected users remotely run Windows
PowerShell commands on this computer.".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Confirm
Are you sure you want to perform this action?
Performing the operation "Set-PSSessionConfiguration" on target "Name: microsoft.windows.servermanagerworkflows SDDL:
O:NSG:BAD:P(A;;GA;;;BA)(A;;GA;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD). This lets selected users remotely run Windows
PowerShell commands on this computer.".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
@ help about_Remote_Troubleshooting 查看更多的帮助信息
通过help about_Remote_Troubleshooting 查看更多的帮助信息@运行Set-WSManQuickConfig -SkipNetworkProfileCheck
When you connect your network, it gets set to Public, Private, or Domain. If the current profile is set to Public, Set-WSManQuickConfig will fail with that message. You can either change it (if the system will let you) or skip the profile check.就执行下面的命令:
Set-WSManQuickConfig -SkipNetworkProfileCheck
@其他原因
另外,也可能是Winrm的设置没有设置好,比如,监听的5985端口的服务没有开启,认证的方式没有设置正确;可以通过下面的方式进行查看。winrm get winrm/config
那么如何设置其值呢?有很多的方法,下面介绍两种方法:在CMD窗口中和在PowerShell窗口中#1 需要在cmd窗口,而不是PowerShell窗口
winrm set winrm/config/client @{TrustedHosts="*"}
#2 在PowerShell窗口中,需要加上单引号
winrm set winrm/config/client ‘@{TrustedHosts=”*”}’
winrm set winrm/config/service ‘@{EnableCompatibilityHttpListener="true"}'
1 0
- [20]Window PowerShell DSC学习系列---- start-dscconfiguration 中遇到 Access Denied的解决方案
- [21]Window PowerShell DSC学习系列---- 在Window 2012 R2 安装DSC 5.0 Pull服务器报错的解决方案
- [25]Window PowerShell DSC学习系列----如何更换DSC Pull服务器数据库为Access数据库?
- [6] Window PowerShell DSC 学习系列----如何安装最新的PowerShell DSC 5.1 Pull Server?
- [3] Window PowerShell DSC 学习系列----如何在PowerShell DSC 5.x 安装最新的DSC Module?
- [1] Window PowerShell DSC 学习系列----DSC的定义和2种架构模式
- [8] Window PowerShell DSC 学习系列----MOF文件和DSC Module的部署
- [4] Window PowerShell DSC 学习系列----PowerShell DSC 5.x 提供了哪些有用好用的工具命令?
- [22]Window PowerShell DSC学习系列---- 如何用PowerShell脚本查看DSC服务器的执行报表(Report)
- [28] Window PowerShell DSC 学习系列----如何用Java调用PowerShell DSC 5.x的oData服务
- [31] Window PowerShell DSC 学习系列----PowerShell DSC 专栏竟然在CSDN推荐的优秀专栏里面
- [2] Window PowerShell DSC 学习系列----DSC的资源(Resource)以及配置和格式(Configuration && Sytax )
- [9] Window PowerShell DSC 学习系列----错误诊断和分析
- [7] Window PowerShell DSC 学习系列----如何被管理的设置节点注册到Pull Server?
- [23]Window PowerShell DSC学习系列---- MOF文件能存储用户的密码吗?
- [24]Window PowerShell DSC学习系列---- 如何保护MOF文件里面存储的密码?
- [5] Window PowerShell DSC 学习系列----如何生成一个DSC MOF文件?
- [32] Window PowerShell DSC 学习系列----使用DSC Package安装时,如何获取Product ID?
- Android之Context和Activity互相转换
- 八大排序学习之七堆排序
- macOS Sierra下xcode配置opencv2.4.13
- Lesson 18 Nehe
- 封装
- [20]Window PowerShell DSC学习系列---- start-dscconfiguration 中遇到 Access Denied的解决方案
- JSP的爸爸Servlet第一部分总结
- 数据库简介
- uboot 无法通过nfs下载服务器某个文件夹下面的内核
- 基本头部插入式单向链表程序
- 网易云音乐 反鸡汤
- Android Studio 自定义keystore的方法
- 学习Web开发的十佳网站
- 前端札记