The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Identifying IIS, svchost.exe

mikeb5
Kilo Contributor

Discovery is finding Internet Information Services (IIS) by looking for a running process called "svchost.exe" with a command line parameter "iissvcs".

Unfortunately, we're not finding a lot of IIS instances as the command line parameter is not displayed when we do a WMI query. It's shown on some servers, but not others!

Has anyone else seen this?

Is there an alternative way of reliably identifying IIS?

Examples:

PS C:\vb> gwmi win32_process -comp xxxxxxx |?{$_.name -match "svchost"} | select name,commandline

name                                                                                                                                                     commandline                                                                                                                                  

----                                                                                                                                                     -----------                                                                                                                                  

  1. svchost.exe                                                                                                                                                                                                                                                                                                
  2. svchost.exe                                                                                                                                                                                                                                                                                                
  3. svchost.exe                                                                                                                                                                                                                                                                                                
  4. svchost.exe                                                                                                                                                                                                                                                                                                
  5. svchost.exe                                                                                                                                                                                                                                                                                                
  6. svchost.exe                                                                                                                                                                                                                                                                                                
  7. svchost.exe                                                                                                                                                                                                                                                                                                
  8. svchost.exe                                                                                                                                                                                                                                                                                                
  9. svchost.exe                                                                                                                                                                                                                                                                                                
  10. svchost.exe                                                                                                                                                                                                                                                                                                
  11. svchost.exe                                                                                                                                                                                                                                                                                                
  12. svchost.exe                                                                                                                                                                                                                                                                                                
  13. svchost.exe                                                                                                                                                                                                                                                                                                
  14. svchost.exe                                                                                                                                                                                                                                                                                                
  15. svchost.exe                                                                                                                                                                                                                                                                                                

_________________________________________________________________________________________________________________________________________________________

PS C:\vb> gwmi win32_process -comp yyyyyyyyy |?{$_.name -match "svchost"} | select name,commandline

name                                                                                                                                                     commandline                                                                                                                                  

----                                                                                                                                                     -----------                                                                                                                                  

  1. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k DcomLaunch                                                              
  2. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k RPCSS                                                                        
  3. svchost.exe                                                                                                                                       C:\Windows\System32\svchost.exe -k LocalServiceNetworkRestricted                        
  4. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k netsvcs                                                                    
  5. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k LocalService                                                          
  6. svchost.exe                                                                                                                                       C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted                          
  7. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k NetworkService                                                      
  8. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k LocalServiceNoNetwork                                        
  9. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k apphost                                                                    
  10. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k regsvc                                                                      
  11. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k iissvcs                                                                    
  12. svchost.exe                                                                                                                                       C:\Windows\System32\svchost.exe -k WerSvcGroup                                                            
  13. svchost.exe                                                                                                                                       C:\Windows\System32\svchost.exe -k termsvcs                                                                  
  14. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k NetworkServiceNetworkRestricted                    
  15. svchost.exe                                                                                                                                       C:\Windows\system32\svchost.exe -k LocalServiceAndNoImpersonation                      
13 REPLIES 13

Ryan Zulli
ServiceNow Employee
ServiceNow Employee

Hi Mike,



What are the differences between the two machines?   OS Version / IIS Version...etc.



Thanks,


-Ryan


Deepak Ingale1
Mega Sage

Hi Mike,



One possibility is that, you might not have rights to fire WMI queries on certain servers.



You can also try quering by powershell commands...like



get-service | Sort-Object DisplayName


And check if IIS service is running or not...


mikeb5
Kilo Contributor

They're both Windows 2008 R2 Standard.



The one that doesn't work has IIS 7.5.7600.16385


The one that works has IIS 7.5.7600.16385



I don't think it can be a IIS issue. We don't see the command line parameters for any of the SVCHOST.EXE processes that are running. We can see the command line for other processes. So the issue is probably with SVCHOST.EXE.



I have the rights to do the queries. As well as using the ServiceNow discovery account, I'm using my own Windows account which is in the Administrator group on each server.



I normally do these queries remotely, but I also logged on with RDP and made sure UAC elevation was in place so I was truly Administrator. Still get the same result.