Compartir a través de


MdmAlert Clase

Definición

Proporciona funcionalidad para configurar los datos enviados al servidor de administración de dispositivos móviles.

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
Herencia
Object Platform::Object IInspectable MdmAlert
Atributos

Requisitos de Windows

Familia de dispositivos
Windows 10 Creators Update (se introdujo en la versión 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (se introdujo en la versión v4.0)

Ejemplos

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);
}

Comentarios

Hay dos usos de MdmAlert:

  1. Antes de iniciar mdmSession: cree una alerta y personalice los parámetros de alerta.
  2. Después de iniciar mdmSession: consulte la sesión para obtener resultados de la alerta, incluido el estado enviado por el servidor para la alerta.

Nota: La alerta genérica (1226) es la más común.

Constructores

MdmAlert()

Una alerta MDM con campos de datos personalizados.

Propiedades

Data

Datos de MDM personalizados enviados al servidor.

Format

Formato de datos de la alerta MDM.

Mark

Prioridad o importancia de la alerta.

Source

Ruta de acceso del URI local al origen de la alerta.

Status

Código de estado de solo lectura enviado por el servidor en respuesta a la alerta.

Target

Ruta de acceso del URI local a la ubicación de inventario de la aplicación.

Type

Tipo de la alerta. También es el identificador de alerta.

Se aplica a