Exporting Managed Client data on macOS Golden Gate
On macOS, you can access and read which managed preference settings are currently being applied 2026-10-18 23:7:37 Author: derflounder.wordpress.com(查看原文) 阅读量:4 收藏

On macOS, you can access and read which managed preference settings are currently being applied to a particular Mac. This information is available in the following ways:

  1. Viewing the contents of the Managed Client section of System Information.app
  2. Using the system_profiler command line tool to view the SPManagedClientDataType data type’s data.

These managed preference settings are reported in the following way:

  • The preference domain
  • The setting’s key
  • The setting key’s value (as text)
  • Whether it applies to the computer or to a user
  • How often it is enforced.

Here’s an example of how the Managed Client section appears in the System Information app:

Here’s an example of the output from the system_profiler command line tool when displaying the SPManagedClientDataType data:


username@ZCDP1X75FT ~ % /usr/sbin/system_profiler SPManagedClientDataType
Managed Client:
com.apple.gamed:
GKFeatureGameCenterMultiplayerOtherPlayerTypesAllowed:
Value: 2
State: always
Source: com.apple.gamed (User)
PayloadUUID:
Value: 7BE22222-B233-4C44-9D55-000000000010
State: always
Source: com.apple.gamed (User)
com.apple.appstore:
RestrictPurchaseLimit:
Value: 1000
State: always
Source: com.apple.appstore (User)
PayloadUUID:
Value: 7BE22222-B233-4C44-9D55-000000000060
State: always
Source: com.apple.appstore (User)
com.apple.familycontrols.contentfilter:
PayloadUUID:
Value: 7BE22222-B233-4C44-9D55-000000000070
State: always
Source: com.apple.familycontrols.contentfilter (User)
limitWebProxies:
Value: 0
State: always
Source: com.apple.familycontrols.contentfilter (User)
com.apple.iTunes:
moviesLimit:
Value: 1000
State: always
Source: com.apple.iTunes (User)
restrictTVShows:
Value: 1
State: always
Source: com.apple.iTunes (User)
tvShowsLimit:
Value: 1000
State: always
Source: com.apple.iTunes (User)
restrictMovies:
Value: 1
State: always
Source: com.apple.iTunes (User)
PayloadUUID:
Value: 7BE22222-B233-4C44-9D55-000000000020
State: always
Source: com.apple.iTunes (User)
username@ZCDP1X75FT ~ %

It is possible to export this information using the system_profiler command line tool and work with the exported information. For more details, please see below the jump.

It is possible to use the system_profiler command line tool to export the SPManagedClientDataType data type’s data in either XML or JSON format. To display the data in XML format, you would use the following command:


/usr/sbin/system_profiler SPManagedClientDataType -xml

The output should look similar to this:


username@ZCDP1X75FT ~ % /usr/sbin/system_profiler SPManagedClientDataType -xml
<?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"&gt;
<plist version="1.0">
<array>
<dict>
<key>_SPCommandLineArguments</key>
<array>
<string>/usr/sbin/system_profiler</string>
<string>-nospawn</string>
<string>-xml</string>
<string>SPManagedClientDataType</string>
<string>-detailLevel</string>
<string>full</string>
</array>
<key>_SPCompletionInterval</key>
<real>0.025364995002746582</real>
<key>_SPResponseTime</key>
<real>0.041681051254272461</real>
<key>_dataType</key>
<string>SPManagedClientDataType</string>
<key>_detailLevel</key>
<integer>1</integer>
<key>_items</key>
<array>
<dict>
<key>_items</key>
<array>
<dict>
<key>_name</key>
<string>GKFeatureGameCenterMultiplayerOtherPlayerTypesAllowed</string>
<key>data_keyValue</key>
<string>2</string>
<key>data_source</key>
<string>com.apple.gamed (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>PayloadUUID</string>
<key>data_keyValue</key>
<string>7BE22222-B233-4C44-9D55-000000000010</string>
<key>data_source</key>
<string>com.apple.gamed (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
</array>
<key>_name</key>
<string>com.apple.gamed</string>
</dict>
<dict>
<key>_items</key>
<array>
<dict>
<key>_name</key>
<string>RestrictPurchaseLimit</string>
<key>data_keyValue</key>
<string>1000</string>
<key>data_source</key>
<string>com.apple.appstore (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>PayloadUUID</string>
<key>data_keyValue</key>
<string>7BE22222-B233-4C44-9D55-000000000060</string>
<key>data_source</key>
<string>com.apple.appstore (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
</array>
<key>_name</key>
<string>com.apple.appstore</string>
</dict>
<dict>
<key>_items</key>
<array>
<dict>
<key>_name</key>
<string>PayloadUUID</string>
<key>data_keyValue</key>
<string>7BE22222-B233-4C44-9D55-000000000070</string>
<key>data_source</key>
<string>com.apple.familycontrols.contentfilter (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>limitWebProxies</string>
<key>data_keyValue</key>
<string>0</string>
<key>data_source</key>
<string>com.apple.familycontrols.contentfilter (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
</array>
<key>_name</key>
<string>com.apple.familycontrols.contentfilter</string>
</dict>
<dict>
<key>_items</key>
<array>
<dict>
<key>_name</key>
<string>moviesLimit</string>
<key>data_keyValue</key>
<string>1000</string>
<key>data_source</key>
<string>com.apple.iTunes (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>restrictTVShows</string>
<key>data_keyValue</key>
<string>1</string>
<key>data_source</key>
<string>com.apple.iTunes (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>tvShowsLimit</string>
<key>data_keyValue</key>
<string>1000</string>
<key>data_source</key>
<string>com.apple.iTunes (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>restrictMovies</string>
<key>data_keyValue</key>
<string>1</string>
<key>data_source</key>
<string>com.apple.iTunes (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
<dict>
<key>_name</key>
<string>PayloadUUID</string>
<key>data_keyValue</key>
<string>7BE22222-B233-4C44-9D55-000000000020</string>
<key>data_source</key>
<string>com.apple.iTunes (User)</string>
<key>data_state</key>
<string>always</string>
</dict>
</array>
<key>_name</key>
<string>com.apple.iTunes</string>
</dict>
</array>
<key>_parentDataType</key>
<string>SPSoftwareDataType</string>
<key>_properties</key>
<dict>
<key>_name</key>
<dict>
<key>_isColumn</key>
<string>YES</string>
<key>_isOutlineColumn</key>
<string>YES</string>
<key>_order</key>
<string>10</string>
<key>_suppressLocalization</key>
<string>YES</string>
</dict>
<key>data_keyValue</key>
<dict>
<key>_isColumn</key>
<string>YES</string>
<key>_order</key>
<string>30</string>
<key>_suppressLocalization</key>
<string>YES</string>
</dict>
<key>data_source</key>
<dict>
<key>_order</key>
<string>50</string>
</dict>
<key>data_state</key>
<dict>
<key>_order</key>
<string>40</string>
</dict>
<key>volumes</key>
<dict>
<key>_detailLevel</key>
<string>0</string>
</dict>
</dict>
<key>_timeStamp</key>
<date>2026-10-18T19:12:53Z</date>
<key>_versionInfo</key>
<dict>
<key>com.apple.SPManagedClientReporter</key>
<string>1911.1.1</string>
</dict>
</dict>
</array>
</plist>
username@ZCDP1X75FT ~ %

If you want to export this data to a file, you can use a command similar to the one below:


/usr/sbin/system_profiler SPManagedClientDataType -xml > /path/to/filename_goes_here

The output should look similar to this:


username@ZCDP1X75FT ~ % /usr/sbin/system_profiler SPManagedClientDataType -xml > exported_settings.xml
username@ZCDP1X75FT ~ %

To display the data in JSON format, you would use the following command:


/usr/sbin/system_profiler SPManagedClientDataType -json

The output should look similar to this:


username@ZCDP1X75FT ~ % /usr/sbin/system_profiler SPManagedClientDataType -json
{
"SPManagedClientDataType" : [
{
"_items" : [
{
"_name" : "GKFeatureGameCenterMultiplayerOtherPlayerTypesAllowed",
"data_keyValue" : "2",
"data_source" : "com.apple.gamed (User)",
"data_state" : "always"
},
{
"_name" : "PayloadUUID",
"data_keyValue" : "7BE22222-B233-4C44-9D55-000000000010",
"data_source" : "com.apple.gamed (User)",
"data_state" : "always"
}
],
"_name" : "com.apple.gamed"
},
{
"_items" : [
{
"_name" : "RestrictPurchaseLimit",
"data_keyValue" : "1000",
"data_source" : "com.apple.appstore (User)",
"data_state" : "always"
},
{
"_name" : "PayloadUUID",
"data_keyValue" : "7BE22222-B233-4C44-9D55-000000000060",
"data_source" : "com.apple.appstore (User)",
"data_state" : "always"
}
],
"_name" : "com.apple.appstore"
},
{
"_items" : [
{
"_name" : "PayloadUUID",
"data_keyValue" : "7BE22222-B233-4C44-9D55-000000000070",
"data_source" : "com.apple.familycontrols.contentfilter (User)",
"data_state" : "always"
},
{
"_name" : "limitWebProxies",
"data_keyValue" : "0",
"data_source" : "com.apple.familycontrols.contentfilter (User)",
"data_state" : "always"
}
],
"_name" : "com.apple.familycontrols.contentfilter"
},
{
"_items" : [
{
"_name" : "moviesLimit",
"data_keyValue" : "1000",
"data_source" : "com.apple.iTunes (User)",
"data_state" : "always"
},
{
"_name" : "restrictTVShows",
"data_keyValue" : "1",
"data_source" : "com.apple.iTunes (User)",
"data_state" : "always"
},
{
"_name" : "tvShowsLimit",
"data_keyValue" : "1000",
"data_source" : "com.apple.iTunes (User)",
"data_state" : "always"
},
{
"_name" : "restrictMovies",
"data_keyValue" : "1",
"data_source" : "com.apple.iTunes (User)",
"data_state" : "always"
},
{
"_name" : "PayloadUUID",
"data_keyValue" : "7BE22222-B233-4C44-9D55-000000000020",
"data_source" : "com.apple.iTunes (User)",
"data_state" : "always"
}
],
"_name" : "com.apple.iTunes"
}
]
}
username@ZCDP1X75FT ~ %

If you want to export this data to a file, you can use a command similar to the one below:


/usr/sbin/system_profiler SPManagedClientDataType -json > /path/to/filename_goes_here

The output should look similar to this:


username@ZCDP1X75FT ~ % /usr/sbin/system_profiler SPManagedClientDataType -json > exported_settings.json
username@ZCDP1X75FT ~ %

Having this data can be useful to Mac admins who need to figure out what managed settings are being applied to a particular Mac, but who are in a situation where they don’t have access or visibility into what’s providing those management settings. One thing I decided to do with it was to try reconstructing configuration profiles being deployed to a particular Mac. This is because the Managed Client settings should have everything we need to reconstruct most profiles, with two caveats:

  1. This is going to be a best-effort reconstruction using the available Managed Client settings data.
  2. If the actual profile includes other information which isn’t included in the available Managed Client settings information, the resulting reconstruction will not include that information.

With these two caveats, I’ve developed a script named managed_client_profile_extractor.sh to create configuration profile files using the information available from the Managed Client settings. It’s available via the link below:

https://github.com/rtrouton/rtrouton_scripts/tree/main/rtrouton_scripts/managed_client_profile_extractor

For information about how to use this script, please see the README file available via the link above.

Note:

The configuration profile files produced by this script are reconstructions. They are not copies of the original profile(s) deployed to a Mac. There will be differences between the reconstructed profiles and the actual deployed profiles. For example:

  • The Managed Client settings data doesn’t include profile identifiers, UUIDs, display names or other payloads, so the script generates new ones.
  • The report stores every value as text and doesn’t record its type, so the script has to guess whether a value is a boolean, an integer, a decimal, a date or a string.

The reconstructed profiles are intended for reference use only. Do not use the reconstructed profile files for any other purpose, including for deployment to other Macs.

How it works:

The managed_client_profile_extractor.sh script reads a Managed Client report (SPManagedClientDataType) created by the system_profiler command line tool, either via creating that report file from the Mac it runs on or from a report file created previously on this Mac or another Mac. It then writes the settings in it back out as .mobileconfig configuration profiles, one per preference domain.

As noted earlier, this script will be making some guesses as part of its best effort reconstruction efforts with regards to turning text values into values for other data types  (boolean, integer, etc.) As part of this, the script will create a file named _recovery_report.txt, which contains information about the guesses it made with regards to data types.

Usage:

You can run this script with or without a pre-created report file.

Without report file:


/path/to/managed_client_profile_extractor.sh

With report file:


/path/to/managed_client_profile_extractor.sh /path/to/data_export_file_goes_here

Note:

If you run the script with no report file specified, it will create a report of the Managed Client settings of the Mac the script is running on and use that information.

Creating a report for the script to use:

If you want to create the report file and provide it to the script, you would run a command similar to the one below:


/usr/sbin/system_profiler SPManagedClientDataType -json > /path/to/data_export_file_goes_here

For example, if you wanted to create a report file named managed_client_report.json and store it on your Desktop, you would use the command shown below:


/usr/sbin/system_profiler SPManagedClientDataType -json > $HOME/Desktop/managed_client_report.json

If using the script without providing a report file, you should see output similar to this:


username@ZCDP1X75FT ~ % ./managed_client_profile_extractor.sh
Managed Client Report Configuration Profile Extractor
————————————–
No System Information exported data file was provided, so this script will
create configuration profiles from the management settings installed
on this computer.
To read a System Information report file instead, please provide the path to
the exported data file when you run this script:
/path/to/managed_client_profile_extractor.sh /path/to/data_export_file_goes_here
Reading management settings…
Created: com.apple.appstore-user.mobileconfig (1 setting(s))
Created: com.apple.familycontrols.contentfilter-user.mobileconfig (1 setting(s))
Created: com.apple.gamed-user.mobileconfig (1 setting(s))
Created: com.apple.iTunes-user.mobileconfig (4 setting(s))
————————————–
Profiles created: 4
Source: this computer (system_profiler)
Location: /tmp/spx_profiles_tT0Od9
————————————–
Notes:
– The report stores every value as text, so booleans, integers and
strings were inferred. See _recovery_report.txt in the output
directory for the settings of each type, and review before use.
– The profiles are unsigned reconstructions and may contain secrets
such as API keys and enrollment tokens. Handle them accordingly.
The configuration profiles are in this folder:
/tmp/spx_profiles_tT0Od9
username@ZCDP1X75FT ~ %

If using the script and providing a report file, you should see output similar to this:


username@ZCDP1X75FT ~ % ./managed_client_profile_extractor.sh managed_client_report.json
Managed Client Report Configuration Profile Extractor
————————————–
Reading management settings…
Created: com.apple.appstore-user.mobileconfig (1 setting(s))
Created: com.apple.familycontrols.contentfilter-user.mobileconfig (1 setting(s))
Created: com.apple.gamed-user.mobileconfig (1 setting(s))
Created: com.apple.iTunes-user.mobileconfig (4 setting(s))
————————————–
Profiles created: 4
Location: /tmp/spx_profiles_H1wxPF
————————————–
Notes:
– The report stores every value as text, so booleans, integers and
strings were inferred. See _recovery_report.txt in the output
directory for the settings of each type, and review before use.
– The profiles are unsigned reconstructions and may contain secrets
such as API keys and enrollment tokens. Handle them accordingly.
The configuration profiles are in this folder:
/tmp/spx_profiles_H1wxPF
username@ZCDP1X75FT ~ %

The _recovery_report.txt file’s contents should appear similar to this example:


Recovered configuration profile report
Types for the settings below were inferred from text and may need correcting.
Only settings whose value is not a plain string are listed, by type. Values
themselves are intentionally omitted from this report.
com.apple.appstore-user.mobileconfig (scope: User)
integer: RestrictPurchaseLimit
com.apple.familycontrols.contentfilter-user.mobileconfig (scope: User)
bool: limitWebProxies
com.apple.gamed-user.mobileconfig (scope: User)
integer: GKFeatureGameCenterMultiplayerOtherPlayerTypesAllowed
com.apple.iTunes-user.mobileconfig (scope: User)
bool: restrictMovies, restrictTVShows
integer: moviesLimit, tvShowsLimit

An example profile produced by this script should look similar to this:


文章来源: https://derflounder.wordpress.com/2026/10/18/exporting-managed-client-data-on-macos-golden-gate/
如有侵权请联系:admin#unsafe.sh