3 min read

ConfigMgr - The Client Settings Telepod (...queue ominous music...)

ConfigMgr - The Client Settings Telepod (...queue ominous music...)

So, this is a experimental script i have been working on a little bit.
As of today, MEMCM is missing the possibility to export client settings, but, most of the stuff in there have a Get and Set cmdlet, so we can actually make our own  by getting the data with Get, and writing it to an XML and then load the XML and use the set command to import (create a new Client Setting).

Unfortunately there are some settings, some data, that is not applicable with the set cmdlet as of now, and i haven´t found a way to translate from the get to set.

This has been developed in a lab with a client setting that has more or less every possible setting configured in some way, so i don't really now what happens if just a few things are configured etc, remember, its a work in progress and more of a concept than a finished thing.

The plan is to extend the logic and make better checks for each setting, so that eg. the import wont go trough them all if there isn't anything configured.

OBS This is not finished, and should be used with care and not in an production environment, if you do, its on your own risk.


The use is quite simple, just run the export and enter the data request and the export will gather all the information from configured settings, and write it in an XML.
After the export, you can edit the XML if you want to make some changes to the settings exported, and then save the document and import it.

Even though ConfigMgr doesn't have a function built in to Export and Import an Client Setting native, it does have a Get-CMClientSetting and Set-CMClientSetting for almost everything, and, if we can get the information, we can export it, and if there is a Set-CMClientSetting, we can use that exported information to import, create, and set client settings.

The script itself isn't really that complicated, its more of a time-consuming effort, and at some points it takes some head-scratching to figure out how you need to translate some of the exported data, to data that works with the Set-cmdlets for respective client setting, as Set doesn't always use the same value that a setting gives you with the Get.
You will notice the same thing if you start to do an export/import script for ADR's, but those are even worse..

Like this:

#WindowsAnalytics
    $ClientSettingWindowsAnalytics = Get-CMClientSetting -id $ClientSettingID -Setting "WindowsAnalytics"
        $WAEnable = $ClientSettingWindowsAnalytics.WAEnable
            switch ($WAEnable) {
                0 {$WAEnable = "False"}
                1 {$WAEnable = "True"}
            }

The Get cmdlet returns the values as "0" or "1", but the Set-cmdlet requries a boolean value, "true" or "false", so, we need to "translate" these values and write what Set wants, to the XML.

And then there are things like RemoteTools settings and firewall exception profiles

        $FirewallExceptionProfiles = $ClientSettingRemoteTool.FirewallExceptionProfiles
        switch ($FirewallExceptionProfiles) {
            8 {$FirewallExceptionProfiles = "Disabled"}
            9 {$FirewallExceptionProfiles = "Public"}
            10 {$FirewallExceptionProfiles = "Private"}
            11 {$FirewallExceptionProfiles = "Public,Private"}
            12 {$FirewallExceptionProfiles = "Domain"}
            13 {$FirewallExceptionProfiles = "Domain,Public"}
            14 {$FirewallExceptionProfiles = "Domain,Private"}
            15 {$FirewallExceptionProfiles = "Public,Private,Domain"}
        }

These things are just a time-consuming thing: change the setting, run Get, see what is returned, check what Set wants, translate.

The Export Script

EndpointManagement/MEMCM-TelepodExport.ps1 at master · Love-A/EndpointManagement
Endpoint Management stuff galore! Contribute to Love-A/EndpointManagement development by creating an account on GitHub.

The Import Script

EndpointManagement/MEMCM-TelepodImport.ps1 at master · Love-A/EndpointManagement
Endpoint Management stuff galore! Contribute to Love-A/EndpointManagement development by creating an account on GitHub.