WinRM удаленный сервер с локальной учетной записью Adminnistrator не работает?
У меня есть сервер Windows 2012R2
в домене. Этот сервер не имеет доступа пользователя домена, только локальный администратор. Я могу RDC в эту машину, используя учетную запись администратора, но не могу иметь PSSession
, так Enter-PSSession
или же Invoke-Command
или же New-PSSession
не работает. Я уже установил значение Trustedhosts на "*". Все еще не работает.
Пример:
$cred = Get-Credential # username: Aministrator, password: secret123
Enter-PSSession -computername SVR1 -Credential $cred
Сразу же я получаю ошибку:
Enter-PSSession : Connecting to remote server SVR1 failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.
Почему я не могу войти на сервер с локальной учетной записью администратора?
РЕДАКТИРОВАТЬ:
После комментария ниже, я попытался, SVR1\ADMINISTRATOR в качестве имени пользователя, затем я иду другое сообщение об ошибке:
Enter-PSSession : Connecting to remote server SVR1 failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: We can't sign you in with this credential because your domain isn't available. Make sure your device is connected to your organization's network and try again. If you previously signed in on this device with another credential, you can sign in with that credential.
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are specified.
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does not exist.
-The client and remote computers are in different domains and there is no trust between the two domains. After checking for the above issues, try the following:
-Check the Event Viewer for events related to authentication.
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport. Note that computers in the TrustedHosts list might not be authenticated.
-For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
1 ответ
Вот руководство: https://4sysops.com/archives/enable-powershell-remoting-on-a-standalone-workgroup-computer/
И краткое изложение основных моментов:
- Убедитесь, что тип сети на удаленном сервере не является "Общедоступным". Поскольку он не находится в домене, вы, вероятно, захотите убедиться, что он "Частный". Вместо этого вы можете убедиться, что вы добавили
-SkipNetworkProfileCheck
когда вы включили psremoting. - На клиенте (откуда вы инициируете) введите IP- адрес удаленного сервера для доверенных хостов. Например,
winrm set winrm/config/client @{TrustedHosts="10.0.2.33"}
в командной строке с повышенными правами (не забудьте изменить этот IP-адрес в вашей среде).
0x80090311 произошло при использовании проверки подлинности Kerberos
Вы можете получить эту конкретную ошибку при подключении к автономному компьютеру, потому что Kerberos доступен только для членов домена.
Убедитесь, что на обоих компьютерах используется общий метод аутентификации.
На клиентском компьютере:
Get-ChildItem -Path WSMan:\localhost\Client\Auth
На целевом компьютере:
Get-ChildItem -Path WSMan:\localhost\Service\Auth
Обычно вы можете использовать CredSPP при подключении к автономным компьютерам, хотя это не самый безопасный метод.
Если цель является членом домена, возможно, вы где-то отключили что-то в конфигурации Kerberos (проверьте свои объекты групповой политики)