MdmAlert Класс

Определение

Предоставляет функциональные возможности для настройки данных, отправляемых на сервер управления мобильными устройствами.

public ref class MdmAlert sealed
/// [Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class MdmAlert final
/// [Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class MdmAlert final
[Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class MdmAlert
[Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class MdmAlert
function MdmAlert()
Public NotInheritable Class MdmAlert
Наследование
Object Platform::Object IInspectable MdmAlert
Атрибуты

Требования к Windows

Семейство устройств
Windows 10 Creators Update (появилось в 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (появилось в v4.0)

Примеры

void MultipleMdmAlerts()
{
    Log::Comment(WEX::Common::String().Format(L"Attempt to start syncing with two Alerts..."));
    Log::Comment(WEX::Common::String().Format(L"Fill in all members of first alert."));

    Windows::Management::MdmAlert myAlert;

    // This format is mandated by the OMA-DM standards for alerts.
    myAlert.Type(L"Reversed-Domain-Name:org.domain.samplealert");
    myAlert.Format(Windows::Management::MdmAlertDataType::String);
    myAlert.Data(L"alert-specific content.");
    myAlert.Mark(Windows::Management::MdmAlertMark::Critical);

    // Source and Target URIs are relative to the device, and typically in the MDM namespace.
    // Here, they indicate that an app was installed at "InstallSample", and the resulting
    // inventory location of the app is at "Results".
    myAlert.Source(L"./Vendor/MSFT/AppManagement/InstallSample");
    myAlert.Target(L"./Vendor/MSFT/AppManagement/Results");

    Windows::Management::MdmAlert myAlertNext;
    myAlertNext.Type(L"Reversed-Domain-Name:org.domain.nextalert");

    std::vector<Windows::Management::MdmAlert> alertList;

    alertList.push_back(myAlert);
    alertList.push_back(myAlertNext);
}
void MultipleMdmAlerts() 
{
    Log::Comment(WEX::Common::String().Format(L"Attempt to start syncing with two Alerts..."));
    Log::Comment(WEX::Common::String().Format(L"Fill in all members of first alert."));

    Windows::Management::MdmAlert^ myAlert = ref new Windows::Management::MdmAlert();

    // This format is mandated by the OMA-DM standards for alerts.
    myAlert->Type = ref new Platform::String(L"Reversed-Domain-Name:org.domain.samplealert");
    myAlert->Format = Windows::Management::MdmAlertDataType::String;
    myAlert->Data = ref new Platform::String(L"alert-specific content.");
    myAlert->Mark = Windows::Management::MdmAlertMark::Critical;

    // Source and Target URIs are relative to the device and typically in the MDM namespace.
    // Here, they indicate that an app was installed at "InstallSample" and the resulting
    // inventory location of the app is at "Results".
    myAlert->Source = ref new Platform::String(L"./Vendor/MSFT/AppManagement/InstallSample");
    myAlert->Target = ref new Platform::String(L"./Vendor/MSFT/AppManagement/Results");

    Windows::Management::MdmAlert^ myAlertNext = ref new Windows::Management::MdmAlert();
    myAlertNext->Type = ref new Platform::String(L"Reversed-Domain-Name:org.domain.nextalert");

    Windows::Foundation::Collections::IVector<MdmAlert^>^ alertList = ref new Platform::Collections::Vector<MdmAlert^>();

    alertList->Append(myAlert);
    alertList->Append(myAlertNext);
}

Комментарии

MdmAlert используется двумя способами:

  1. Перед запуском MdmSession: создайте оповещение и настройте его параметры.
  2. После запуска MdmSession: запросите в сеансе результаты оповещения, включая состояние, отправленное сервером для оповещения.

Примечание. Универсальное оповещение (1226) является наиболее распространенным.

Конструкторы

MdmAlert()

Оповещение MDM с настраиваемыми полями данных.

Свойства

Data

Пользовательские данные MDM, отправляемые на сервер.

Format

Формат данных оповещения MDM.

Mark

Приоритет или критичность оповещения.

Source

Локальный URI-путь к источнику оповещения.

Status

Код состояния только для чтения, отправленный сервером в ответ на оповещение.

Target

Локальный URI-путь к расположению инвентаризации приложения.

Type

Тип оповещения. Это также идентификатор оповещения.

Применяется к