Return the value for a url desktop link?

We are trying to return the values of a desktop url link, some PCs are pointing to an some are pointing to, the name of the desktop “shortcut” is the same “Server.url”. We need to target PCs that have the server1 url address differently than those that have the server2 url address. Looking for the relevance that will allow this differentiation. Thank you in advance!

You could try something like the following. My URL link is

Q: content of file "C:\Desktop\BigFix Support.url" as lowercase contains ""
A: True

Dammit Alan beat me to it:

Q: exists file "C:\Users\Bigfix\Desktop\Forums!.url"
A: True
T: 0.175 ms
I: singular boolean

Q: lines of file "C:\Users\Bigfix\Desktop\Forums!.url"
A: [{000214A0-0000-0000-C000-000000000046}]
A: Prop3=19,2
A: [InternetShortcut]
A: IDList=
T: 0.461 ms
I: plural file line

Q: exists line whose (it as string contains "") of file "C:\Users\Bigfix\Desktop\Forums!.url"
A: True
T: 0.420 ms
I: singular boolean

You can also get very very specific here:

Q: key "URL" of section "InternetShortcut" of file "C:\Desktop\BigFix Support.url" contains ""
A: True
1 Like

Thanks guys for the quick turnaround! These will work!

To turn this into relevance that would be TRUE on all machines that either have the wrong URL, or those that are missing the URL entirely, it would be this:

( not exists keys “URL” whose(it as lowercase contains ) of sections “InternetShortcut” of files “C:\Desktop\BigFix Support.url” )

You can even go further and not actually know or care what the file is called, only that it exists:

not exists keys “URL” whose(it as lowercase contains ) of sections “InternetShortcut” of files whose(name of it as lowercase ends with “.url”) of folder “C:\Desktop”

I prefer to not take the approach of just fixing machines that have the wrong URL, but also addressing machines that never had it in the first place. Then you use targeting / groups to only address the machines that need it, or you can use it to address all machines. This can also be placed in a baseline along with many other fixlets/tasks to establish consistency, but without needing to worry about which machines have it or which don’t or which have it set incorrectly… just deal with them all as one, and thanks to relevance, only those that need the fix will get it.