trouble: How to register for an enterprise app with powershell.

tarou chabi 731 Reputation points
2022-04-04T02:34:58.423+00:00

I want to register Microsoft.Graph.Intune.
But, my pc can't pop up the Aouth authentication screen to register. So, Connect-MSGraph cannot be used.

And I try to register with powershell.
But, the next code displays Aouth popup.

Connect-AzureAD -Credential $cre

$User = "***@****.onmicrosoft.com"
$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547"
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$resourceAppIdURI = "https://graph.microsoft.com"
$authority = "https://login.microsoftonline.com/$Tenant"

$authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority
$platformParameters = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters" -ArgumentList "Auto"
$userId = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.UserIdentifier" -ArgumentList ($User, "OptionalDisplayableId")
$authResult = $authContext.AcquireTokenAsync($resourceAppIdURI,$clientId,$redirectUri,$platformParameters,$userId).Result

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,214 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,155 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Clément BETACORNE 2,341 Reputation points
    2022-04-04T15:15:29.487+00:00

    Did you follow these instruction :
    https://learn.microsoft.com/en-us/graph/powershell/installation

    Regards,


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.