“访问被拒绝";在远程winrm [英] "Access denied" on Remote winrm

查看:188
本文介绍了“访问被拒绝";在远程winrm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Azure上创建了Windows VM,并通过SSL设置了winrm.

I created a Windows VM on Windows Azure with winrm over SSL set.

但是,我无法使用Powershell脚本进行连接.

But, I can't connect it using a powershell script.

运行以下命令时:

​Enter-PSSession -ConnectionUri https://myniceapp.cloudapp.net:5986 
                -Credential "hostname/username"  
                -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck)

我收到提示要求输入密码的提示,输入密码后,我就可以连接了.

I'm getting a prompt asking for password and after I type it I manage to connect.

但是,当我尝试使其自动化时,它总是返回访问被拒绝"

But, when I try to automate it, it always returns with "Access is denied"

$securePassword = ConvertTo-SecureString -AsPlainText -Force "password"
$cred = New-Object System.Management.Automation.PSCredential "hostname/username", $securePassword 
​Enter-PSSession -ConnectionUri https://myniceapp.cloudapp.net:5986 -Credential $mycreds -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck)

有什么想法吗?

修改

完整错误如下:

Enter-PSSession:连接到远程服务器myniceaspp.cloudapp.net失败,并显示以下错误消息:访问被拒绝.有关更多信息,请参见about_Remote_Troubleshooting帮助主题.

Enter-PSSession : Connecting to remote server myniceaspp.cloudapp.net failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.

第1行char:1
+ Enter-PSSession -ConnectionUri https://myniceaspp.cloudapp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo:InvalidArgument:(https://myniceaspp ... udapp.net:5986/:Uri)[Enter-PSSession],PSRemotingTransportException
+ FullyQualifiedErrorId:CreateRemoteRunspaceFailed

At line:1 char:1
+ Enter-PSSession -ConnectionUri https://myniceaspp.cloudapp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (https:// myniceaspp...udapp.net:5986/:Uri) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

推荐答案

最近有类似的问题.建议您仔细检查与您连接的用户在远程计算机上是否具有正确的授权.

Had similar problems recently. Would suggest you carefully check if the user you're connecting with has proper authorizations on the remote machine.

您可以使用以下命令查看权限.

You can review permissions using the following command.

Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell

在此处找到此提示:

http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/17/configure-remote-security-settings-for-windows-powershell.aspx

它为我修复了.

这篇关于“访问被拒绝";在远程winrm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆