How to create an Azure application under Mobility (MDM and MDM) using powershell

harsh 1 Reputation point
2020-08-23T07:38:17.21+00:00

I am able create an application but it is not getting created under MDM and MAM Application.

Get-AzureADApplication and New-AzureADApplication by these cmdlets i am to create and view AzureADApplication but i want to know, how to create Azure applicatation only under (MDM and MAM) Application using powershell.

"https://learn.microsoft.com/en-us/windows/client-management/mdm/azure-active-directory-integration-with-mdm#connect-to-azure-ad" we can able to create MDM Azure Application by portal but i want use powershell to create the MDM Azure Applicatation.

Can please help me by giving hint or suggestion or anything needful.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,196 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,614 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2020-08-24T00:18:45.553+00:00

    Try this:

    $PasswordCredential=[Microsoft.Open.AzureAD.Model.PasswordCredential]::new()
    $PasswordCredential.EndDate=(Get-Date)
    $PasswordCredential.EndDate=(Get-Date).AddMonths(1)
    $PasswordCredential.Value=[System.Text.Encoding]::UTF8.GetBytes("<your_key_value>")
    
    $RequiredResourceAccess=[Microsoft.Open.AzureAD.Model.RequiredResourceAccess]::new()
    $RequiredResourceAccess.ResourceAppId="00000002-0000-0000-c000-000000000000"
    $RequiredResourceAccess.ResourceAccess=[Microsoft.Open.AzureAD.Model.ResourceAccess]::new("311a71cc-e848-46a1-bdf8-97ff7156d8e6","Scope")
    
    New-AzureADApplication -AvailableToOtherTenants $true -DisplayName "ContosoMDM" -IdentifierUris "https://<your_tenant_name>/ContosoMDM" -PasswordCredentials $PasswordCredential -ReplyUrls "https://YourMdmServiceLoginUrl" -RequiredResourceAccess $RequiredResourceAccess -Oauth2AllowImplicitFlow $false
    

    Please let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.