DynamicManagement 云解决方案提供商DynamicManagement CSP

Windows 10 允许你根据位置、网络或时间以不同方式管理设备。Windows 10 allows you to manage devices differently depending on location, network, or time. 在 Windows 10 版本 1703 中,焦点在组织表达的最常见关注方面。In Windows 10, version 1703 the focus is on the most common areas of concern expressed by organizations. 例如,在工作地点时,可以禁用所托管设备的摄像头;在国外时,可以禁用手机网络服务以避免漫游费用;当设备不在公司大楼或园区内时,可以禁用无线网络。For example, managed devices can have cameras disabled when at a work location, the cellular service can be disabled when outside the country to avoid roaming charges, or the wireless network can be disabled when the device is not within the corporate building or campus. 配置后,即使当位置或网络发生更改时设备无法访问管理服务器,也将强制进行这些设置。Once configured, these settings will be enforced even if the device can’t reach the management server when the location or network changes. 通过动态管理 CSP,可以配置更改设备管理方式的策略,还可以设置更改条件。The Dynamic Management CSP enables configuration of policies that change how the device is managed in addition to setting the conditions on which the change occurs.

此 CSP 已添加到 Windows 10 版本 1703 中。This CSP was added in Windows 10, version 1703.

下面以树格式显示 DynamicManagement 配置服务提供程序。The following shows the DynamicManagement configuration service provider in tree format.

./Device/Vendor/MSFT
DynamicManagement
----NotificationsEnabled
----ActiveList
----Contexts
--------ContextID
------------SignalDefinition
------------SettingsPack
------------SettingsPackResponse
------------ContextStatus
------------Altitude
----AlertsEnabled

DynamicManagementDynamicManagement

DynamicManagement 配置服务提供程序的根节点。The root node for the DynamicManagement configuration service provider.

NotificationsEnabledNotificationsEnabled

用于向用户发送上下文更改通知的布尔值。Boolean value for sending notification to the user of a context change.

默认值为 False。Default value is False. 支持的操作包括 Get 和 Replace。Supported operations are Get and Replace.

打开 NotificationsEnabled 的示例:Example to turn on NotificationsEnabled:

<Replace>
      <CmdID>100</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/NotificationsEnabled</LocURI>
        </Target>
        <Meta>
          <Type xmlns="syncml:metinf">text/plain</Type>
          <Format xmlns="syncml:metinf">bool</Format>
        </Meta>
          <Data>true</Data>        
      </Item>
</Replace>

ActiveListActiveList

包含设备上所有活动 ContextID 的列表的字符串。A string containing the list of all active ContextIDs on the device. Delimeter 是 unicode 字符0xF000。Delimeter is unicode character 0xF000..

支持的操作为 Get。Supported operation is Get.

上下文Contexts

上下文信息的节点。Node for context information.

支持的操作为 Get。Supported operation is Get.

ContextIDContextID

服务器创建的用于定义上下文的节点。Node created by the server to define a context. 允许的最大字符数为 38。Maximum number of characters allowed is 38.

支持的操作包括添加、获取和删除。Supported operations are Add, Get, and Delete.

SignalDefinitionSignalDefinition

信号定义 XML。Signal Definition XML.

值类型为字符串。Value type is string. 支持的操作包括添加、获取、删除和替换。Supported operations are Add, Get, Delete, and Replace.

SettingsPackSettingsPack

Context 处于活动状态时应用的设置。Settings that get applied when the Context is active.

值类型为字符串。Value type is string. 支持的操作包括添加、获取、删除和替换。Supported operations are Add, Get, Delete, and Replace.

SettingsPackResponseSettingsPackResponse

应用包含每个单独操作信息的设置包的响应。Response from applying a Settings Pack that contains information on each individual action.

值类型为字符串。Value type is string. 支持的操作为 Get。Supported operation is Get.

ContextStatusContextStatus

报告上下文的状态。Reports status of the context. 如果失败,应检查 SettingsPackResponse,了解具体失败原因。If there was a failure, SettingsPackResponse should be checked for what exactly failed.

值类型为整数。Value type is integer. 支持的操作为 Get。Supported operation is Get.

AltitudeAltitude

一个值,用于确定如何处理在设备上应用多个上下文的冲突解决。A value that determines how to handle conflict resolution of applying multiple contexts on the device. 这是必需的,并且必须不同于其他优先级。This is required and must be distinct of other priorities.

值类型为整数。Value type is integer. 支持的操作包括添加、获取、删除和替换。Supported operations are Add, Get, Delete, and Replace.

AlertsEnabledAlertsEnabled

一个布尔值,用于当上下文失败时向服务器发送通知。A Boolean value for sending an alert to the server when a context fails.

支持的操作包括 Get 和 Replace。Supported operations are Get and Replace.

示例Examples

基于地理位置和时间禁用 Cortana(从上午 9 点到下午 5 点),当位于指定纬度/经度 100 米半径内时Disable Cortana based on Geo location and time, From 9am-5pm, when in the 100-meters radius of the specified latitude/longitude

    <Replace>
      <CmdID>200</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/Bldg109/SettingsPack</LocURI>
        </Target>
        <Meta>
          <Type xmlns="syncml:metinf">text/plain</Type>
          <Format xmlns="syncml:metinf">chr</Format>
        </Meta>
        <Data><SyncML>
  <SyncBody><Replace><CmdID>1001</CmdID><Item><Target><LocURI>./Vendor/MSFT/Policy/Config/Experience/AllowCortana</LocURI></Target><Meta><Format xmlns="syncml:metinf">int</Format></Meta><Data>0</Data></Item></Replace><Final/></SyncBody></SyncML></Data>
      </Item>
    </Replace>
    <Replace>
      <CmdID>201</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/Bldg109/SignalDefinition</LocURI>
        </Target>
        <Meta>
          <Type xmlns="syncml:metinf">text/plain</Type>
          <Format xmlns="syncml:metinf">chr</Format>
        </Meta>
        <Data>
          <rule schemaVersion="1.0">
          
           <and>
                    <signal type="geoloc" latitude="47.6375" longitude="-122.1402" radiusInMeters="100"/>        
                    <signal type="time">
                              <daily startTime="09:00:00" endTime="17:00:00"/>
                    </signal>           
           </and>
          </rule>
        </Data>
      </Item>
    </Replace>
    <Replace>
      <CmdID>202</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/Bldg109/Altitude</LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">int</Format>
        </Meta>
        <Data>3</Data>
      </Item>
    </Replace>

当 ip4 网关为 192.168.0.1 时,使用具有时间触发器的网络触发器禁用相机(从 9 到 5)Disable camera using network trigger with time trigger, from 9-5, when ip4 gateway is 192.168.0.1

<Replace>
      <CmdID>300</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime/SettingsPack</LocURI>
        </Target>
        <Meta>
          <Type xmlns="syncml:metinf">text/plain</Type>
          <Format xmlns="syncml:metinf">chr</Format>
        </Meta>
        <Data><SyncML>
  <SyncBody><Replace><CmdID>1002</CmdID><Item><Target><LocURI>./Vendor/MSFT/Policy/Config/Camera/AllowCamera</LocURI></Target><Meta><Format xmlns="syncml:metinf">int</Format></Meta><Data>0</Data></Item></Replace> <Final/></SyncBody></SyncML></Data>
      </Item>
    </Replace>
    <Replace>
      <CmdID>301</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime/SignalDefinition</LocURI>
        </Target>
        <Meta>
          <Type xmlns="syncml:metinf">text/plain</Type>
          <Format xmlns="syncml:metinf">chr</Format>
        </Meta>
        <Data>
          <rule schemaVersion="1.0">          
           <and>
             <signal type="ipConfig"> 
                   <ipv4Gateway>192.168.0.1</ipv4Gateway> 
             </signal> 
                    <signal type="time">
                              <daily startTime="09:00:00" endTime="17:00:00"/>
                    </signal>  
           </and>
          </rule>
        </Data>
      </Item>
    </Replace>
    <Replace>
      <CmdID>302</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime/Altitude</LocURI>
        </Target>
        <Meta>
          <Format xmlns="syncml:metinf">int</Format>
        </Meta>
        <Data>10</Data>
      </Item>
    </Replace>

删除上下文Delete a context

<Delete>
      <CmdID>400</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime</LocURI>
        </Target>
      </Item>
</Delete>

从特定上下文获取 ContextStatus 和 SignalDefinitionGet ContextStatus and SignalDefinition from a specific context

<Get>
      <CmdID>400</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime/ContextStatus</LocURI>
        </Target>
      </Item>
</Get>
<Get>
      <CmdID>401</CmdID>
      <Item>
        <Target>
          <LocURI>./Vendor/MSFT/DynamicManagement/Contexts/NetworkWithTime/SignalDefinition </LocURI>
        </Target>
      </Item>
</Get>