Extension Attribute to find a plist/ini version info for the JunosPulse.app

RyanN
New Contributor

I am looking for a way (extension Attribute) to determine the version of Junos Pulse.app that is installed on client machines. The app has a .ini flie in the apps contents/resources folder that I'm looking to query clients to identify installed versions. Does anyone have an extension attribute that I can use to find if the specific version used of the Junos Pulse app?

1 ACCEPTED SOLUTION

waqas
New Contributor III

Here's what i used to grab the exact version of the pulse client. Unfortunately, I don't know the sed command enough to shave off the text before the '=' sign but this definitely did the job for me to make the EA and scope my update Pulse policy.

#!/bin/bash

################################
# Check Junos Pulse version
################################

JunosPulseVersion=`grep -o "DisplayVer.*" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini`
echo "<result> $JunosPulseVersion </result>"

exit 0

View solution in original post

17 REPLIES 17

waqas
New Contributor III

Here's what i used to grab the exact version of the pulse client. Unfortunately, I don't know the sed command enough to shave off the text before the '=' sign but this definitely did the job for me to make the EA and scope my update Pulse policy.

#!/bin/bash

################################
# Check Junos Pulse version
################################

JunosPulseVersion=`grep -o "DisplayVer.*" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini`
echo "<result> $JunosPulseVersion </result>"

exit 0

RyanN
New Contributor

Thanks waqas.s.khan that worked perfectly for what I was looking to capture. Thanks for the help.

jhbush
Valued Contributor II

@newporr I would have it return a value if you are using it for an extension attribute.

#!/bin/bash

################################
# Check Junos Pulse version
################################

if [ -d /Applications/Junos Pulse.app ]; then

RESULT=`grep -o "DisplayVer.*" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | cut -d'=' -f2`

    echo "<result>$RESULT</result>"

else

    echo "<result>Not Installed</result>"

fi

waqas
New Contributor III

Even better.

Thanks Jason

nkalister
Valued Contributor

Has anyone taken a stab at updating this extension attribute since the release of pulse secure? That's the new version, after Junos spun Pulse off into its own company.
The JunosPulseVersion.ini now contains information for both Junos Pulse and Pulse Secure, so the exta returns 2 versions now.
Here's how the ini file looks now:

[Junos Pulse]
DisplayVersion=5.1.1.52267
DisplayName=Junos Pulse
[Pulse Secure]
DisplayVersion=5.1.1.52267
DisplayName=Pulse Secure

nkalister
Valued Contributor

this works, but it embarrasses me.

RESULT=`grep -A 1 -o "Pulse Secure" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | grep -v "Pulse Secure" | cut -d'=' -f2 | grep '[0-9]'  -m1`
echo "<result>$RESULT</result>"

else

    echo "<result>Not Installed</result>"

fi

emily
Valued Contributor III
Valued Contributor III

Maybe this?

#!/bin/bash

################################
# Check Junos Pulse version
################################

if [ -d /Applications/Junos Pulse.app ]; then

VERSION=`grep -o "DisplayVer.*" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | cut -d'=' -f2`
RESULT=$(echo "${VERSION[@]}" | tr ' ' '
' | sort -u | tr '
' ' ')

    echo "<result>$RESULT</result>"

else

    echo "<result>Not Installed</result>"

fi

nkalister
Valued Contributor

slightly less embarrassing:

RESULT=`grep -A 1 -o "[Pulse Secure]" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | grep -v "[Pulse Secure]" | cut -d'=' -f2`
echo "<result>$RESULT</result>"
else
    echo "<result>Not Installed</result>"
fi

nkalister
Valued Contributor

@emilykausalik that's giving me a space at the end of the version string for some reason

emily
Valued Contributor III
Valued Contributor III

Yeah me too. I have to poke at it a bit. I just kind of cobbled it together :D

emily
Valued Contributor III
Valued Contributor III

Here we go, printf works a bit better and is a bit tidier:

#!/bin/bash

################################
# Check Junos Pulse version
################################

if [ -d /Applications/Junos Pulse.app ]; then

VERSION=`grep -o "DisplayVer.*" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | cut -d'=' -f2`
RESULT=($(printf "%s
" "${VERSION[@]}" | sort -u));

echo "<result>$RESULT</result>"

else

echo "<result>Not Installed</result>"

fi

nkalister
Valued Contributor

This'll work for both the old and new versions at once:

if [ -d /Applications/Junos Pulse.app ]; then
    jpRESULT=`grep -A1 "[Junos Pulse]" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | grep -v "[Junos Pulse]" | cut -d'=' -f2`
    psRESULT=`grep -A1 "[Pulse Secure]" /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini | grep -v "[Pulse Secure]" | cut -d'=' -f2`
    if [ "$psRESULT" == "" ];then
        echo "<result>$jpRESULT</result>"
    else
        echo "<result>$psRESULT</result>"
    fi
else
    echo "<result>Not Installed</result>"
fi

mm2270
Legendary Contributor III

I don't have any version of Junos installed, but based on the example .ini file, something like this should also work:

#!/bin/sh

echo "<result>$(awk -F= '/[Pulse Secure]/{getline; print $NF}' /Applications/Junos Pulse.app/Contents/Resources/JunosPulseVersion.ini)</result>"

bjones
New Contributor III

@nkalister @mm2270 Hey fellow JAMF family i have a question and am reaching out for help with this. Currently i am working to identify with an extension attribute and a smart group to be able to identify what version of Pulse Secure is running for both new and old version i.e Junos pulse.

I tried to use the extension attribute scripts above and which provided me with the version information to be pulled from the devices but when i create a smart group for example:

6e83f710e6c44ba088cc75eb6386439e

But i am not receiving any results to be able to run an update policy i created against. Can anyone see any issue with my process or a better way or script.

nkalister
Valued Contributor

check the version reported by your extension attribute from one of your computer records- is it in the same format as the one in your smart group criteria? e.g. X.X.X.XXX?

is that smart group the target for the deployment? or is that smart group the machines that are up to date?

bjones
New Contributor III

@nkalister When i look at the at what the extension attribute is i get this:
b60928daa0164e3c95c77289adf98be6

and it is the same format i am using in the smart group. Also the smart is going to show the machines that are on this version and then make them the exclusion for the policy i have ready to upgrade the application. The only issue i seem to have is the ability to single out those devices in some sort of fashion.

bjones
New Contributor III

Pinging on this issue i am running in to once more..
So when using various Extension attributes to determine the pulse version i have yet to get one that will pull the data needed to find the what is on a users system.
Some users including mine will give a result of not installed when it is. This all stems from an issue with the attribute not able to locate the application for Junos Pulse or Pulse Secure since the application changed names.

Has anyone run into this issue or shed some light on how to have an extension attribute that can verify if the system has one of the two app versions or both versions installed?