Hello JAMF Nation,
I am currently trying to configure Volume, VPN, & Battery to not only open but have certain defaults checked off as well.
For VPN wanted to have:
- Show Time Connected
- Show Status While Connected
For Battery:
- Show Percentage
What I have done in the past that used to work:
Have a custom settings payload with a plist that was converted to a mobile.config and then uploaded to JAMF reaching out to com.apple.systemuiserver that plist is the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.apple.systemuiserver</key>
<dict>
<key>Set-Once</key>
<array>
<dict>
<key>mcx_preference_settings</key>
<dict>
<key>NSStatusItem Visible Siri</key>
<false/>
<key>NSStatusItem Visible com.apple.menuextra.airplay</key>
<true/>
<key>NSStatusItem Visible com.apple.menuextra.volume</key>
<true/>
<key>NSStatusItem Visible com.apple.menuextra.vpn</key>
<true/>
<key>__NSEnableTSMDocumentWindowLevel</key>
<true/>
<key>menuExtras</key>
<array>
<string>/System/Library/CoreServices/Menu Extras/Battery.menu</string>
<string>/System/Library/CoreServices/Menu Extras/AirPort.menu</string>
<string>/System/Library/CoreServices/Menu Extras/Volume.menu</string>
<string>/System/Library/CoreServices/Menu Extras/Displays.menu</string>
<string>/System/Library/CoreServices/Menu Extras/VPN.menu</string>
</array>
</dict>
</dict>
</array>
</dict>
</dict>
<key>PayloadDisplayName</key>
<string>Custom: (com.apple.systemuiserver)</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>com.apple.mdm.macserver-imac.local.e619bbc0-3444-0136-d464-2c87a33a6849.alacarte.customsettings.04410560-3445-0136-d466-2c87a33a6849</string>
<key>PayloadType</key>
<string>com.apple.ManagedClient.preferences</string>
<key>PayloadUUID</key>
<string>04410560-3445-0136-d466-2c87a33a6849</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Add shortcuts to the menu bar</string>
<key>PayloadDisplayName</key>
<string>Settings for menubar_icons</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>com.apple.mdm.macserver-imac.local.e619bbc0-3444-0136-d464-2c87a33a6849.alacarte</string>
<key>PayloadOrganization</key>
<string>CompanyName</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>e619bbc0-3444-0136-d464-2c87a33a6849</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
This now is no longer working for my Enrollments on Mojave 10.14.6
What I am currently trying to do is create a profile solely dedicated to Menu Bar Items and through a one line command under Files & Processes Execute Command:
user=$(stat -f %Su /dev/console); sudo -u $user open "/System/Library/CoreServices/Menu Extras/vpn.menu" ; sudo -u $user open "/System/Library/CoreServices/Menu Extras/Volume.menu" ; sudo -u $user open "/System/Library/CoreServices/Menu Extras/Battery.menu"
Which opens the services just fine but writing to them possibly via a script has been quite challenging as nothing I have tried does the trick. I tried -booling it prior to opening the services but this did not work at all.
user=$(stat -f %Su /dev/console); sudo -u $user /usr/bin/defaults write com.apple.menuextra.vpn ShowTimeConnected -bool YES; sudo -u $user /usr/bin/defaults write com.apple.menuextra.vpn ShowStatusWhileConnecting -bool YES; sudo -u $user open "/System/Library/CoreServices/Menu Extras/vpn.menu" ; sudo -u $user open "/System/Library/CoreServices/Menu Extras/Volume.menu" ; sudo -u $user open "/System/Library/CoreServices/Menu Extras/Battery.menu"
Would anyone have any possible Ideas on how I can achieve this or a much cleaner way of getting it accomplished I would be grateful.
Thanks in Advance.
