Skip to main content

SYNOPSIS

Sets the status of a registered application in Microsoft Graph by setting its ‘isDisabled’ property.

SYNTAX

ByApplicationID

Set-MgRegisteredAppStatus [-ApplicationID] <String> [-Status] <String> [-GenerateCmdlets]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

ByDisplayName

Set-MgRegisteredAppStatus [-DisplayName] <String> [-Status] <String> [-GenerateCmdlets]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This function takes an Application ID or DisplayName as input and enables or disables the registered application by using Invoke-MgGraphRequest to set isDisabled to true or false/null.

EXAMPLES

EXAMPLE 1

Set-MgRegisteredAppStatus -ApplicationID "your-application-id" -Status "Disabled"
This command disables the registered application with the specified Application ID.

EXAMPLE 2

Set-MgRegisteredAppStatus -DisplayName "MyApp" -Status "Enabled"
This command enables the registered application with the specified display name.

PARAMETERS

-ApplicationID

The unique identifier of the registered application to modify.
Type: String
Parameter Sets: ByApplicationID
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DisplayName

The display name of the registered application to modify.
Type: String
Parameter Sets: ByDisplayName
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Status

The status to set for the registered application. Valid values are ‘Enabled’ or ‘Disabled’.
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-GenerateCmdlets

If specified, the function will generate the cmdlets and save them to a file instead of executing them.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

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 service principal/enterprise app, use the Set-MgEnterpriseAppStatus function instead. https://ps365.clidsys.com/docs/commands/Set-MgRegisteredAppStatus