IIS Relevance

(imported topic written by SystemAdmin)

Greetings all,

How can I target machines that have IIS installed? I want to be able to remove this component. Thank you

(imported comment written by BenKus)

How about:

exists service “w3svc”

or maybe:

exists metabase

Ben

(imported comment written by jr6591)

This is telling us if IIS is active. What about what version of IIS? I know by default IIS is determined by the OS but there can be upgrades. Alternatively, I can check the asp.dll but maybe there’s a better way.

(imported comment written by jr6591)

I’ve tried a few things but I’m basically tried to put a service and a file in one query. I’m trying to find if a service exists then dump the version of the file.

Here are some attempts but I can’t seem to put them in one query. The caveat is that the folder can be either \winnt\system32\inetsrv or Windows\System32\inetsrv. Also, I only want to check this on Windows 2000 Servers or Windows 2003 Servers.

Q: if (exists folder “C:\Winnt\System32\inetsrv” whose (exists file “asp.dll” of it )) then (version of file “asp.dll” of folder “C:\Winnt\System32\inetsrv”) as string else if (exists folder “C:\Windows\System32\inetsrv” whose ( exists file “asp.dll” of it )) then (version of file “asp.dll” of folder “C:\Windows\System32\inetsrv”) as string else “Not Installed”

A: 6.0.3790.2684

Q: if (exists service “w3svc”) then state of service “w3svc” else “Not Installed”

A: Running

Q: if (exists file “C:\Winnt\System32\inetsrv\asp.dll”) then version of file “C:\Winnt\System32\inetsrv\asp.dll” as string else “Not Installed”

A: Not Installed

Q: versions of files ((it & “\Winnt\System32\inetsrv\asp.dll”) of (names of drives whose (type of it = “DRIVE_FIXED”) ))

Q: versions of files ((it & “\Windows\System32\inetsrv\asp.dll”) of (names of drives whose (type of it = “DRIVE_FIXED”) ))

A: 6.0.3790.2684

Q: exists file “asp.dll” of folders of system folder

A: True

Q: if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\INetStp” of registry AND exists value “VersionString” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\INetStp” of registry) then (value “VersionString” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\INetStp” of registry as string) else (“IIS Not Installed”)

A: Version 6.0

(imported comment written by jessewk)

I don’t have an IIS machine to test with, but I’ll take a stab.

if ((name of operating system = “Win2000” OR name of operating system = “Win2003”) AND exists service “w3svc”) then (version of it as string & " - " & state of service “w3svc” as string) of files “asp.dll” of folders “inetsrv” of system folder else nothings

Should return:

A: 6.0.3790.2684 - Running