简体   繁体   English

Enter-PSSession之后,Invoke-SqlCmd得到“ NT AUTHORITY \\ ANONYMOUS LOGON”错误?

[英]Invoke-SqlCmd got 'NT AUTHORITY\ANONYMOUS LOGON' error after Enter-PSSession?

I ran the following query on RemoteServer after enter-pssesion from my PC ClientPC . 从我的PC ClientPC enter-pssesion后,我在RemoteServer上运行以下查询。 (I need to use Windows integrate security) (我需要使用Windows集成安全性)

Enter-PSSesion RemoteServer # from ClientPC
Invoke-Sqlcmd -ServerInstance sqlserver 'select 1 a' # in the ps session of RemoteServer

and it got the error of 它得到了错误

Invoke-Sqlcmd : Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON'. Invoke-Sqlcmd:用户“ NT AUTHORITY \\ ANONYMOUS LOGON”的登录失败。

Then I did the following steps. 然后,我执行了以下步骤。

On RemoteServer , RemoteServer

Enable-WSManCredSSP -Role server

it returns 它返回

CredSSP Authentication Configuration for WS-Management
CredSSP authentication allows the server to accept user credentials from a remote computer. If you enable CredSSP
authentication on the server, the server will have access to the user name and password of the client computer if the
client computer sends them. For more information, see the Enable-WSManCredSSP Help topic.
Do you want to enable CredSSP authentication?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):


cfg               : http://schemas.microsoft.com/wbem/wsman/1/config/service/auth
lang              : en-US
Basic             : false
Kerberos          : true
Negotiate         : true
Certificate       : false
CredSSP           : true
CbtHardeningLevel : Relaxed

On my PC ClientPC . 在我的PC ClientPC

PS C:\> Enable-WSManCredSSP -Role client -DelegateComputer *

CredSSP Authentication Configuration for WS-Management
CredSSP authentication allows the user credentials on this computer to be sent to a remote computer. If you use CredSSP
 authentication for a connection to a malicious or compromised computer, that computer will have access to your user
name and password. For more information, see the Enable-WSManCredSSP Help topic.
Do you want to enable CredSSP authentication?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):


cfg         : http://schemas.microsoft.com/wbem/wsman/1/config/client/auth
lang        : en-US
Basic       : true
Digest      : true
Kerberos    : true
Negotiate   : true
Certificate : true
CredSSP     : true

But I still got the error? 但是我仍然有错误?

如果在客户端和服务器上都启用了CredSSP(此双跳身份验证是必需的),则您只需将身份验证明确指定为CredSSP,因为默认情况下它不会与其连接。

Enter-PSSession RemoteServer -Authentication Credssp -Credential (Get-Credential)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 sqlcmd:用户'NT AUTHORITY \\ ANONYMOUS LOGON'登录失败 - sqlcmd: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' NT AUTHORITY \\ ANONYMOUS LOGON错误(双跳) - NT AUTHORITY\ANONYMOUS LOGON Error (Double Hop) NT AUTHORITY \\ ANONYMOUS LOGON。 因错误而失败: - NT AUTHORITY\ANONYMOUS LOGON. failed with error: 从本地服务模拟sqlcmd.exe:用户'NT AUTHORITY \\ ANONYMOUS LOGON'登录失败 - Impersonating sqlcmd.exe from Local service : Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' 一段时间后登录失败,访问令牌连接失败NT AUTHORITY \\ ANONYMOUS LOGON错误 - Access token connection fails after some time with Login failed NT AUTHORITY\ANONYMOUS LOGON error SSIS 错误:用户“NT AUTHORITY\ANONYMOUS LOGON”登录失败 - SSIS error: Login failed for user “NT AUTHORITY\ANONYMOUS LOGON” Powershell Invoke-Sqlcmd 出错后从头重新启动脚本 - Powershell Invoke-Sqlcmd restarts the scripts from the beginning after an error MVC 错误用户“NT AUTHORITY\ANONYMOUS LOGON”登录失败。 系统.Data.SqlClient.SqlException - MVC error Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. System.Data.SqlClient.SqlException 循环中调用-Sqlcmd错误,一次没有错误? - Invoke-Sqlcmd error in Loop, No error once? Windows 7(ASP.NET和Web服务)中的“ NT AUTHORITY \\ ANONYMOUS LOGON”错误 - “NT AUTHORITY\ANONYMOUS LOGON” error in Windows 7 (ASP.NET & Web Service)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM