Artículo
01/31/2024
11 colaboradores
Comentarios
En este artículo
Espacio de nombres: microsoft.graph
Nota: la API de Microsoft Graph para Intune requiere una licencia activa de Intune para el espacio empresarial.
Actualice las propiedades de un objeto windowsInformationProtectionAppLockerFile .
Esta API está disponible en las siguientes implementaciones nacionales de nube .
Servicio global
Gobierno de EE. UU. L4
Us Government L5 (DOD)
China operada por 21Vianet
✅
✅
✅
✅
Permisos
Se requiere uno de los siguientes permisos para llamar a esta API. Para obtener más información, incluido cómo elegir permisos, vea Permisos .
Tipo de permiso
Permisos (de menos a más privilegiados)
Delegado (cuenta profesional o educativa)
DeviceManagementApps.ReadWrite.All
Delegado (cuenta personal de Microsoft)
No admitida.
Aplicación
DeviceManagementApps.ReadWrite.All
Solicitud HTTP
PATCH /deviceAppManagement/windowsInformationProtectionPolicies/{windowsInformationProtectionPolicyId}/exemptAppLockerFiles/{windowsInformationProtectionAppLockerFileId}
PATCH /deviceAppManagement/windowsInformationProtectionPolicies/{windowsInformationProtectionPolicyId}/protectedAppLockerFiles/{windowsInformationProtectionAppLockerFileId}
PATCH /deviceAppManagement/mdmWindowsInformationProtectionPolicies/{mdmWindowsInformationProtectionPolicyId}/exemptAppLockerFiles/{windowsInformationProtectionAppLockerFileId}
PATCH /deviceAppManagement/mdmWindowsInformationProtectionPolicies/{mdmWindowsInformationProtectionPolicyId}/protectedAppLockerFiles/{windowsInformationProtectionAppLockerFileId}
Cuerpo de la solicitud
En el cuerpo de la solicitud, especifique una representación JSON del objeto windowsInformationProtectionAppLockerFile .
En la tabla siguiente se muestran las propiedades necesarias para crear el objeto windowsInformationProtectionAppLockerFile .
Propiedad
Tipo
Descripción
displayName
String
El nombre descriptivo
fileHash
String
Hash del archivo SHA256
file
Binario
Archivo como una matriz de bytes
id
Cadena
Clave de la entidad.
version
Cadena
Versión de la entidad.
Respuesta
Si se ejecuta correctamente, este método devuelve un código de respuesta 200 OK
y un objeto windowsInformationProtectionAppLockerFile actualizado en el cuerpo de la respuesta.
Ejemplo
Solicitud
Aquí tiene un ejemplo de la solicitud.
PATCH https://graph.microsoft.com/v1.0/deviceAppManagement/windowsInformationProtectionPolicies/{windowsInformationProtectionPolicyId}/exemptAppLockerFiles/{windowsInformationProtectionAppLockerFileId}
Content-type: application/json
Content-length: 211
{
"@odata.type": "#microsoft.graph.windowsInformationProtectionAppLockerFile",
"displayName": "Display Name value",
"fileHash": "File Hash value",
"file": "ZmlsZQ==",
"version": "Version value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new WindowsInformationProtectionAppLockerFile
{
OdataType = "#microsoft.graph.windowsInformationProtectionAppLockerFile",
DisplayName = "Display Name value",
FileHash = "File Hash value",
File = Convert.FromBase64String("ZmlsZQ=="),
Version = "Version value",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.WindowsInformationProtectionPolicies["{windowsInformationProtectionPolicy-id}"].ExemptAppLockerFiles["{windowsInformationProtectionAppLockerFile-id}"].PatchAsync(requestBody);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-app-management windows-information-protection-policies exempt-app-locker-files patch --windows-information-protection-policy-id {windowsInformationProtectionPolicy-id} --windows-information-protection-app-locker-file-id {windowsInformationProtectionAppLockerFile-id} --body '{\
"@odata.type": "#microsoft.graph.windowsInformationProtectionAppLockerFile",\
"displayName": "Display Name value",\
"fileHash": "File Hash value",\
"file": "ZmlsZQ==",\
"version": "Version value"\
}\
'
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewWindowsInformationProtectionAppLockerFile()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
fileHash := "File Hash value"
requestBody.SetFileHash(&fileHash)
file := []byte("zmlsZQ==")
requestBody.SetFile(&file)
version := "Version value"
requestBody.SetVersion(&version)
exemptAppLockerFiles, err := graphClient.DeviceAppManagement().WindowsInformationProtectionPolicies().ByWindowsInformationProtectionPolicyId("windowsInformationProtectionPolicy-id").ExemptAppLockerFiles().ByWindowsInformationProtectionAppLockerFileId("windowsInformationProtectionAppLockerFile-id").Patch(context.Background(), requestBody, nil)
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
WindowsInformationProtectionAppLockerFile windowsInformationProtectionAppLockerFile = new WindowsInformationProtectionAppLockerFile();
windowsInformationProtectionAppLockerFile.setOdataType("#microsoft.graph.windowsInformationProtectionAppLockerFile");
windowsInformationProtectionAppLockerFile.setDisplayName("Display Name value");
windowsInformationProtectionAppLockerFile.setFileHash("File Hash value");
byte[] file = Base64.getDecoder().decode("ZmlsZQ==");
windowsInformationProtectionAppLockerFile.setFile(file);
windowsInformationProtectionAppLockerFile.setVersion("Version value");
WindowsInformationProtectionAppLockerFile result = graphClient.deviceAppManagement().windowsInformationProtectionPolicies().byWindowsInformationProtectionPolicyId("{windowsInformationProtectionPolicy-id}").exemptAppLockerFiles().byWindowsInformationProtectionAppLockerFileId("{windowsInformationProtectionAppLockerFile-id}").patch(windowsInformationProtectionAppLockerFile);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const windowsInformationProtectionAppLockerFile = {
'@odata.type': '#microsoft.graph.windowsInformationProtectionAppLockerFile',
displayName: 'Display Name value',
fileHash: 'File Hash value',
file: 'ZmlsZQ==',
version: 'Version value'
};
await client.api('/deviceAppManagement/windowsInformationProtectionPolicies/{windowsInformationProtectionPolicyId}/exemptAppLockerFiles/{windowsInformationProtectionAppLockerFileId}')
.update(windowsInformationProtectionAppLockerFile);
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionAppLockerFile;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WindowsInformationProtectionAppLockerFile();
$requestBody->setOdataType('#microsoft.graph.windowsInformationProtectionAppLockerFile');
$requestBody->setDisplayName('Display Name value');
$requestBody->setFileHash('File Hash value');
$requestBody->setFile(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('ZmlsZQ==')));
$requestBody->setVersion('Version value');
$result = $graphServiceClient->deviceAppManagement()->windowsInformationProtectionPolicies()->byWindowsInformationProtectionPolicyId('windowsInformationProtectionPolicy-id')->exemptAppLockerFiles()->byWindowsInformationProtectionAppLockerFileId('windowsInformationProtectionAppLockerFile-id')->patch($requestBody)->wait();
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.windowsInformationProtectionAppLockerFile"
displayName = "Display Name value"
fileHash = "File Hash value"
file = [System.Text.Encoding]::ASCII.GetBytes("ZmlsZQ==")
version = "Version value"
}
Update-MgDeviceAppManagementWindowsInformationProtectionPolicyExemptAppLockerFile -WindowsInformationProtectionPolicyId $windowsInformationProtectionPolicyId -WindowsInformationProtectionAppLockerFileId $windowsInformationProtectionAppLockerFileId -BodyParameter $params
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
from msgraph import GraphServiceClient
from msgraph.generated.models.windows_information_protection_app_locker_file import WindowsInformationProtectionAppLockerFile
graph_client = GraphServiceClient(credentials, scopes)
request_body = WindowsInformationProtectionAppLockerFile(
odata_type = "#microsoft.graph.windowsInformationProtectionAppLockerFile",
display_name = "Display Name value",
file_hash = "File Hash value",
file = base64.urlsafe_b64decode("ZmlsZQ=="),
version = "Version value",
)
result = await graph_client.device_app_management.windows_information_protection_policies.by_windows_information_protection_policy_id('windowsInformationProtectionPolicy-id').exempt_app_locker_files.by_windows_information_protection_app_locker_file_id('windowsInformationProtectionAppLockerFile-id').patch(request_body)
Para obtener más información sobre cómo agregar el SDK al proyecto y crear una instancia de authProvider , consulte la documentación del SDK .
Respuesta
Aquí tiene un ejemplo de la respuesta. Nota: Es posible que el objeto de respuesta que aparezca aquí esté truncado para abreviar. Todas las propiedades se devolverán desde una llamada real.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 260
{
"@odata.type": "#microsoft.graph.windowsInformationProtectionAppLockerFile",
"displayName": "Display Name value",
"fileHash": "File Hash value",
"file": "ZmlsZQ==",
"id": "d81f0e40-0e40-d81f-400e-1fd8400e1fd8",
"version": "Version value"
}