Windows Server discovery is failing with "Command [Remove-Module -Name PSReadLine] timed out after PT2M" in agent logsIssue When windows servers are discovered, it fails is classification phase leaving below errors in MID agent logs: 2021-10-27 01:46:06 (911) Worker-Standard:PowershellProbe-43f8bd84db677854ffaf9605e2961950 SEVERE *** ERROR *** Exception during executeCommand, keeping PowerConsole in busy statecom.snc.automation_common.integration.exceptions.CommandTimeoutException: Command [Remove-Module -Name PSReadLine] timed out after PT2Mat com.service_now.mid.win.powershell.api.PowerConsole.executeCurrentCommand(PowerConsole.java:256)at com.service_now.mid.win.powershell.api.PowerConsole.executeCommand(PowerConsole.java:202)at com.service_now.mid.win.powershell.api.PowerConsole.execute(PowerConsole.java:174)at com.service_now.mid.win.powershell.api.PowerConsole.init(PowerConsole.java:442)at com.service_now.mid.win.powershell.api.PowerConsole.<init>(PowerConsole.java:89)at com.service_now.mid.win.powershell.api.APowershellSession.<init>(APowershellSession.java:97)at com.service_now.mid.win.powershell.api.LocalPowerShellSession.<init>(LocalPowerShellSession.java:21)at com.service_now.mid.win.powershell.api.PowerShellConnectionFactory.getUnauthorizedConnection(PowerShellConnectionFactory.java:50)at com.service_now.mid.win.powershell.api.PowerShellConnectionFactory.getUnauthorizedConnection(PowerShellConnectionFactory.java:24)at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:152)at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:145)at com.snc.core_automation_common.util.AKeyedConnectionFactory.getConnection(AKeyedConnectionFactory.java:133)at com.service_now.mid.win.powershell.api.PowerShellConnectionPoolFactory.createConnection(PowerShellConnectionPoolFactory.java:50)at com.service_now.mid.win.powershell.api.PowerShellConnectionPoolFactory.createConnection(PowerShellConnectionPoolFactory.java:18)at com.snc.core_automation_common.util.AConnectionPoolFactory.create(AConnectionPoolFactory.java:27)at com.snc.core_automation_common.util.AConnectionPoolFactory.create(AConnectionPoolFactory.java:14)at org.apache.commons.pool2.BaseKeyedPooledObjectFactory.makeObject(BaseKeyedPooledObjectFactory.java:62)at org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:357)at com.snc.core_automation_common.util.AKeyedConnectionPool.borrowConnection(AKeyedConnectionPool.java:51)at com.service_now.mid.probe.AWmiFetchData.probe(AWmiFetchData.java:66)at com.service_now.mid.probe.AProbe.process(AProbe.java:102)at com.service_now.mid.queue_worker.AWorker.runWorker(AWorker.java:122)at com.service_now.mid.probe.PowershellProbe.runWorker(PowershellProbe.java:73)at com.service_now.mid.queue_worker.AWorkerThread.run(AWorkerThread.java:20)at com.service_now.mid.threadpool.ResourceUserQueue$RunnableProxy.run(ResourceUserQueue.java:649)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)ReleaseAll Versions.ResolutionFollow the below steps to resolve the issue: Navigate to mid server -> Properties, Add a new property: mid.powershell.remove_psreadline and set the value to false. Also, make sure the below: The reason for the error is because of the MID Sever or Powershell activities getting busy. Identify which scenario caused the host performance degradation. It is most likely one and can be easily checked by observing Task Manager during discovery and verifying that Security SW is pegging CPU. Security SW log will also confirm the same. -Configure Security Scan SW to not scan MID Server traffic or disable it altogether -Reduce the number of MID Servers on the same host - Reduce thread size and PowerShell session pool size