Я выполнил следующий запрос на RemoteServer
после enter-pssesion
с моего компьютера ClientPC
. (Мне нужно использовать встроенную безопасность Windows)
Enter-PSSesion RemoteServer # from ClientPC
Invoke-Sqlcmd -ServerInstance sqlserver 'select 1 a' # in the ps session of RemoteServer
и он получил ошибку
Invoke-Sqlcmd: сбой входа для пользователя 'NT AUTHORITY \ ANONYMOUS LOGON'.
Затем я сделал следующие шаги.
Вкл. RemoteServer
,
Enable-WSManCredSSP -Role server
возвращает
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
На моем ПК 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
Но я все еще получил ошибку?