.GlobalPreferences Configurations -fnState

iamYaje
New Contributor III

I've been working on creation of a .mobileconfig to sign and upload as Configuration Profile in order to manage a few settings that I typically manage with a script.

One in particular is the <key>com.apple.keyboard.fnState</key> that is in .GlobalPreferences. This is a boolean key that either toggles the Keyboard > Keyboard Shortcuts > Function Keys setting on or off:

Screenshot 2024-01-29 at 9.15.51 PM.png

(this makes it easier to send a particular few Apple Scripts via Remote Desktop in the classroom). This is a setting that I easily can set with a defaults write script, which works well. Still, I'm using this as a gateway to try to figure out how to better manage some other settings that may be useful in configuring classrooms.

There are many settings that I've been able to configure by uploading custom XML, and many others that I haven't had success with. Now, I'm attempting to use the older mcxtoprofile python script by timsutton. In the README, I started to learn more about use of "always" vs "often" and "once" in management terms. I'm not clear on whether these temporal settings are still relevant in modern profiles, though. I'd love if anyone could shed some more light on this subject.

The current .mobileconfig I'm attempting to deploy is here. I gathered this by using mcxtoprofile, and edited out most of what wasn't needed using BBEdit:

 

<?xml version="1.0" encoding="UTF-8"?>
<!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>.GlobalPreferences</key>
				<dict>
					<key>Set-Once</key>
					<array>
						<dict>
							<key>mcx_data_timestamp</key>
							<date>2024-01-30T03:05:48Z</date>
							<key>mcx_preference_settings</key>
							<dict>
								<key>WebAutomaticSpellingCorrectionEnabled</key>
								<false/>
								<key>com.apple.keyboard.fnState</key>
								<true/>
							</dict>
						</dict>
					</array>
				</dict>
			</dict>
			<key>PayloadIdentifier</key>
			<string>MCXToProfile.f8b35819-30e1-4aa4-a8e5-ca1bc980b721.alacarte.customsettings.c30669c3-99fc-453f-8ca8-79f2cfce3fd2</string>
			<key>PayloadType</key>
			<string>com.apple.ManagedClient.preferences</string>
			<key>PayloadUUID</key>
			<string>c30669c3-99fc-453f-8ca8-79f2cfce3fd2</string>
			<key>PayloadVersion</key>
			<integer>1</integer>
		</dict>
	</array>
	<key>PayloadDescription</key>
	<string>Included custom settings:
.GlobalPreferences
</string>
	<key>PayloadDisplayName</key>
	<string>[LC All Computers] fnState Managed</string>
	<key>PayloadIdentifier</key>
	<string>[LC All Computers] fnState Managed</string>
	<key>PayloadOrganization</key>
	<string></string>
	<key>PayloadRemovalDisallowed</key>
	<true/>
	<key>PayloadScope</key>
	<string>System</string>
	<key>PayloadType</key>
	<string>Configuration</string>
	<key>PayloadUUID</key>
	<string>f8b35819-30e1-4aa4-a8e5-ca1bc980b721</string>
	<key>PayloadVersion</key>
	<integer>1</integer>
</dict>
</plist>

 

This has been unsuccessful at managing the fnState setting. When I review the Profile I installed in System Settings, it shows mcx settings with fnState correctly set to true or 1: 

 

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> 
<dict> 
<key>WebAutomaticSpellingCorrectionEnabled</key> 
<false/> 
<key>com.apple.keyboard.fnState</key> 
<true/> 
</dict> 
</plist>

 

Yet when I run a defaults read, it's this: defaults read .globalpreferences com.apple.keyboard.fnState 0

 

defaults read .globalpreferences com.apple.keyboard.fnState 0

 

and when I open the actual .globalpreferences file in /Users/username/Library/Preferences, it shows: 

 

<key>com.apple.keyboard.fnState</key> <false/>

 

I've tried both "forced" and "Set-Once" (the plist shared above). No dice.

Ultimately I'm also concerned that the issue could be that I do not have an "MDM Enabled User" - given that I cannot set a standard user account to be MDM enabled, only an admin account. And that's not the current setup. It's hard to test for so many variables and I'm getting worn out on it. 

I feel like I'm closer to understanding the limitations and how to get around this sort of setting battle with Apple's OS when it is possible. Any information is helpful. Hopefully others will find this helpful to.

0 REPLIES 0