is there any Microsoft graph api v1.0 or any powershell command to automate compliance settings of device compliance policy for window 10/11 ?

16557136 21 Reputation points
2022-11-20T17:44:05.34+00:00

Hi, I want to automate many configuration settings in microsoft endpoint manage admin center. In device compliance policy I am able to add policy using
"https://learn.microsoft.com/en-us/graph/api/intune-deviceconfig-windows10compliancepolicy-create?view=graph-rest-1.0" api. But for system security I am not able to get any place holder in json body or any seprate api to automate.
I need there options as required.

262284-image.png

thanks in advance

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,564 questions
Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,715 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,319 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 42,801 Reputation points Microsoft Vendor
    2022-11-21T02:42:56.127+00:00

    @16557136 , Thanks for posting in Q&A.

    Based on my checking via DevTool on Edge, (Click F12 and open DevTools), I find the request is post to "https://graph.microsoft.com/beta/deviceManagement/deviceCompliancePolicies"

    The request body look likes as below:
    {"id":"00000000-0000-0000-0000-000000000000","displayName":"test","roleScopeTagIds":["0"],"@odata.type":"#microsoft.graph.windows10CompliancePolicy","scheduledActionsForRule":[{"ruleName":"PasswordRequired","scheduledActionConfigurations":[{"actionType":"block","gracePeriodHours":0,"notificationTemplateId":"","notificationMessageCCList":[]}]}],"deviceThreatProtectionRequiredSecurityLevel":"unavailable","passwordRequiredType":"deviceDefault","passwordRequired":true,"passwordMinimumLength":4,"deviceThreatProtectionEnabled":false}

    Here are some pictures for your reference:
    262402-image.png
    262382-image.png

    From the document you provided, I notice it is also supported on v1.0. Given the situation, you can create the same setting on Intune portal and capture the logs, find the payload of the request, click view source to get the request body you want.

    Hope it can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.