Skip to main content

SYNOPSIS

Sets the status of an enterprise application (service principal) in Microsoft Graph by setting its ‘AccountEnabled’ property.

SYNTAX

ByApplicationID

ByDisplayName

DESCRIPTION

This function takes an Application ID or DisplayName as input and enables or disables the service principal (enterprise app) by using Invoke-MgGraphRequest to set AccountEnabled to true or false.

EXAMPLES

EXAMPLE 1

This command disables the enterprise application with the specified App ID.

EXAMPLE 2

This command enables the enterprise application with the specified display name.

PARAMETERS

-ApplicationID

The App ID of the service principal to modify.

-DisplayName

The display name of the service principal to modify.

-Status

The status to set for the enterprise application. Valid values are ‘Enabled’ or ‘Disabled’.

-GenerateCmdlets

If specified, the function will generate the cmdlets and save them to a file instead of executing them.

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

-Confirm

Prompts you for confirmation before running the cmdlet.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

To modify a registered application, use the Set-MgRegisteredAppStatus function instead. https://ps365.clidsys.com/docs/commands/Set-MgEnterpriseAppStatus