Office License Extension Attribute

rdodd
New Contributor

Found it. I am blind. Thanks for all your help!!

Attempting to use the following script to create an extension attribute.

 

https://github.com/pbowden-msft/ExtensionAttributes/blob/master/Office_License.sh

 

However it does not seem to work. I have tried setting the IFs to a variable and then pass that variable as the result. Still does not work.

 

if [ "$PERPETUALPRESENT" = "Yes" ] && [ "$O365ACTIVATIONS" ]; then
	result="$LICTYPE and Office 365 licenses detected"

elif [ "$PERPETUALPRESENT" = "Yes" ]; then
	result="$LICTYPE"
	
elif [ "$O365ACTIVATIONS" ]; then
	result="Office 365 activations: $O365ACTIVATIONS"
	
elif [ "$PERPETUALPRESENT" = "No" ] && [ ! "$O365ACTIVATIONS" ]; then
	result="No license"
fi

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

exit 0

 

The script works if ran manually in terminal. Any suggestions?

1 REPLY 1

YanW
Contributor III

copy the whole thing from the Office_License.sh

EA.png

Computer Management > Inventory Display

Inventory Display.png

In All Computers now has Office License column

Lic.png