Windows Server Discovery failed due to NON standard dynamic port usedIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Even though all the required ports '135 (WMI), 5985 (WINRM), and dynamic ports for windows 49152-65535 for both TCP and UDP are opened (as per servicenow documentation) between MID server and the target windows server, the windows discovery failes to authenticate with target server and following errors can be seen in discovery logs; Windows discovery fails at classification phase, in 'WMI: Classify' input ecc queue you will notice following kind or error message; <results error="Adding target to blacklist. No valid credential found for type [Windows]" probe_time="43871" result_code="42"><result error="Adding target to blacklist. No valid credential found for type [Windows]"><debug_info>{"debug_info":[{"x.x.x.x":{"credentials_attempted":[{"credential_type":"Windows","credential_name":"xxxxxx1","credential_order":"100","credential_success":false,"credential_id":"7ddc2d018716b150f0d933370cbb35da"},{"credential_type":"Windows","credential_name":"xxxxxx2","credential_order":"99999","credential_success":false,"credential_id":"79f04ffc87b121100cd94157cebb35e9"}],"adding_key_to_target_blacklist":true,"connection_parameters":{"credential_types":["Windows"],"target":"x.x.x.x"}}}]}</debug_info></result> Following error also can be seen in mid server agent debug logs; 3035f6ba-411b-4709-a1c6-cd519329b6bf: + CategoryInfo : PermissionDenied: (:) [New-CimSession], CimException2023-11-13 06:57:03 DEBUG (PowerConsole-9a38d0241beafd10f57f5605464bcbab>stderr) [PowerConsoleStreamGobblerErr:73] STDERR 3035f6ba-411b-4709-a1c6-cd519329b6bf: + FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand2023-11-13 06:57:03 DEBUG (PowerConsole-9a38d0241beafd10f57f5605464bcbab>stderr) [PowerConsoleStreamGobblerErr:73] STDERR 3035f6ba-411b-4709-a1c6-cd519329b6bf: + PSComputerName : X.X.X.XYou may observed if your firewall team opens some different (anything else from the default range of dynamic ports 49152-65535 for) then discovery works fine For example with below ports opened for 3 different servers discovery works fine: - Server IP1 uses port 11954- Server IP2 uses port 32259- Server IP3 uses port 24158 Servicenow documentation for discovery ports requirement: https://docs.servicenow.com/bundle/vancouver-it-operations-management/page/product/discovery/reference/r_DiscoveryPortsAndProtocols.htmlRelease<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ANY Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Cause 1: FullyQualifiedErrorId : HRESULT 0x80070005 Windows server needs to be installed with latest patches https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1123774 Cause 2:Dynamic ports might have customised for below 3 servers - Server IP1 uses port 11954- Server IP2 uses port 32259- Server IP3 uses port 24158 If dynamic ports are OOB, then it should look like below; Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Solution for cause - 1: Makes sure, target windows server and windows MID servers are installed with latest Microsoft patches https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1123774 Solution for cause - 2: If you have customised the dynamic port range on target server you can verify that using below commands in command promt on target server;netsh int ipv4 show dynamicport tcpnetsh int ipv4 show dynamicport udpYou may change dynamic port range by below command or you may ask the custom port range to be opened in firewall to your firewall team from MID server to the target servernetsh int ipv4 set dynamicport tcp start=<number> num=<number>netsh int ipv4 set dynamicport udp start=<number> num=<number>Refer below Microsoft document for dynamic port range information:https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/default-dynamic-port-range-tcpip-chang Solution 3 (If above solutions did not help): You may also check by running below commands in powershell with admin rights on the MID server and depending on the error you get in output refer below KB articles for further troubleshooting; gwmi win32_operatingsystem -computer <target windows server ip address> -credential 'LOCALDOMAIN\mid'gwmi win32_operatingsystem -computer <target windows server ip address> -credential 'domain\username' WMI, PowerShell, and Windows Firewallshttps://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0549828MID Server - Troubleshooting WMI/Powershell issues and credentialshttps://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0549834Windows Discovery - Troubleshooting WMI/Powershell issues on the remote machinehttps://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0549830