How to list Network Interface UUIDS? I'm trying really hard to find a simple way to fetch all network UUIDS on my Mac to be able to do some plist magic.

Is there a command to do such a thing?

If I look in the plist I'll find for an instance "Service Order"

   ServiceOrder = Array {
         2AF2313D-AB7E-4FE7-91C3-XXXXXXXXXXXX
         9B976E4D-F7BE-428D-88C2-YYYYYYYYYYYY
         9A26C39B-8BD4-4562-9E0A-ZZZZZZZZZZZZ


But is there a simpler way than just writing a long script deleting the parts before and after?

All computers running Yosemite.

Final Script - Thanks to @Asmus for providing answers to get this working

#!/bin/sh
# Setting value on "SetUDIDSets" to define the "Sets" name as this will be different on each computer
SetUDIDSets=$(/usr/libexec/PlistBuddy -c "print :Sets" /Library/Preferences/SystemConfiguration/preferences.plist | perl -lne 'print $1 if /^    (\S*) =/')

IFS=$'\n'
    # Loops through the list of network services and sets Exclude Simple Hostnames to 1.
    for i in $(/usr/libexec/PlistBuddy -c "print :Sets:$SetUDIDSets:Network:Global:IPv4:ServiceOrder" /Library/Preferences/SystemConfiguration/preferences.plist | awk 'NR&gt;2{ print l} {l=$0}' | perl -pe 's/^\s+//');
    do

# If the setting Exclude Simple Hostnames never has been touched we need to create this
    sudo /usr/libexec/PlistBuddy -c "add :NetworkServices:$i:Proxies:ExcludeSimpleHostnames integer 1" /Library/Preferences/SystemConfiguration/preferences.plist
    sudo /usr/libexec/PlistBuddy -c "set :NetworkServices:$i:Proxies:ExcludeSimpleHostnames 1" /Library/Preferences/SystemConfiguration/preferences.plist

    echo "Exclude Simple Hostnames is now set for $i" 

    done

unset IFS
defaults read /Library/Preferences/SystemConfiguration/preferences.plist
echo "We're done!"
First of all, to get the UUIDs of your network sets, use PlistBuddy and perl:

 /usr/libexec/PlistBuddy -c "print :Sets" /Library/Preferences/SystemConfiguration/preferences.plist | perl -lne 'print $1 if /^    (\S*) =/'


this should return the IDs of the network sets. For each set you can then get the name with

/usr/libexec/PlistBuddy -c "print :Sets:698F419D-326E-45E3-8BE2-B0742334DD62:UserDefinedName" /Library/Preferences/SystemConfiguration/preferences.plist 


where, of course, you have to change the UUID accordingly.
Now, you can print the ServiceOrder with:

/usr/libexec/PlistBuddy -c "print :Sets:698F419D-326E-45E3-8BE2-B0742334DD62:Network:Global:IPv4:ServiceOrder" /Library/Preferences/SystemConfiguration/preferences.plist


If you want to read the value for "ExcludeSimpleHostnames", you should be able to use 

/usr/libexec/PlistBuddy -c "print :NetworkServices:69F7441B-BA1E-4DC3-B7DA-8D6302986F20:Proxies:ExcludeSimpleHostnames" /Library/Preferences/SystemConfiguration/preferences.plist 


while of course replacing this UUID with a valid one from the "ServiceOrder".

Update:

don't miss that you can set values with PlistBuddy, too:

/usr/libexec/PlistBuddy -c "Set :NetworkServices:$serviceid:Proxies:ExcludeSimpleHostnames 1" /Library/Preferences/SystemConfiguration/preferences.plist