Managing applications in Azure Active Directory using PowerShell

Sign in to queue

The Discussion

  • User profile image
    hari

    i tried to do same as given modules got installed, but when i run "Connect-AzureAD" i am getting following error
    Connect-AzureAD : The term 'Connect-AzureAD' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
    again.
    At C:\Hari\ProjectDocs\Load test Environment\myscripts\Script samples.ps1:7 char:1
    + Connect-AzureAD
    + ~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Connect-AzureAD:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  • User profile image
    ChristiaanB

    @hari:If you haven't already run "Import-Module AzureAD" the command will not be available.  If AzureAD is not installed look at "Install-Module AzureAD" (from elevated session) that will pull the package from the PowerShell Gallery and install locally (assuming the PowerShellGet module is present on your system - most recent Windows OS's do).

  • User profile image
    driberif

    Great video thanx for putting this together.  Couple interesting things I've found with these cmdlets for AD is the switch -all.

    You have to pass the switch with -all $true... Very odd compared to the other azure cmdlets

     

    Get-AzureADApplication -All $true

  • User profile image
    Gedas

    Hej all, Got similar issue with azure ad b2c tenant - App registrations. In delete directory I get a message "Delete all App registrations" but the App registrations panel does not contain any app, nor in viewing All applications, nor in Microsoft Application Console. Looks like some hidden mysterious ghost app registration. How to list Applications (not Enterprise) in Powershell and try to delete them manually? Or how to continue with the Azure AD deletion?

  • User profile image
    Gedas

    after long search these powershell commands helped me:

    Get-AzureADApplication -All $true
    Get-AzureADUser
    Add-AzureADApplicationOwner -ObjectId APP_OBJ_ID -RefObjectId LOGIN_ID
    New-AzureADServicePrincipal -AppId APP_ID
    Set-AzureRmADApplication -ObjectId APP_OBJ_ID -AvailableToOtherTenants $false
    Remove-AzureRmADApplication -ObjectId APP_OBJ_ID

    Got a hidden app regitration. Added a principal of the app to newly created global admin in that azure ad. the go to microsoft management console as this was converged app and delete it there. then the app was gone from delete azure ad check list

Add Your 2 Cents