The Connect-Entra cmdlet connects to Microsoft Entra ID with an authenticated account.
Several authentication scenarios are supported based on your use case, such as delegated (interactive) and app-only (non-interactive).
Connect-Entra is an alias for Connect-MgGraph.
Parameters
-AccessToken
Specifies a bearer token for Microsoft Entra service. Access tokens do time out and you have to handle their refresh.
Parameter properties
Type:
SecureString
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AccessTokenParameterSet
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Certificate
An X.509 certificate supplied during invocation.
Parameter properties
Type:
X509Certificate2
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AppCertificateParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CertificateSubjectName
The subject distinguished name of a certificate. The certificate is retrieved from the current user's certificate store.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
CertificateSubject, CertificateName
Parameter sets
AppCertificateParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CertificateThumbprint
Specifies the certificate thumbprint of a digital public key X.509 certificate of a user account that has permission to perform this action.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
AppCertificateParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ClientId
Specifies the application ID of the service principal.
Parameter properties
Type:
System.String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
AppId, ApplicationId
Parameter sets
UserParameterSet
Position:
1
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
IdentityParameterSet
Position:
1
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AppCertificateParameterSet
Position:
1
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ClientSecretCredential
The PSCredential object provides the application ID and client secret for service principal credentials. For more information about the PSCredential object, type Get-Help Get-Credential.
Parameter properties
Type:
PSCredential
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
SecretCredential, Credential
Parameter sets
AppSecretCredentialParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ClientTimeout
Sets the HTTP client timeout in seconds.
Parameter properties
Type:
System.Double
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ContextScope
Determines the scope of authentication context. This ContextScope accepts Process for the current process, or CurrentUser for all sessions started by user.
Parameter properties
Type:
ContextScope
Default value:
None
Accepted values:
Process, CurrentUser
Supports wildcards:
False
DontShow:
False
Parameter sets
UserParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AppCertificateParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
IdentityParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
AppSecretCredentialParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
EnvironmentVariableParameterSet
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Environment
The name of the national cloud environment to connect to. By default global cloud is used.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.