Winrm не удается выполнить операцию windows admin center

Table of Contents

“Connection Error” Windows Admin Center the basics.

Windows Admin Center, previously Project Honolulu, is a fairly new product which is currently in Public Preview. It will be the new way of managing servers. With Windows Admin Center it is easier to just put Windows Core Servers only in your environment. Your helpdesk (system administrators) can then use Windows Admin Center as a GUI.

Of course, I also played around with Windows Admin Center, and so far, I have encountered 2 different problems that give almost the same error message. I have 2 different fixes below that can solve your problem. They are both quite short and you go through them quickly.


Fix 1 – “WinRM cannot complete the operation”

  • Go to the gearwheel in the upper-right corner.
  • Go to Access.
  • Add a Security Group (Could be domain admins).
FIX: “WinRM cannot complete the operation”
  • Refresh Windows Admin Center.
  • You should be able to connect to Connected Servers again.

Fix 2 – “WinRM cannot complete the operation”

If you are logged in more frequently on the Windows Admin Center, it is possible that the credentials used for “Managed As” have expired.

  • Select a Server.
  • Click on Managed As.
FIX: “WinRM cannot complete the operation”
  • Re-new the credentials
  • Refresh Windows Admin Center
  • Do this for each server.

Summary

If you run into another solution, can you indicate it in the comments?

Do you have any feedback or other ideas? Then you can leave a comment as well.

The complete error messages should someone Google on another part of the error messages:

Connection Error.

Connecting to remote server failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.

Connection Error.

Connecting to remote server failed with the following error message : WinRM cannot process the request. The following error with error code 0x8009030e occurred while using Negotiate authentication: A specified logon session does not exist. It may already have been terminated.

 This can occur if the provided credentials are not valid on the target server, or if the server identity could not be verified. If you trust the server identity, add the server name to the TrustedHosts list, and then retry the request. Use winrm.cmd to view or edit the TrustedHosts list. Note that computers in the TrustedHosts list might not be authenticated. For more information about how to edit the TrustedHosts list, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.

Bas Wijdenes

My name is Bas Wijdenes and I work as a PowerShell DevOps Engineer. In my spare time I write about interesting stuff that I encounter during my work.
View all posts by Bas Wijdenes

Столкнулся с нетривиальным поведением всех служб удалённого управления внутри домена. Однажды без видимых причин Windows Admic Center потерял доступ ко всем удалённым машинам в домене и начал сыпать ошибкой:

Сбой подключения к удаленному серверу name.domainname. Сообщение об ошибке: WinRM не удается выполнить операцию Убедитесь, что имя компьютера указано правильно, компьютер доступен по сети, а в брандмауэре задано исключение для службы WinRM, которое разрешает доступ к этому компьютеру. По умолчанию исключение брандмауэра для WinRM для общедоступных профилей ограничивает доступ к удаленным компьютерам в той же локальной подсети. Подробности см. в разделе справки «about_Remote_Troubleshooting».

При этом, при попытке пробросить удалённый Powershell в некоторые машины проброс проходит, в иные сыпет ошибками, типа:

Enter-PSSession : Сбой подключения к удаленному серверу name.domainname. Сообщение об ошибке: Access is
denied. Подробности см. в разделе справки "about_Remote_Troubleshooting".
строка:1 знак:1
+ Enter-PSSession name.domainname
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (name.domainname:String) [Enter-PSSession], PSRemotingTr
   ansportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Доходит до абсурда: есть два полностью идентичных по железу сервера, введённых в эксплуатацию одновременно, имеют на борту одну и ту же редакцию Windows Server Core установленную с одного и того же источника, воткнуты в соседние порты свитча, один доступен, второй нет.

Для того, чтобы избежать неверной настройки на хостах, в систему была закинута групповая политика, созданная по подобию этой: https://support.auvik.com/hc/en-us/articles/204424… с парой нюансов (не слушается ipv6, отложенный запуск службы WinRM вместо сиюминутного).

Правила были раскатаны по gpupate /force. Проверка winrm listener отдаёт вполне живые параметры:

winrm e winrm/config/listener
Listener [Source="GPO"]
    Address = *
    Transport = HTTP
    Port = 5985
    Hostname
    Enabled = true
    URLPrefix = wsman
    CertificateThumbprint
    ListeningOn = 127.0.0.1, %все другие локальные айпишники%

Можно было бы грешить на файрволлы, но я пробовал открывать всё, безуспешно:

Get-NetFirewallRule -DisplayName "Windows Remote Management*"


Name                          : WINRM-HTTP-In-TCP
DisplayName                   : Windows Remote Management (HTTP-In)
Description                   : Inbound rule for Windows Remote Management via WS-Management. [TCP 5985]
DisplayGroup                  : Windows Remote Management
Group                         : @FirewallAPI.dll,-30267
Enabled                       : True
Profile                       : Domain, Private
Platform                      : {}
Direction                     : Inbound
Action                        : Allow
EdgeTraversalPolicy           : Block
LooseSourceMapping            : False
LocalOnlyMapping              : False
Owner                         :
PrimaryStatus                 : OK
Status                        : The rule was parsed successfully from the store. (65536)
EnforcementStatus             : NotApplicable
PolicyStoreSource             : PersistentStore
PolicyStoreSourceType         : Local
RemoteDynamicKeywordAddresses : {}

Name                          : WINRM-HTTP-Compat-In-TCP
DisplayName                   : Windows Remote Management - Compatibility Mode (HTTP-In)
Description                   : Compatibility mode inbound rule for Windows Remote Management via WS-Management. [TCP 80]
DisplayGroup                  : Windows Remote Management (Compatibility)
Group                         : @FirewallAPI.dll,-30252
Enabled                       : False
Profile                       : Any
Platform                      : {}
Direction                     : Inbound
Action                        : Allow
EdgeTraversalPolicy           : Block
LooseSourceMapping            : False
LocalOnlyMapping              : False
Owner                         :
PrimaryStatus                 : OK
Status                        : The rule was parsed successfully from the store. (65536)
EnforcementStatus             : NotApplicable
PolicyStoreSource             : PersistentStore
PolicyStoreSourceType         : Local
RemoteDynamicKeywordAddresses : {}

Name                          : WINRM-HTTP-In-TCP-PUBLIC
DisplayName                   : Windows Remote Management (HTTP-In)
Description                   : Inbound rule for Windows Remote Management via WS-Management. [TCP 5985]
DisplayGroup                  : Windows Remote Management
Group                         : @FirewallAPI.dll,-30267
Enabled                       : True
Profile                       : Public
Platform                      : {}
Direction                     : Inbound
Action                        : Allow
EdgeTraversalPolicy           : Block
LooseSourceMapping            : False
LocalOnlyMapping              : False
Owner                         :
PrimaryStatus                 : OK
Status                        : The rule was parsed successfully from the store. (65536)
EnforcementStatus             : NotApplicable
PolicyStoreSource             : PersistentStore
PolicyStoreSourceType         : Local
RemoteDynamicKeywordAddresses : {}

Интернет пестрит идеями сделать winrm quickconnect на удалённых машинах, что не играет никакой роли, так как применена групповая политика, или обязательно либо разрешать прослушку ipv6 адресов, либо полностью их отключать на удалённой сетевой карте (пробовал оба варианта, безуспешно).

Оснастки MMC ведут себя диаметрально наоборот: они успешно подключаются к хостам, но добрая половина вкладок выбрасывает Access Denied, после чего процесс полностью зависает.

Единственным рабочим костылём оказывается установка Google Chrome на Windows Server Core и управление сервером из локального браузера, но это просто дичь, которую не хочется делать локальным стандартом.

ЧЯДНТ? Я уже извелся весь.

I am in the process of migrating file server from Windows Server 2012 R2 to Windows Server 2019. Previously I used Robocopy for this purpose. Windows storage migration is a neat extension provided by Windows Admin Center. I tested in my lab and works great. However, there are few requirements – Windows Management Framework 5.1, allow through the firewall, Enable PsRemoting

The issue I ran was when adding Windows Server 2012 R2. I allowed through the firewall, WRM service was running. PSRemoting was enabled. The error I was getting while trying to add the server in the WAC as well as when trying to initiate Enter-PSsession -computername w2k12r2server.
“WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet”.

Resolution:
Netsh http show iplist

IP addresses present in the IP listen list:
-------------------------------------------

127.0.0.1
::1

On the working server, the list was empty. I had to delete both the address from list using:

netsh http delete iplisten ipaddress=127.0.0.1
netsh http delete iplisten ipaddress=::1

After removing the above address, I was able to add the Windows Server 2012 R2 to the WAC and also I was able to PSremote to the server.

При настройке WinRM на серверах в домене Active Directory столкнулся со странной проблемой. После того как служба WinRM была настроена и включена на сервере, к ней разрешено удалённое подключение через Windows PowerShell Remoting, при попытке удаленного подключения к данному серверу с помощью команды
Enter-PSSession msk-dp01
в консоли PowerShell появляется следующая ошибка WinRM:

Enter-PSSession : Сбой подключения к удаленному серверу msk-dp01. Сообщение об ошибке: Клиенту WinRM не удается обработать запрос. Невозможно определить тип содержимого ответа HTTP от компьютера назначения. Тип содержимого не является допустимым или отсутствует. Подробности см. в разделе справки «about_Remote_Troubleshooting».

строка:1 знак:1

+ Enter-PSSession msk-dp01

+ ~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: (msk-dp01:String) [Enter-PSSession], PSRemotingTransportException

+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Enter-PSSession : Сбой подключения к удаленному серверу msk-dp01. Сообщение об ошибке: Клиенту WinRM не удается обработать запрос. Невозможно определить тип содержимого ответа HTTP от компьютера назначения. Тип содержимого не является допустимым или отсутствует.

В английской версии Windows ошибка выглядит так:

PS C:\Windows\system32> Enter-PSSession msk-dp01

Enter-PSSession : Connecting to remote server msk-dp01 failed with the following error message : The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure. For more information, see the about_Remote_Troubleshooting Help topic.

At line:1 char:1

+ Enter-PSSession msk-dp01

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: (msk-dp01:String) [Enter-PSSession], PSRemotingTransportException

+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

The WinRM client received an HTTP bad request status (400),

При этом на сервере порты WinRm (5985/HTTP, 5986/HTTPS) отвечают и принимают соединения. Проверить доступность TCP портов WinRM можно с помощью утилиты PortQryV2 или командлета PowerShell Test-NetConnection:

TNC msk-dp01 –port 5985

Test-NetConnection WinRm (5985/HTTP, 5986/HTTPS)

Как оказалось, проблема оказалась связана с большим размером токена Kerberos у пользователя, за счет того, что пользователь состоит в слишком большом количестве доменных групп. Ошибка возникает при превышении размера токена 16 Кб (см статью MaxTokenSize — размер токена Kerberos). В нашей ситуации происходит все тоже самое, сервер WinRm сбрасывает запрос от клиента, т.к. размер заголовка пакета аутентификации превышает 16 Кб. В статье по ссылке мы упоминали, что по-умолчанию в IIS используется размер HTTP заголовка не более 16 Кб, и в случае проблем с HTTP аутентификацией из за большого токена пользователя, его нужно увеличить до 64 Кб

Чтобы исправить проблему, нужно уменьшить размер токена (уменьшить количество групп безопасности, в которых состоит пользователь), а если это невозможно, тогда в редакторе реестра на сервере нужно изменить значение следующих DWORD параметров реестра в ветке HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters

  • MaxFieldLength увеличить до 0000ffff (65535)
  • MaxRequestBytes увеличить до 0000ffff (65535)

HTTP MaxRequestBytes

Осталось перезагрузить сервер и проверить подключение WinRm через Enter-PSSession с клиента.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Печать xps windows 10
  • Нужно ли включать все ядра процессора на windows 10
  • Windows mobile based devices
  • Mail ru диск для windows
  • Кнопка пуск для windows 10 аниме