I have been tasked with writing an analysis with the following information for some of our “Tools”
If the service exists
Version of the Service
I am using this in each analysis property, in most cases…
IF (exists service whose (service name of it as string as lowercase = "servicename")) THEN (state of it & " - " & version of it as string) of service whose (service name of it as string as lowercase = "servicename") ELSE "Not Installed"
This works perfect in most cases. Then some not mentioned vendor failed to put the version number in the service application. This generates the “Singular expression refers to nonexistent object” error. So for that vendor tool I just manually edited the relevance to say “Version Unavailable”.
The final challenge, some services have names that are different for each customer (We are an MSP). For example, the SNOW MID server service name is snc_mid_MSP_MidServer_ABC and the only piece of that name that exists on all customers is the snc_mid_. I can get the data if the service is running, even if it produces an error (Because there are more than one service name begining in snc_mid) but I can’t get the version number.
I got the data by using the “contains snc_mid” (Again, I manually entered the text “Version Unavailable”)
IF (exists service whose (service name of it as string as lowercase contains "snc_mid")) THEN (state of it & " - " & "Version Unavailable") of service whose (service name of it as string as lowercase contains "snc_mid") ELSE "Not Installed"
Two questions…
Is there a way I can use “if exists version then list it” instead of manually editing the relevance and only display the version if it exists?
Is there a way to pull the actual service name using the “contains” statement then getting the version of the service using the full name?