Analysis to return URL content

Hey everyone,

I’m trying to create an analysis to search the favorites folder for contents of a url. I tried something like this…if this isn’t possible I would like to try and something like the 2nd relevance and wildcard the username.

following text of first “=” of variable whose (it contains “URL”) of file “C:\Users*\Favorites*filename”

names of descendants of folder “C:\Users*\Favorites”

Thanks!

1 Like

The following relevance will give you all the files within the Favs folder for all users that end with .url

descendants whose(name of it as lowercase ends with ".url") of folders "Favorites" of folders of folders "C:\Users"

Then you just need to figure out what relevance is needed to operate on those files to get the actual URL:

unique values of following texts of firsts "URL=" of lines whose(it as uppercase starts with "URL=") of descendants whose(name of it as lowercase ends with ".url") of folders "Favorites" of folders of folders "C:\Users"

http://bigfix.me/relevance/details/3000009

Thanks! This should work, I can export the results to a csv and search for the specific url. Is there any way to output the url with the computer on each line?

Why would you need to output it to a CSV to search for a particular URL? You can put that in an analysis property and see all the results, or create an analysis property that checks for a particular URL, or you could query for a particular URL using session relevance anytime.

You mean add the computer name to the output? that isn’t nessisary if it is an analysis property since the computer name is already apart of the row.

Same if you want to query the results with session relevance, you can query it by computer and know it by computer name that way.


What are you trying to accomplish? are you checking for bad URLs? URLs that need updated? URLs that are missing that need included?

If I know what you are going for, then I can point you in the right direction for next steps.

As a caveat here, if we could remove one piece of relevance it would be “descendants”

Just be aware that descendants does a traversal that can be deep and take (if you’re not careful) hours for a client to complete if it doesn’t get interrupted.

1 Like

Yes, I agree with @AlanM … need to be very careful how descendants is used. If you only care about URLs in the root folder of “Favorites” then you don’t actually need to use descendants, but if you want the URLs returned from all subfolders of “Favorites” then you do need descendants.

This is what it would be without using descendants:

unique values of following texts of firsts "URL=" of lines whose(it as uppercase starts with "URL=") of files whose(name of it as lowercase ends with ".url") of folders "Favorites" of folders of folders "C:\Users"

We are trying to identify a bad url in our environment and either replace or delete the file.

If it is a known bad URL, then you could just use the following for the relevance for a task to replace/delete the file:

exists unique values whose(it as trimmed string as lowercase = "replace_with_known_bad_url") of following texts of firsts "URL=" of lines whose(it as uppercase starts with "URL=") of files whose(name of it as lowercase ends with ".url") of folders "Favorites" of folders of folders "C:\Users"

Any applicable computer would have a Favorite that points to “replace_with_known_bad_url”