Test-MtConnection
SYNOPSIS
Checks if the current session is connected to the specified service. Use -Verbose to see the connection status for each service.
SYNTAX
Test-MtConnection [[-Service] <String[]>] [-Details] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Tests the connection for each service and returns $true if the session is connected to the specified service.
EXAMPLES
EXAMPLE 1
Test-MtConnection -Service All
Checks if the current session is connected to all services including Azure, Microsoft Graph, Exchange Online, Exchange Online Protection (SecurityCompliance), and Microsoft Teams. Returns a Boolean value.
EXAMPLE 2
Test-MtConnection -Details
Checks if the current session is connected to all services including Azure, Microsoft Graph, Exchange Online, Exchange Online Protection (SecurityCompliance), and Microsoft Teams. Returns a custom object that contains the connection details for all services.
EXAMPLE 3
Test-MtConnection -Service Azure
Checks if the current session is connected to Azure and returns a Boolean result.
PARAMETERS
-Service
The service to check the connection for. Valid values are 'All', 'Azure', 'ExchangeOnline', 'Graph', 'SecurityCompliance' (or 'EOP'), and 'Teams'. Default is 'All'.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: All
Accept pipeline input: False
Accept wildcard characters: False
-Details
Return the full details of all connections instead of just a boolean value.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
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.