POST https://graph.microsoft.com/v1.0/deviceAppManagement/mdmWindowsInformationProtectionPolicies
Content-type: application/json
Content-length: 3905
{
"@odata.type": "#microsoft.graph.mdmWindowsInformationProtectionPolicy",
"displayName": "Display Name value",
"description": "Description value",
"version": "Version value",
"enforcementLevel": "encryptAndAuditOnly",
"enterpriseDomain": "Enterprise Domain value",
"enterpriseProtectedDomainNames": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"protectionUnderLockConfigRequired": true,
"dataRecoveryCertificate": {
"@odata.type": "microsoft.graph.windowsInformationProtectionDataRecoveryCertificate",
"subjectName": "Subject Name value",
"description": "Description value",
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00",
"certificate": "Y2VydGlmaWNhdGU="
},
"revokeOnUnenrollDisabled": true,
"rightsManagementServicesTemplateId": "abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab",
"azureRightsManagementServicesAllowed": true,
"iconsVisible": true,
"protectedApps": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionStoreApp",
"displayName": "Display Name value",
"description": "Description value",
"publisherName": "Publisher Name value",
"productName": "Product Name value",
"denied": true
}
],
"exemptApps": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionStoreApp",
"displayName": "Display Name value",
"description": "Description value",
"publisherName": "Publisher Name value",
"productName": "Product Name value",
"denied": true
}
],
"enterpriseNetworkDomainNames": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"enterpriseProxiedDomains": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionProxiedDomainCollection",
"displayName": "Display Name value",
"proxiedDomains": [
{
"@odata.type": "microsoft.graph.proxiedDomain",
"ipAddressOrFQDN": "Ip Address Or FQDN value",
"proxy": "Proxy value"
}
]
}
],
"enterpriseIPRanges": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionIPRangeCollection",
"displayName": "Display Name value",
"ranges": [
{
"@odata.type": "microsoft.graph.iPv6Range",
"lowerAddress": "Lower Address value",
"upperAddress": "Upper Address value"
}
]
}
],
"enterpriseIPRangesAreAuthoritative": true,
"enterpriseProxyServers": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"enterpriseInternalProxyServers": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"enterpriseProxyServersAreAuthoritative": true,
"neutralDomainResources": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"indexingEncryptedStoresOrItemsBlocked": true,
"smbAutoEncryptedFileExtensions": [
{
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",
"displayName": "Display Name value",
"resources": [
"Resources value"
]
}
],
"isAssigned": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MdmWindowsInformationProtectionPolicy
{
OdataType = "#microsoft.graph.mdmWindowsInformationProtectionPolicy",
DisplayName = "Display Name value",
Description = "Description value",
Version = "Version value",
EnforcementLevel = WindowsInformationProtectionEnforcementLevel.EncryptAndAuditOnly,
EnterpriseDomain = "Enterprise Domain value",
EnterpriseProtectedDomainNames = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
ProtectionUnderLockConfigRequired = true,
DataRecoveryCertificate = new WindowsInformationProtectionDataRecoveryCertificate
{
OdataType = "microsoft.graph.windowsInformationProtectionDataRecoveryCertificate",
SubjectName = "Subject Name value",
Description = "Description value",
ExpirationDateTime = DateTimeOffset.Parse("2016-12-31T23:57:57.2481234-08:00"),
Certificate = Convert.FromBase64String("Y2VydGlmaWNhdGU="),
},
RevokeOnUnenrollDisabled = true,
RightsManagementServicesTemplateId = Guid.Parse("abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab"),
AzureRightsManagementServicesAllowed = true,
IconsVisible = true,
ProtectedApps = new List<WindowsInformationProtectionApp>
{
new WindowsInformationProtectionStoreApp
{
OdataType = "microsoft.graph.windowsInformationProtectionStoreApp",
DisplayName = "Display Name value",
Description = "Description value",
PublisherName = "Publisher Name value",
ProductName = "Product Name value",
Denied = true,
},
},
ExemptApps = new List<WindowsInformationProtectionApp>
{
new WindowsInformationProtectionStoreApp
{
OdataType = "microsoft.graph.windowsInformationProtectionStoreApp",
DisplayName = "Display Name value",
Description = "Description value",
PublisherName = "Publisher Name value",
ProductName = "Product Name value",
Denied = true,
},
},
EnterpriseNetworkDomainNames = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
EnterpriseProxiedDomains = new List<WindowsInformationProtectionProxiedDomainCollection>
{
new WindowsInformationProtectionProxiedDomainCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionProxiedDomainCollection",
DisplayName = "Display Name value",
ProxiedDomains = new List<ProxiedDomain>
{
new ProxiedDomain
{
OdataType = "microsoft.graph.proxiedDomain",
IpAddressOrFQDN = "Ip Address Or FQDN value",
Proxy = "Proxy value",
},
},
},
},
EnterpriseIPRanges = new List<WindowsInformationProtectionIPRangeCollection>
{
new WindowsInformationProtectionIPRangeCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionIPRangeCollection",
DisplayName = "Display Name value",
Ranges = new List<IpRange>
{
new IPv6Range
{
OdataType = "microsoft.graph.iPv6Range",
LowerAddress = "Lower Address value",
UpperAddress = "Upper Address value",
},
},
},
},
EnterpriseIPRangesAreAuthoritative = true,
EnterpriseProxyServers = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
EnterpriseInternalProxyServers = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
EnterpriseProxyServersAreAuthoritative = true,
NeutralDomainResources = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
IndexingEncryptedStoresOrItemsBlocked = true,
SmbAutoEncryptedFileExtensions = new List<WindowsInformationProtectionResourceCollection>
{
new WindowsInformationProtectionResourceCollection
{
OdataType = "microsoft.graph.windowsInformationProtectionResourceCollection",
DisplayName = "Display Name value",
Resources = new List<string>
{
"Resources value",
},
},
},
IsAssigned = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.MdmWindowsInformationProtectionPolicies.PostAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
mgc device-app-management mdm-windows-information-protection-policies create --body '{\
"@odata.type": "#microsoft.graph.mdmWindowsInformationProtectionPolicy",\
"displayName": "Display Name value",\
"description": "Description value",\
"version": "Version value",\
"enforcementLevel": "encryptAndAuditOnly",\
"enterpriseDomain": "Enterprise Domain value",\
"enterpriseProtectedDomainNames": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"protectionUnderLockConfigRequired": true,\
"dataRecoveryCertificate": {\
"@odata.type": "microsoft.graph.windowsInformationProtectionDataRecoveryCertificate",\
"subjectName": "Subject Name value",\
"description": "Description value",\
"expirationDateTime": "2016-12-31T23:57:57.2481234-08:00",\
"certificate": "Y2VydGlmaWNhdGU="\
},\
"revokeOnUnenrollDisabled": true,\
"rightsManagementServicesTemplateId": "abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab",\
"azureRightsManagementServicesAllowed": true,\
"iconsVisible": true,\
"protectedApps": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionStoreApp",\
"displayName": "Display Name value",\
"description": "Description value",\
"publisherName": "Publisher Name value",\
"productName": "Product Name value",\
"denied": true\
}\
],\
"exemptApps": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionStoreApp",\
"displayName": "Display Name value",\
"description": "Description value",\
"publisherName": "Publisher Name value",\
"productName": "Product Name value",\
"denied": true\
}\
],\
"enterpriseNetworkDomainNames": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"enterpriseProxiedDomains": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionProxiedDomainCollection",\
"displayName": "Display Name value",\
"proxiedDomains": [\
{\
"@odata.type": "microsoft.graph.proxiedDomain",\
"ipAddressOrFQDN": "Ip Address Or FQDN value",\
"proxy": "Proxy value"\
}\
]\
}\
],\
"enterpriseIPRanges": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionIPRangeCollection",\
"displayName": "Display Name value",\
"ranges": [\
{\
"@odata.type": "microsoft.graph.iPv6Range",\
"lowerAddress": "Lower Address value",\
"upperAddress": "Upper Address value"\
}\
]\
}\
],\
"enterpriseIPRangesAreAuthoritative": true,\
"enterpriseProxyServers": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"enterpriseInternalProxyServers": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"enterpriseProxyServersAreAuthoritative": true,\
"neutralDomainResources": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"indexingEncryptedStoresOrItemsBlocked": true,\
"smbAutoEncryptedFileExtensions": [\
{\
"@odata.type": "microsoft.graph.windowsInformationProtectionResourceCollection",\
"displayName": "Display Name value",\
"resources": [\
"Resources value"\
]\
}\
],\
"isAssigned": true\
}\
'
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"github.com/google/uuid"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMdmWindowsInformationProtectionPolicy()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
version := "Version value"
requestBody.SetVersion(&version)
enforcementLevel := graphmodels.ENCRYPTANDAUDITONLY_WINDOWSINFORMATIONPROTECTIONENFORCEMENTLEVEL
requestBody.SetEnforcementLevel(&enforcementLevel)
enterpriseDomain := "Enterprise Domain value"
requestBody.SetEnterpriseDomain(&enterpriseDomain)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
enterpriseProtectedDomainNames := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetEnterpriseProtectedDomainNames(enterpriseProtectedDomainNames)
protectionUnderLockConfigRequired := true
requestBody.SetProtectionUnderLockConfigRequired(&protectionUnderLockConfigRequired)
dataRecoveryCertificate := graphmodels.NewWindowsInformationProtectionDataRecoveryCertificate()
subjectName := "Subject Name value"
dataRecoveryCertificate.SetSubjectName(&subjectName)
description := "Description value"
dataRecoveryCertificate.SetDescription(&description)
expirationDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:57:57.2481234-08:00")
dataRecoveryCertificate.SetExpirationDateTime(&expirationDateTime)
certificate := []byte("y2VydGlmaWNhdGU=")
dataRecoveryCertificate.SetCertificate(&certificate)
requestBody.SetDataRecoveryCertificate(dataRecoveryCertificate)
revokeOnUnenrollDisabled := true
requestBody.SetRevokeOnUnenrollDisabled(&revokeOnUnenrollDisabled)
rightsManagementServicesTemplateId := uuid.MustParse("abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab")
requestBody.SetRightsManagementServicesTemplateId(&rightsManagementServicesTemplateId)
azureRightsManagementServicesAllowed := true
requestBody.SetAzureRightsManagementServicesAllowed(&azureRightsManagementServicesAllowed)
iconsVisible := true
requestBody.SetIconsVisible(&iconsVisible)
windowsInformationProtectionApp := graphmodels.NewWindowsInformationProtectionStoreApp()
displayName := "Display Name value"
windowsInformationProtectionApp.SetDisplayName(&displayName)
description := "Description value"
windowsInformationProtectionApp.SetDescription(&description)
publisherName := "Publisher Name value"
windowsInformationProtectionApp.SetPublisherName(&publisherName)
productName := "Product Name value"
windowsInformationProtectionApp.SetProductName(&productName)
denied := true
windowsInformationProtectionApp.SetDenied(&denied)
protectedApps := []graphmodels.WindowsInformationProtectionAppable {
windowsInformationProtectionApp,
}
requestBody.SetProtectedApps(protectedApps)
windowsInformationProtectionApp := graphmodels.NewWindowsInformationProtectionStoreApp()
displayName := "Display Name value"
windowsInformationProtectionApp.SetDisplayName(&displayName)
description := "Description value"
windowsInformationProtectionApp.SetDescription(&description)
publisherName := "Publisher Name value"
windowsInformationProtectionApp.SetPublisherName(&publisherName)
productName := "Product Name value"
windowsInformationProtectionApp.SetProductName(&productName)
denied := true
windowsInformationProtectionApp.SetDenied(&denied)
exemptApps := []graphmodels.WindowsInformationProtectionAppable {
windowsInformationProtectionApp,
}
requestBody.SetExemptApps(exemptApps)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
enterpriseNetworkDomainNames := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetEnterpriseNetworkDomainNames(enterpriseNetworkDomainNames)
windowsInformationProtectionProxiedDomainCollection := graphmodels.NewWindowsInformationProtectionProxiedDomainCollection()
displayName := "Display Name value"
windowsInformationProtectionProxiedDomainCollection.SetDisplayName(&displayName)
proxiedDomain := graphmodels.NewProxiedDomain()
ipAddressOrFQDN := "Ip Address Or FQDN value"
proxiedDomain.SetIpAddressOrFQDN(&ipAddressOrFQDN)
proxy := "Proxy value"
proxiedDomain.SetProxy(&proxy)
proxiedDomains := []graphmodels.ProxiedDomainable {
proxiedDomain,
}
windowsInformationProtectionProxiedDomainCollection.SetProxiedDomains(proxiedDomains)
enterpriseProxiedDomains := []graphmodels.WindowsInformationProtectionProxiedDomainCollectionable {
windowsInformationProtectionProxiedDomainCollection,
}
requestBody.SetEnterpriseProxiedDomains(enterpriseProxiedDomains)
windowsInformationProtectionIPRangeCollection := graphmodels.NewWindowsInformationProtectionIPRangeCollection()
displayName := "Display Name value"
windowsInformationProtectionIPRangeCollection.SetDisplayName(&displayName)
ipRange := graphmodels.NewIPv6Range()
lowerAddress := "Lower Address value"
ipRange.SetLowerAddress(&lowerAddress)
upperAddress := "Upper Address value"
ipRange.SetUpperAddress(&upperAddress)
ranges := []graphmodels.IpRangeable {
ipRange,
}
windowsInformationProtectionIPRangeCollection.SetRanges(ranges)
enterpriseIPRanges := []graphmodels.WindowsInformationProtectionIPRangeCollectionable {
windowsInformationProtectionIPRangeCollection,
}
requestBody.SetEnterpriseIPRanges(enterpriseIPRanges)
enterpriseIPRangesAreAuthoritative := true
requestBody.SetEnterpriseIPRangesAreAuthoritative(&enterpriseIPRangesAreAuthoritative)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
enterpriseProxyServers := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetEnterpriseProxyServers(enterpriseProxyServers)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
enterpriseInternalProxyServers := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetEnterpriseInternalProxyServers(enterpriseInternalProxyServers)
enterpriseProxyServersAreAuthoritative := true
requestBody.SetEnterpriseProxyServersAreAuthoritative(&enterpriseProxyServersAreAuthoritative)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
neutralDomainResources := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetNeutralDomainResources(neutralDomainResources)
indexingEncryptedStoresOrItemsBlocked := true
requestBody.SetIndexingEncryptedStoresOrItemsBlocked(&indexingEncryptedStoresOrItemsBlocked)
windowsInformationProtectionResourceCollection := graphmodels.NewWindowsInformationProtectionResourceCollection()
displayName := "Display Name value"
windowsInformationProtectionResourceCollection.SetDisplayName(&displayName)
resources := []string {
"Resources value",
}
windowsInformationProtectionResourceCollection.SetResources(resources)
smbAutoEncryptedFileExtensions := []graphmodels.WindowsInformationProtectionResourceCollectionable {
windowsInformationProtectionResourceCollection,
}
requestBody.SetSmbAutoEncryptedFileExtensions(smbAutoEncryptedFileExtensions)
isAssigned := true
requestBody.SetIsAssigned(&isAssigned)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mdmWindowsInformationProtectionPolicies, err := graphClient.DeviceAppManagement().MdmWindowsInformationProtectionPolicies().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MdmWindowsInformationProtectionPolicy mdmWindowsInformationProtectionPolicy = new MdmWindowsInformationProtectionPolicy();
mdmWindowsInformationProtectionPolicy.setOdataType("#microsoft.graph.mdmWindowsInformationProtectionPolicy");
mdmWindowsInformationProtectionPolicy.setDisplayName("Display Name value");
mdmWindowsInformationProtectionPolicy.setDescription("Description value");
mdmWindowsInformationProtectionPolicy.setVersion("Version value");
mdmWindowsInformationProtectionPolicy.setEnforcementLevel(WindowsInformationProtectionEnforcementLevel.EncryptAndAuditOnly);
mdmWindowsInformationProtectionPolicy.setEnterpriseDomain("Enterprise Domain value");
LinkedList<WindowsInformationProtectionResourceCollection> enterpriseProtectedDomainNames = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection.setDisplayName("Display Name value");
LinkedList<String> resources = new LinkedList<String>();
resources.add("Resources value");
windowsInformationProtectionResourceCollection.setResources(resources);
enterpriseProtectedDomainNames.add(windowsInformationProtectionResourceCollection);
mdmWindowsInformationProtectionPolicy.setEnterpriseProtectedDomainNames(enterpriseProtectedDomainNames);
mdmWindowsInformationProtectionPolicy.setProtectionUnderLockConfigRequired(true);
WindowsInformationProtectionDataRecoveryCertificate dataRecoveryCertificate = new WindowsInformationProtectionDataRecoveryCertificate();
dataRecoveryCertificate.setOdataType("microsoft.graph.windowsInformationProtectionDataRecoveryCertificate");
dataRecoveryCertificate.setSubjectName("Subject Name value");
dataRecoveryCertificate.setDescription("Description value");
OffsetDateTime expirationDateTime = OffsetDateTime.parse("2016-12-31T23:57:57.2481234-08:00");
dataRecoveryCertificate.setExpirationDateTime(expirationDateTime);
byte[] certificate = Base64.getDecoder().decode("Y2VydGlmaWNhdGU=");
dataRecoveryCertificate.setCertificate(certificate);
mdmWindowsInformationProtectionPolicy.setDataRecoveryCertificate(dataRecoveryCertificate);
mdmWindowsInformationProtectionPolicy.setRevokeOnUnenrollDisabled(true);
mdmWindowsInformationProtectionPolicy.setRightsManagementServicesTemplateId(UUID.fromString("abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab"));
mdmWindowsInformationProtectionPolicy.setAzureRightsManagementServicesAllowed(true);
mdmWindowsInformationProtectionPolicy.setIconsVisible(true);
LinkedList<WindowsInformationProtectionApp> protectedApps = new LinkedList<WindowsInformationProtectionApp>();
WindowsInformationProtectionStoreApp windowsInformationProtectionApp = new WindowsInformationProtectionStoreApp();
windowsInformationProtectionApp.setOdataType("microsoft.graph.windowsInformationProtectionStoreApp");
windowsInformationProtectionApp.setDisplayName("Display Name value");
windowsInformationProtectionApp.setDescription("Description value");
windowsInformationProtectionApp.setPublisherName("Publisher Name value");
windowsInformationProtectionApp.setProductName("Product Name value");
windowsInformationProtectionApp.setDenied(true);
protectedApps.add(windowsInformationProtectionApp);
mdmWindowsInformationProtectionPolicy.setProtectedApps(protectedApps);
LinkedList<WindowsInformationProtectionApp> exemptApps = new LinkedList<WindowsInformationProtectionApp>();
WindowsInformationProtectionStoreApp windowsInformationProtectionApp1 = new WindowsInformationProtectionStoreApp();
windowsInformationProtectionApp1.setOdataType("microsoft.graph.windowsInformationProtectionStoreApp");
windowsInformationProtectionApp1.setDisplayName("Display Name value");
windowsInformationProtectionApp1.setDescription("Description value");
windowsInformationProtectionApp1.setPublisherName("Publisher Name value");
windowsInformationProtectionApp1.setProductName("Product Name value");
windowsInformationProtectionApp1.setDenied(true);
exemptApps.add(windowsInformationProtectionApp1);
mdmWindowsInformationProtectionPolicy.setExemptApps(exemptApps);
LinkedList<WindowsInformationProtectionResourceCollection> enterpriseNetworkDomainNames = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection1.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection1.setDisplayName("Display Name value");
LinkedList<String> resources1 = new LinkedList<String>();
resources1.add("Resources value");
windowsInformationProtectionResourceCollection1.setResources(resources1);
enterpriseNetworkDomainNames.add(windowsInformationProtectionResourceCollection1);
mdmWindowsInformationProtectionPolicy.setEnterpriseNetworkDomainNames(enterpriseNetworkDomainNames);
LinkedList<WindowsInformationProtectionProxiedDomainCollection> enterpriseProxiedDomains = new LinkedList<WindowsInformationProtectionProxiedDomainCollection>();
WindowsInformationProtectionProxiedDomainCollection windowsInformationProtectionProxiedDomainCollection = new WindowsInformationProtectionProxiedDomainCollection();
windowsInformationProtectionProxiedDomainCollection.setOdataType("microsoft.graph.windowsInformationProtectionProxiedDomainCollection");
windowsInformationProtectionProxiedDomainCollection.setDisplayName("Display Name value");
LinkedList<ProxiedDomain> proxiedDomains = new LinkedList<ProxiedDomain>();
ProxiedDomain proxiedDomain = new ProxiedDomain();
proxiedDomain.setOdataType("microsoft.graph.proxiedDomain");
proxiedDomain.setIpAddressOrFQDN("Ip Address Or FQDN value");
proxiedDomain.setProxy("Proxy value");
proxiedDomains.add(proxiedDomain);
windowsInformationProtectionProxiedDomainCollection.setProxiedDomains(proxiedDomains);
enterpriseProxiedDomains.add(windowsInformationProtectionProxiedDomainCollection);
mdmWindowsInformationProtectionPolicy.setEnterpriseProxiedDomains(enterpriseProxiedDomains);
LinkedList<WindowsInformationProtectionIPRangeCollection> enterpriseIPRanges = new LinkedList<WindowsInformationProtectionIPRangeCollection>();
WindowsInformationProtectionIPRangeCollection windowsInformationProtectionIPRangeCollection = new WindowsInformationProtectionIPRangeCollection();
windowsInformationProtectionIPRangeCollection.setOdataType("microsoft.graph.windowsInformationProtectionIPRangeCollection");
windowsInformationProtectionIPRangeCollection.setDisplayName("Display Name value");
LinkedList<IpRange> ranges = new LinkedList<IpRange>();
IPv6Range ipRange = new IPv6Range();
ipRange.setOdataType("microsoft.graph.iPv6Range");
ipRange.setLowerAddress("Lower Address value");
ipRange.setUpperAddress("Upper Address value");
ranges.add(ipRange);
windowsInformationProtectionIPRangeCollection.setRanges(ranges);
enterpriseIPRanges.add(windowsInformationProtectionIPRangeCollection);
mdmWindowsInformationProtectionPolicy.setEnterpriseIPRanges(enterpriseIPRanges);
mdmWindowsInformationProtectionPolicy.setEnterpriseIPRangesAreAuthoritative(true);
LinkedList<WindowsInformationProtectionResourceCollection> enterpriseProxyServers = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection2 = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection2.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection2.setDisplayName("Display Name value");
LinkedList<String> resources2 = new LinkedList<String>();
resources2.add("Resources value");
windowsInformationProtectionResourceCollection2.setResources(resources2);
enterpriseProxyServers.add(windowsInformationProtectionResourceCollection2);
mdmWindowsInformationProtectionPolicy.setEnterpriseProxyServers(enterpriseProxyServers);
LinkedList<WindowsInformationProtectionResourceCollection> enterpriseInternalProxyServers = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection3 = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection3.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection3.setDisplayName("Display Name value");
LinkedList<String> resources3 = new LinkedList<String>();
resources3.add("Resources value");
windowsInformationProtectionResourceCollection3.setResources(resources3);
enterpriseInternalProxyServers.add(windowsInformationProtectionResourceCollection3);
mdmWindowsInformationProtectionPolicy.setEnterpriseInternalProxyServers(enterpriseInternalProxyServers);
mdmWindowsInformationProtectionPolicy.setEnterpriseProxyServersAreAuthoritative(true);
LinkedList<WindowsInformationProtectionResourceCollection> neutralDomainResources = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection4 = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection4.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection4.setDisplayName("Display Name value");
LinkedList<String> resources4 = new LinkedList<String>();
resources4.add("Resources value");
windowsInformationProtectionResourceCollection4.setResources(resources4);
neutralDomainResources.add(windowsInformationProtectionResourceCollection4);
mdmWindowsInformationProtectionPolicy.setNeutralDomainResources(neutralDomainResources);
mdmWindowsInformationProtectionPolicy.setIndexingEncryptedStoresOrItemsBlocked(true);
LinkedList<WindowsInformationProtectionResourceCollection> smbAutoEncryptedFileExtensions = new LinkedList<WindowsInformationProtectionResourceCollection>();
WindowsInformationProtectionResourceCollection windowsInformationProtectionResourceCollection5 = new WindowsInformationProtectionResourceCollection();
windowsInformationProtectionResourceCollection5.setOdataType("microsoft.graph.windowsInformationProtectionResourceCollection");
windowsInformationProtectionResourceCollection5.setDisplayName("Display Name value");
LinkedList<String> resources5 = new LinkedList<String>();
resources5.add("Resources value");
windowsInformationProtectionResourceCollection5.setResources(resources5);
smbAutoEncryptedFileExtensions.add(windowsInformationProtectionResourceCollection5);
mdmWindowsInformationProtectionPolicy.setSmbAutoEncryptedFileExtensions(smbAutoEncryptedFileExtensions);
mdmWindowsInformationProtectionPolicy.setIsAssigned(true);
MdmWindowsInformationProtectionPolicy result = graphClient.deviceAppManagement().mdmWindowsInformationProtectionPolicies().post(mdmWindowsInformationProtectionPolicy);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const mdmWindowsInformationProtectionPolicy = {
'@odata.type': '#microsoft.graph.mdmWindowsInformationProtectionPolicy',
displayName: 'Display Name value',
description: 'Description value',
version: 'Version value',
enforcementLevel: 'encryptAndAuditOnly',
enterpriseDomain: 'Enterprise Domain value',
enterpriseProtectedDomainNames: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
protectionUnderLockConfigRequired: true,
dataRecoveryCertificate: {
'@odata.type': 'microsoft.graph.windowsInformationProtectionDataRecoveryCertificate',
subjectName: 'Subject Name value',
description: 'Description value',
expirationDateTime: '2016-12-31T23:57:57.2481234-08:00',
certificate: 'Y2VydGlmaWNhdGU='
},
revokeOnUnenrollDisabled: true,
rightsManagementServicesTemplateId: 'abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab',
azureRightsManagementServicesAllowed: true,
iconsVisible: true,
protectedApps: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionStoreApp',
displayName: 'Display Name value',
description: 'Description value',
publisherName: 'Publisher Name value',
productName: 'Product Name value',
denied: true
}
],
exemptApps: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionStoreApp',
displayName: 'Display Name value',
description: 'Description value',
publisherName: 'Publisher Name value',
productName: 'Product Name value',
denied: true
}
],
enterpriseNetworkDomainNames: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
enterpriseProxiedDomains: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionProxiedDomainCollection',
displayName: 'Display Name value',
proxiedDomains: [
{
'@odata.type': 'microsoft.graph.proxiedDomain',
ipAddressOrFQDN: 'Ip Address Or FQDN value',
proxy: 'Proxy value'
}
]
}
],
enterpriseIPRanges: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionIPRangeCollection',
displayName: 'Display Name value',
ranges: [
{
'@odata.type': 'microsoft.graph.iPv6Range',
lowerAddress: 'Lower Address value',
upperAddress: 'Upper Address value'
}
]
}
],
enterpriseIPRangesAreAuthoritative: true,
enterpriseProxyServers: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
enterpriseInternalProxyServers: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
enterpriseProxyServersAreAuthoritative: true,
neutralDomainResources: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
indexingEncryptedStoresOrItemsBlocked: true,
smbAutoEncryptedFileExtensions: [
{
'@odata.type': 'microsoft.graph.windowsInformationProtectionResourceCollection',
displayName: 'Display Name value',
resources: [
'Resources value'
]
}
],
isAssigned: true
};
await client.api('/deviceAppManagement/mdmWindowsInformationProtectionPolicies')
.post(mdmWindowsInformationProtectionPolicy);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MdmWindowsInformationProtectionPolicy;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionEnforcementLevel;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionResourceCollection;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionDataRecoveryCertificate;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionApp;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionStoreApp;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionProxiedDomainCollection;
use Microsoft\Graph\Generated\Models\ProxiedDomain;
use Microsoft\Graph\Generated\Models\WindowsInformationProtectionIPRangeCollection;
use Microsoft\Graph\Generated\Models\IpRange;
use Microsoft\Graph\Generated\Models\IPv6Range;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MdmWindowsInformationProtectionPolicy();
$requestBody->setOdataType('#microsoft.graph.mdmWindowsInformationProtectionPolicy');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setVersion('Version value');
$requestBody->setEnforcementLevel(new WindowsInformationProtectionEnforcementLevel('encryptAndAuditOnly'));
$requestBody->setEnterpriseDomain('Enterprise Domain value');
$enterpriseProtectedDomainNamesWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$enterpriseProtectedDomainNamesWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$enterpriseProtectedDomainNamesWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$enterpriseProtectedDomainNamesWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$enterpriseProtectedDomainNamesArray []= $enterpriseProtectedDomainNamesWindowsInformationProtectionResourceCollection1;
$requestBody->setEnterpriseProtectedDomainNames($enterpriseProtectedDomainNamesArray);
$requestBody->setProtectionUnderLockConfigRequired(true);
$dataRecoveryCertificate = new WindowsInformationProtectionDataRecoveryCertificate();
$dataRecoveryCertificate->setOdataType('microsoft.graph.windowsInformationProtectionDataRecoveryCertificate');
$dataRecoveryCertificate->setSubjectName('Subject Name value');
$dataRecoveryCertificate->setDescription('Description value');
$dataRecoveryCertificate->setExpirationDateTime(new \DateTime('2016-12-31T23:57:57.2481234-08:00'));
$dataRecoveryCertificate->setCertificate(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('Y2VydGlmaWNhdGU=')));
$requestBody->setDataRecoveryCertificate($dataRecoveryCertificate);
$requestBody->setRevokeOnUnenrollDisabled(true);
$requestBody->setRightsManagementServicesTemplateId('abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab');
$requestBody->setAzureRightsManagementServicesAllowed(true);
$requestBody->setIconsVisible(true);
$protectedAppsWindowsInformationProtectionApp1 = new WindowsInformationProtectionStoreApp();
$protectedAppsWindowsInformationProtectionApp1->setOdataType('microsoft.graph.windowsInformationProtectionStoreApp');
$protectedAppsWindowsInformationProtectionApp1->setDisplayName('Display Name value');
$protectedAppsWindowsInformationProtectionApp1->setDescription('Description value');
$protectedAppsWindowsInformationProtectionApp1->setPublisherName('Publisher Name value');
$protectedAppsWindowsInformationProtectionApp1->setProductName('Product Name value');
$protectedAppsWindowsInformationProtectionApp1->setDenied(true);
$protectedAppsArray []= $protectedAppsWindowsInformationProtectionApp1;
$requestBody->setProtectedApps($protectedAppsArray);
$exemptAppsWindowsInformationProtectionApp1 = new WindowsInformationProtectionStoreApp();
$exemptAppsWindowsInformationProtectionApp1->setOdataType('microsoft.graph.windowsInformationProtectionStoreApp');
$exemptAppsWindowsInformationProtectionApp1->setDisplayName('Display Name value');
$exemptAppsWindowsInformationProtectionApp1->setDescription('Description value');
$exemptAppsWindowsInformationProtectionApp1->setPublisherName('Publisher Name value');
$exemptAppsWindowsInformationProtectionApp1->setProductName('Product Name value');
$exemptAppsWindowsInformationProtectionApp1->setDenied(true);
$exemptAppsArray []= $exemptAppsWindowsInformationProtectionApp1;
$requestBody->setExemptApps($exemptAppsArray);
$enterpriseNetworkDomainNamesWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$enterpriseNetworkDomainNamesWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$enterpriseNetworkDomainNamesWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$enterpriseNetworkDomainNamesWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$enterpriseNetworkDomainNamesArray []= $enterpriseNetworkDomainNamesWindowsInformationProtectionResourceCollection1;
$requestBody->setEnterpriseNetworkDomainNames($enterpriseNetworkDomainNamesArray);
$enterpriseProxiedDomainsWindowsInformationProtectionProxiedDomainCollection1 = new WindowsInformationProtectionProxiedDomainCollection();
$enterpriseProxiedDomainsWindowsInformationProtectionProxiedDomainCollection1->setOdataType('microsoft.graph.windowsInformationProtectionProxiedDomainCollection');
$enterpriseProxiedDomainsWindowsInformationProtectionProxiedDomainCollection1->setDisplayName('Display Name value');
$proxiedDomainsProxiedDomain1 = new ProxiedDomain();
$proxiedDomainsProxiedDomain1->setOdataType('microsoft.graph.proxiedDomain');
$proxiedDomainsProxiedDomain1->setIpAddressOrFQDN('Ip Address Or FQDN value');
$proxiedDomainsProxiedDomain1->setProxy('Proxy value');
$proxiedDomainsArray []= $proxiedDomainsProxiedDomain1;
$enterpriseProxiedDomainsWindowsInformationProtectionProxiedDomainCollection1->setProxiedDomains($proxiedDomainsArray);
$enterpriseProxiedDomainsArray []= $enterpriseProxiedDomainsWindowsInformationProtectionProxiedDomainCollection1;
$requestBody->setEnterpriseProxiedDomains($enterpriseProxiedDomainsArray);
$enterpriseIPRangesWindowsInformationProtectionIPRangeCollection1 = new WindowsInformationProtectionIPRangeCollection();
$enterpriseIPRangesWindowsInformationProtectionIPRangeCollection1->setOdataType('microsoft.graph.windowsInformationProtectionIPRangeCollection');
$enterpriseIPRangesWindowsInformationProtectionIPRangeCollection1->setDisplayName('Display Name value');
$rangesIpRange1 = new IPv6Range();
$rangesIpRange1->setOdataType('microsoft.graph.iPv6Range');
$rangesIpRange1->setLowerAddress('Lower Address value');
$rangesIpRange1->setUpperAddress('Upper Address value');
$rangesArray []= $rangesIpRange1;
$enterpriseIPRangesWindowsInformationProtectionIPRangeCollection1->setRanges($rangesArray);
$enterpriseIPRangesArray []= $enterpriseIPRangesWindowsInformationProtectionIPRangeCollection1;
$requestBody->setEnterpriseIPRanges($enterpriseIPRangesArray);
$requestBody->setEnterpriseIPRangesAreAuthoritative(true);
$enterpriseProxyServersWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$enterpriseProxyServersWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$enterpriseProxyServersWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$enterpriseProxyServersWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$enterpriseProxyServersArray []= $enterpriseProxyServersWindowsInformationProtectionResourceCollection1;
$requestBody->setEnterpriseProxyServers($enterpriseProxyServersArray);
$enterpriseInternalProxyServersWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$enterpriseInternalProxyServersWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$enterpriseInternalProxyServersWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$enterpriseInternalProxyServersWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$enterpriseInternalProxyServersArray []= $enterpriseInternalProxyServersWindowsInformationProtectionResourceCollection1;
$requestBody->setEnterpriseInternalProxyServers($enterpriseInternalProxyServersArray);
$requestBody->setEnterpriseProxyServersAreAuthoritative(true);
$neutralDomainResourcesWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$neutralDomainResourcesWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$neutralDomainResourcesWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$neutralDomainResourcesWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$neutralDomainResourcesArray []= $neutralDomainResourcesWindowsInformationProtectionResourceCollection1;
$requestBody->setNeutralDomainResources($neutralDomainResourcesArray);
$requestBody->setIndexingEncryptedStoresOrItemsBlocked(true);
$smbAutoEncryptedFileExtensionsWindowsInformationProtectionResourceCollection1 = new WindowsInformationProtectionResourceCollection();
$smbAutoEncryptedFileExtensionsWindowsInformationProtectionResourceCollection1->setOdataType('microsoft.graph.windowsInformationProtectionResourceCollection');
$smbAutoEncryptedFileExtensionsWindowsInformationProtectionResourceCollection1->setDisplayName('Display Name value');
$smbAutoEncryptedFileExtensionsWindowsInformationProtectionResourceCollection1->setResources(['Resources value', ]);
$smbAutoEncryptedFileExtensionsArray []= $smbAutoEncryptedFileExtensionsWindowsInformationProtectionResourceCollection1;
$requestBody->setSmbAutoEncryptedFileExtensions($smbAutoEncryptedFileExtensionsArray);
$requestBody->setIsAssigned(true);
$result = $graphServiceClient->deviceAppManagement()->mdmWindowsInformationProtectionPolicies()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.mdmWindowsInformationProtectionPolicy"
displayName = "Display Name value"
description = "Description value"
version = "Version value"
enforcementLevel = "encryptAndAuditOnly"
enterpriseDomain = "Enterprise Domain value"
enterpriseProtectedDomainNames = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
protectionUnderLockConfigRequired = $true
dataRecoveryCertificate = @{
"@odata.type" = "microsoft.graph.windowsInformationProtectionDataRecoveryCertificate"
subjectName = "Subject Name value"
description = "Description value"
expirationDateTime = [System.DateTime]::Parse("2016-12-31T23:57:57.2481234-08:00")
certificate = [System.Text.Encoding]::ASCII.GetBytes("Y2VydGlmaWNhdGU=")
}
revokeOnUnenrollDisabled = $true
rightsManagementServicesTemplateId = "abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab"
azureRightsManagementServicesAllowed = $true
iconsVisible = $true
protectedApps = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionStoreApp"
displayName = "Display Name value"
description = "Description value"
publisherName = "Publisher Name value"
productName = "Product Name value"
denied = $true
}
)
exemptApps = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionStoreApp"
displayName = "Display Name value"
description = "Description value"
publisherName = "Publisher Name value"
productName = "Product Name value"
denied = $true
}
)
enterpriseNetworkDomainNames = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
enterpriseProxiedDomains = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionProxiedDomainCollection"
displayName = "Display Name value"
proxiedDomains = @(
@{
"@odata.type" = "microsoft.graph.proxiedDomain"
ipAddressOrFQDN = "Ip Address Or FQDN value"
proxy = "Proxy value"
}
)
}
)
enterpriseIPRanges = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionIPRangeCollection"
displayName = "Display Name value"
ranges = @(
@{
"@odata.type" = "microsoft.graph.iPv6Range"
lowerAddress = "Lower Address value"
upperAddress = "Upper Address value"
}
)
}
)
enterpriseIPRangesAreAuthoritative = $true
enterpriseProxyServers = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
enterpriseInternalProxyServers = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
enterpriseProxyServersAreAuthoritative = $true
neutralDomainResources = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
indexingEncryptedStoresOrItemsBlocked = $true
smbAutoEncryptedFileExtensions = @(
@{
"@odata.type" = "microsoft.graph.windowsInformationProtectionResourceCollection"
displayName = "Display Name value"
resources = @(
"Resources value"
)
}
)
isAssigned = $true
}
New-MgDeviceAppManagementMdmWindowsInformationProtectionPolicy -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.mdm_windows_information_protection_policy import MdmWindowsInformationProtectionPolicy
from msgraph.generated.models.windows_information_protection_enforcement_level import WindowsInformationProtectionEnforcementLevel
from msgraph.generated.models.windows_information_protection_resource_collection import WindowsInformationProtectionResourceCollection
from msgraph.generated.models.windows_information_protection_data_recovery_certificate import WindowsInformationProtectionDataRecoveryCertificate
from msgraph.generated.models.windows_information_protection_app import WindowsInformationProtectionApp
from msgraph.generated.models.windows_information_protection_store_app import WindowsInformationProtectionStoreApp
from msgraph.generated.models.windows_information_protection_proxied_domain_collection import WindowsInformationProtectionProxiedDomainCollection
from msgraph.generated.models.proxied_domain import ProxiedDomain
from msgraph.generated.models.windows_information_protection_i_p_range_collection import WindowsInformationProtectionIPRangeCollection
from msgraph.generated.models.ip_range import IpRange
from msgraph.generated.models.i_pv6_range import IPv6Range
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MdmWindowsInformationProtectionPolicy(
odata_type = "#microsoft.graph.mdmWindowsInformationProtectionPolicy",
display_name = "Display Name value",
description = "Description value",
version = "Version value",
enforcement_level = WindowsInformationProtectionEnforcementLevel.EncryptAndAuditOnly,
enterprise_domain = "Enterprise Domain value",
enterprise_protected_domain_names = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
protection_under_lock_config_required = True,
data_recovery_certificate = WindowsInformationProtectionDataRecoveryCertificate(
odata_type = "microsoft.graph.windowsInformationProtectionDataRecoveryCertificate",
subject_name = "Subject Name value",
description = "Description value",
expiration_date_time = "2016-12-31T23:57:57.2481234-08:00",
certificate = base64.urlsafe_b64decode("Y2VydGlmaWNhdGU="),
),
revoke_on_unenroll_disabled = True,
rights_management_services_template_id = UUID("abf7b16f-b16f-abf7-6fb1-f7ab6fb1f7ab"),
azure_rights_management_services_allowed = True,
icons_visible = True,
protected_apps = [
WindowsInformationProtectionStoreApp(
odata_type = "microsoft.graph.windowsInformationProtectionStoreApp",
display_name = "Display Name value",
description = "Description value",
publisher_name = "Publisher Name value",
product_name = "Product Name value",
denied = True,
),
],
exempt_apps = [
WindowsInformationProtectionStoreApp(
odata_type = "microsoft.graph.windowsInformationProtectionStoreApp",
display_name = "Display Name value",
description = "Description value",
publisher_name = "Publisher Name value",
product_name = "Product Name value",
denied = True,
),
],
enterprise_network_domain_names = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
enterprise_proxied_domains = [
WindowsInformationProtectionProxiedDomainCollection(
odata_type = "microsoft.graph.windowsInformationProtectionProxiedDomainCollection",
display_name = "Display Name value",
proxied_domains = [
ProxiedDomain(
odata_type = "microsoft.graph.proxiedDomain",
ip_address_or_f_q_d_n = "Ip Address Or FQDN value",
proxy = "Proxy value",
),
],
),
],
enterprise_i_p_ranges = [
WindowsInformationProtectionIPRangeCollection(
odata_type = "microsoft.graph.windowsInformationProtectionIPRangeCollection",
display_name = "Display Name value",
ranges = [
IPv6Range(
odata_type = "microsoft.graph.iPv6Range",
lower_address = "Lower Address value",
upper_address = "Upper Address value",
),
],
),
],
enterprise_i_p_ranges_are_authoritative = True,
enterprise_proxy_servers = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
enterprise_internal_proxy_servers = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
enterprise_proxy_servers_are_authoritative = True,
neutral_domain_resources = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
indexing_encrypted_stores_or_items_blocked = True,
smb_auto_encrypted_file_extensions = [
WindowsInformationProtectionResourceCollection(
odata_type = "microsoft.graph.windowsInformationProtectionResourceCollection",
display_name = "Display Name value",
resources = [
"Resources value",
],
),
],
is_assigned = True,
)
result = await graph_client.device_app_management.mdm_windows_information_protection_policies.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。