Posted on 09-20-2018 12:14 PM
I like to automate "All The Things". In order to do that, certain pieces of data need to be collected so as to make informed, logical decisions.
Part of my NoMAD rollout requires me to streamline my deployment process. In order to do that, I need to know which machines have a certain version of NoMAD Login+ and NoMAD Pro so I can install and update/upgrade accordingly.
I have written 5 unique Jamf Extension Attributes that provide me with the details I need in order to create a fully automated deployment and update/upgrade lifecycle for NoMAD Login+ and NoMAD Pro.
Once the Jamf Extension Attributes are properly configured, each device record, upon inventory collection (ie Recon), will provide the following details:
These details can be scoped against within Smart Groups, Advanced Searches, etc.
Without further ado, I give you my extension attributes in XML format, so you can upload directly into your Jamf instance.
NoMAD Login Installation Status.xml
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>NoMAD Login Installation Status</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Jamf Extension Attribute to acquire NoMAD Login+ Installation Status
# NoMAD_Login_Installation_Status.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
/bin/echo "<result>True</result>"
else
/bin/echo "<result>False</result>"
fi
exit
</scriptContentsMac>
</extensionAttribute>
NoMAD Login Product Info.xml
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>NoMAD Login Product Info</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Login+ Product Info
# NoMAD_Login_Product_Info.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
productInfo=`/usr/bin/plutil -p /Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle/Contents/Info.plist | /usr/bin/grep -i "CFBundleExecutable" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$productInfo</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit
</scriptContentsMac>
</extensionAttribute>
NoMAD Login Version.xml
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>NoMAD Login Version</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Login+ Version
# NoMAD_Login_Version.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
version=`/usr/bin/plutil -p /Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle/Contents/Info.plist | /usr/bin/grep -i "CFBundleShortVersionString" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$version</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit
</scriptContentsMac>
</extensionAttribute>
NoMAD Pro Installation Status.xml
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>NoMAD Pro Installation Status</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Jamf Extension Attribute to acquire NoMAD Pro Installation Status
# NoMAD_Pro_Installation_Status.sh
# Written by Caine Hörr
# Written on 2018-06-04
if [ -e "/Applications/NoMAD Pro.app" ]; then
/bin/echo "<result>True</result>"
else
/bin/echo "<result>False</result>"
fi
exit
</scriptContentsMac>
</extensionAttribute>
NoMAD Pro Version.xml
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>NoMAD Pro Version</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Pro Version
# NoMAD_Pro_Version.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Applications/NoMAD Pro.app" ]; then
version=`/usr/bin/plutil -p /Applications/NoMAD Pro.app/Contents/Info.plist | /usr/bin/grep -i "CFBundleShortVersionString" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$version</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit</scriptContentsMac>
</extensionAttribute>
Enjoy!
For those who would just prefer the raw shell scripts without all the crazy Jamf Pro Extension Attribute xml markup, here you go...
NoMAD_Login_Installation_Status.sh
#!/bin/bash
# Jamf Extension Attribute to acquire NoMAD Login+ Installation Status
# NoMAD_Login_Installation_Status.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
/bin/echo "<result>True</result>"
else
/bin/echo "<result>False</result>"
fi
exit
NoMAD_Login_Product_Info.sh
#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Login+ Product Info
# NoMAD_Login_Product_Info.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
productInfo=`/usr/bin/plutil -p /Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle/Contents/Info.plist | /usr/bin/grep -i "CFBundleExecutable" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$productInfo</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit
NoMAD_Login_Version.sh
#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Login+ Version
# NoMAD_Login_Version.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle" ]; then
version=`/usr/bin/plutil -p /Library/Security/SecurityAgentPlugins/NoMADLoginOkta.bundle/Contents/Info.plist | /usr/bin/grep -i "CFBundleShortVersionString" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$version</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit
NoMAD_Pro_Installation_Status.sh
#!/bin/bash
# Jamf Extension Attribute to acquire NoMAD Pro Installation Status
# NoMAD_Pro_Installation_Status.sh
# Written by Caine Hörr
# Written on 2018-06-04
if [ -e "/Applications/NoMAD Pro.app" ]; then
/bin/echo "<result>True</result>"
else
/bin/echo "<result>False</result>"
fi
exit
NoMAD_Pro_Version.sh
#!/bin/bash
# Jamf Extension Attribute to aquire NoMAD Pro Version
# NoMAD_Pro_Version.sh
# Written by Caine Hörr
# Written on 2018-09-20
if [ -e "/Applications/NoMAD Pro.app" ]; then
version=`/usr/bin/plutil -p /Applications/NoMAD Pro.app/Contents/Info.plist | /usr/bin/grep -i "CFBundleShortVersionString" | /usr/bin/awk '{ print $3 }' | /usr/bin/tr -d '"'`
/bin/echo "<result>$version</result>"
else
/bin/echo "<result>N/A</result>"
fi
exit
Caine Hörr
A reboot a day keeps the admin away!
Posted on 09-20-2018 02:03 PM
Posted on 09-20-2018 02:31 PM
@cainehorr Thanks for sharing. Don't you already get NoMAD.app and NoMAD Pro.app versions from regular inventory collection? Apps with standard version info using CFBundleShortVersionString should be reported correctly to a device's applications list.
For NoMADLogin.bundle I wonder if adding /Library/Security/SecurityAgentPlugins/ to Computer Management > Inventory Collection > Plug-ins would pull information or if it only searches for things ending in certain file extensions.
Posted on 09-20-2018 03:36 PM
@nstrauss - You are correct regarding apps in /Applications...
My EA for NoMAD Pro is superfluous!
Caine Hörr
A reboot a day keeps the admin away!
Posted on 09-20-2018 03:38 PM
@nstrauss - I added /Library/Security/SecurityAgentPlugins/ to Jamf's inventory collection settings, ran a manage and a recon... nothing... So I'm guessing that Jamf is looking for the ".app" extension.
Caine Hörr
A reboot a day keeps the admin away!
Posted on 10-05-2018 11:54 AM
Thanks for these Caine!! Very helpful to keep track of the NoMAD components.
Cheers!
Posted on 01-04-2019 07:47 AM
Thanks for these Caine!
Posted on 01-04-2019 08:40 AM
Thought I'd add one I use which detects if Local/IDP Password has been synced.
With this, you can force a Nomad/JAMF Connect popup screen to have them signin / sync.
#!/bin/sh
currentUser=$(stat -f%Su /dev/console)
passwordExists=$(defaults read /Users/$currentUser/Library/Preferences/menu.nomad.NoMADPro.plist PasswordCurrent)
if [ "$passwordExists" = 1 ];then
echo "<result>Password Synced</result>"
else
echo "<result>Password not Synced</result>"
fi
Posted on 03-26-2019 12:03 PM
For NoMADLogin.bundle I wonder if adding /Library/Security/SecurityAgentPlugins/ to Computer Management > Inventory Collection > Plug-ins would pull information or if it only searches for things ending in certain file extensions.
I added /Library/Security/SecurityAgentPlugins/NoMADLoginAD.bundle as a plugin and my smart group is succesfully counting Plug-In Title.
Posted on 03-26-2019 08:06 PM
@cainehorr, @nstrauss How are you handling macOS point releases/major releases with NoLoAD and/or NoMAD installed? what does the Product Info
EA assist you with? Thanks!
Posted on 03-27-2019 08:09 AM
Unfortunately, we have pulled the plug on all things NoMAD. I have no further contributions to make at this time regarding this product.
Caine Hörr
A reboot a day keeps the admin away!
Posted on 03-27-2019 09:15 AM
@piagetblix That does work! Thank you.
With plug-in data available it's possible to make a smart group for reporting. Can then install the latest version on clients that need it.
Posted on 01-08-2020 01:28 PM
Sorry to Necropost but I want to amend @zachary.fisher 's EA above for Jamf Connect Sync.
#!/bin/bash
#### Extension Attribute To Check If Jamf Connect Sync Is Signed In
currentUser=$(stat -f%Su /dev/console)
SignedIn=$(defaults read /Users/$currentUser/Library/Preferences/com.jamf.connect.sync.plist PasswordCurrent)
if [ "$SignedIn" = 1 ];then
echo "<result>Password Synced</result>"
else
echo "<result>Password not Synced</result>"
fi
Posted on 03-08-2022 09:19 PM
HI @sdamiano ,
do you have to create a smart for it after adding this to the EA? is so, what criteria did you include in the smart group?