次の方法で共有


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 には、次の 2 つの用途があります。

  1. MdmSession を開始する前に: アラートを作成し、アラート パラメーターをカスタマイズします。
  2. MdmSession を開始した後: アラートのサーバーから返された状態など、アラートの結果をセッションに照会します。

注: 汎用アラート (1226) が最も一般的です。

コンストラクター

MdmAlert()

カスタム データ フィールドを含む MDM アラート。

プロパティ

Data

サーバーに送信されるカスタム MDM データ。

Format

MDM アラートのデータ形式。

Mark

アラートの優先度または重要度。

Source

アラートのソースへのローカル URI パス。

Status

アラートに応答してサーバーによって送信される読み取り専用の状態コード。

Target

アプリケーションのインベントリの場所へのローカル URI パス。

Type

アラートの種類。 これはアラート ID でもあります。

適用対象