Microsoft.Entra.Beta.Authentication-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Connect-Entra</command:name> <command:verb>Connect</command:verb> <command:noun>Entra</command:noun> <maml:description> <maml:para>Connect to Microsoft Entra ID with an authenticated account.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Connect-Entra` cmdlet connects to Microsoft Entra ID with an authenticated account.</maml:para> <maml:para>Several authentication scenarios are supported based on your use case, such as delegated (interactive) and app-only (non-interactive).</maml:para> <maml:para>`Connect-Entra` is an alias for `Connect-MgGraph`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="AppId, ApplicationId"> <maml:name>ClientId</maml:name> <maml:description> <maml:para>Specifies the application ID of the service principal.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:description> <maml:para>Specifies the certificate thumbprint of a digital public key X.509 certificate of a user account that has permission to perform this action.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Audience, Tenant"> <maml:name>TenantId</maml:name> <maml:description> <maml:para>Specifies the ID of a tenant.</maml:para> <maml:para>If you don't specify this parameter, the account is authenticated with the home tenant.</maml:para> <maml:para>You must specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Process</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">CurrentUser</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>An X.509 certificate supplied during invocation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="CertificateSubject, CertificateName"> <maml:name>CertificateSubjectName</maml:name> <maml:description> <maml:para>The subject distinguished name of a certificate. The certificate is retrieved from the current user's certificate store.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="AppId, ApplicationId"> <maml:name>ClientId</maml:name> <maml:description> <maml:para>Specifies the application ID of the service principal.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Scopes</maml:name> <maml:description> <maml:para>An array of delegated permissions to consent to.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Audience, Tenant"> <maml:name>TenantId</maml:name> <maml:description> <maml:para>Specifies the ID of a tenant.</maml:para> <maml:para>If you don't specify this parameter, the account is authenticated with the home tenant.</maml:para> <maml:para>You must specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Process</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">CurrentUser</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="UseDeviceAuthentication, DeviceCode, DeviceAuth, Device"> <maml:name>UseDeviceCode</maml:name> <maml:description> <maml:para>Use device code authentication instead of a browser control.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="AppId, ApplicationId"> <maml:name>ClientId</maml:name> <maml:description> <maml:para>Specifies the application ID of the service principal.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="ManagedIdentity, ManagedServiceIdentity, MSI"> <maml:name>Identity</maml:name> <maml:description> <maml:para>Sign-in using a managed identity</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Process</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">CurrentUser</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Audience, Tenant"> <maml:name>TenantId</maml:name> <maml:description> <maml:para>Specifies the ID of a tenant.</maml:para> <maml:para>If you don't specify this parameter, the account is authenticated with the home tenant.</maml:para> <maml:para>You must specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Process</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">CurrentUser</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="SecretCredential, Credential"> <maml:name>ClientSecretCredential</maml:name> <maml:description> <maml:para>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.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessToken</maml:name> <maml:description> <maml:para>Specifies a bearer token for Microsoft Entra service. Access tokens do time out and you have to handle their refresh.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">SecureString</command:parameterValue> <dev:type> <maml:name>SecureString</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-Entra</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Process</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">CurrentUser</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariable</maml:name> <maml:description> <maml:para>Allows for authentication using environment variables configured on the host machine. See <https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#environment-variables></maml:para> </maml:description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:description> <maml:para>Specifies the certificate thumbprint of a digital public key X.509 certificate of a user account that has permission to perform this action.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="AppId, ApplicationId"> <maml:name>ClientId</maml:name> <maml:description> <maml:para>Specifies the application ID of the service principal.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Audience, Tenant"> <maml:name>TenantId</maml:name> <maml:description> <maml:para>Specifies the ID of a tenant.</maml:para> <maml:para>If you don't specify this parameter, the account is authenticated with the home tenant.</maml:para> <maml:para>You must specify the TenantId parameter to authenticate as a service principal or when using Microsoft account.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessToken</maml:name> <maml:description> <maml:para>Specifies a bearer token for Microsoft Entra service. Access tokens do time out and you have to handle their refresh.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">SecureString</command:parameterValue> <dev:type> <maml:name>SecureString</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClientTimeout</maml:name> <maml:description> <maml:para>Sets the HTTP client timeout in seconds.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Double</command:parameterValue> <dev:type> <maml:name>System.Double</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ContextScope</maml:name> <maml:description> <maml:para>Determines the scope of authentication context. This ContextScope accepts `Process` for the current process, or `CurrentUser` for all sessions started by user.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ContextScope</command:parameterValue> <dev:type> <maml:name>ContextScope</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="EnvironmentName, NationalCloud"> <maml:name>Environment</maml:name> <maml:description> <maml:para>The name of the national cloud environment to connect to. By default global cloud is used.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoWelcome</maml:name> <maml:description> <maml:para>Hides the welcome message.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Scopes</maml:name> <maml:description> <maml:para>An array of delegated permissions to consent to.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="UseDeviceAuthentication, DeviceCode, DeviceAuth, Device"> <maml:name>UseDeviceCode</maml:name> <maml:description> <maml:para>Use device code authentication instead of a browser control.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>An X.509 certificate supplied during invocation.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="CertificateSubject, CertificateName"> <maml:name>CertificateSubjectName</maml:name> <maml:description> <maml:para>The subject distinguished name of a certificate. The certificate is retrieved from the current user's certificate store.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="SecretCredential, Credential"> <maml:name>ClientSecretCredential</maml:name> <maml:description> <maml:para>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.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">PSCredential</command:parameterValue> <dev:type> <maml:name>PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariable</maml:name> <maml:description> <maml:para>Allows for authentication using environment variables configured on the host machine. See <https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity#environment-variables></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="ManagedIdentity, ManagedServiceIdentity, MSI"> <maml:name>Identity</maml:name> <maml:description> <maml:para>Sign-in using a managed identity</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="proga"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para>The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">ActionPreference</command:parameterValue> <dev:type> <maml:name>ActionPreference</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Delegated access: Connect a PowerShell session to a tenant</maml:title> <dev:code>Connect-Entra</dev:code> <dev:remarks> <maml:para>This example shows how to connect your current PowerShell session to a Microsoft Entra ID tenant using credentials.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Delegated access: Connect a PowerShell session to a tenant with required scopes</maml:title> <dev:code>Connect-Entra -Scopes 'User.Read.All', 'Group.ReadWrite.All' Welcome to Microsoft Graph!</dev:code> <dev:remarks> <maml:para>This example shows how to authenticate to Microsoft Entra ID with scopes.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 3: Delegated access: Using an access token ------</maml:title> <dev:code>$secureString = ConvertTo-SecureString -String $AccessToken -AsPlainText -Force Connect-Entra -AccessToken $secureString Welcome to Microsoft Graph!</dev:code> <dev:remarks> <maml:para>This example shows how to interactively authenticate to Microsoft Entra ID using an access token.</maml:para> <maml:para>For more information on how to get or create access token, see Request an access token (https://learn.microsoft.com/graph/auth-v2-user#3-request-an-access-token).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 4: Delegated access: Using device code flow -----</maml:title> <dev:code>Connect-Entra -UseDeviceCode To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code A1B2CDEFGH to authenticate.</dev:code> <dev:remarks> <maml:para>This example shows how to interactively authenticate to Microsoft Entra ID using device code flow.</maml:para> <maml:para>For more information, see Device Code flow (https://learn.microsoft.com/entra/identity-platform/v2-oauth2-device-code).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: App-only access: Using client credential with a Certificate thumbprint</maml:title> <dev:code>$connectParams = @{ TenantId = 'aaaabbbb-0000-cccc-1111-dddd2222eeee' ApplicationId = '00001111-aaaa-2222-bbbb-3333cccc4444' CertificateThumbprint = 'AA11BB22CC33DD44EE55FF66AA77BB88CC99DD00' } Connect-Entra @connectParams Welcome to Microsoft Graph!</dev:code> <dev:remarks> <maml:para>This example shows how to authenticate using an ApplicationId and CertificateThumbprint.</maml:para> <maml:para>For more information on how to get or create CertificateThumbprint, see Authenticate with app-only access (https://learn.microsoft.com/powershell/entra-powershell/app-only-access-auth).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: App-only access: Using client credential with a certificate name</maml:title> <dev:code>$params = @{ ClientId = '00001111-aaaa-2222-bbbb-3333cccc4444' TenantId = 'aaaabbbb-0000-cccc-1111-dddd2222eeee' CertificateName = 'YOUR_CERT_SUBJECT' } Connect-Entra @params $Cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint Connect-Entra -ClientId '<App-Id>' -TenantId '<Tenant-Id>' -Certificate $Cert</dev:code> <dev:remarks> <maml:para>You can find the certificate subject by running the above command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 7: App-only access: Using client credential with a certificate</maml:title> <dev:code>$Cert = Get-ChildItem Cert:\LocalMachine\My\$CertThumbprint $params = @{ ClientId = '00001111-aaaa-2222-bbbb-3333cccc4444' TenantId = 'aaaabbbb-0000-cccc-1111-dddd2222eeee' Certificate = $Cert } Connect-Entra @params</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 8: App-only access: Using client secret credentials -</maml:title> <dev:code>$ClientSecretCredential = Get-Credential -Credential '00001111-aaaa-2222-bbbb-3333cccc4444' # Enter client_secret in the password prompt. Connect-Entra -TenantId 'aaaabbbb-0000-cccc-1111-dddd2222eeee' -ClientSecretCredential $ClientSecretCredential</dev:code> <dev:remarks> <maml:para>This authentication method is ideal for background interactions.</maml:para> <maml:para>For more information on how to get credential, see Get-Credential (https://learn.microsoft.com/powershell/module/microsoft.powershell.security/get-credential)command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 9: App-only access: Using managed identity: System-assigned managed identity</maml:title> <dev:code>Connect-Entra -Identity</dev:code> <dev:remarks> <maml:para>Uses an automatically managed identity on a service instance. The identity is tied to the lifecycle of a service instance.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 10: App-only access: Using managed identity: User-assigned managed identity</maml:title> <dev:code>Connect-Entra -Identity -ClientId 'User_Assigned_Managed_identity_Client_Id'</dev:code> <dev:remarks> <maml:para>Uses a user created managed identity as a standalone Azure resource.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 11: Connecting to an environment as a different identity</maml:title> <dev:code>Connect-Entra -ContextScope 'Process' Welcome to Microsoft Graph!</dev:code> <dev:remarks> <maml:para>To connect as a different identity other than CurrentUser, specify the ContextScope parameter with the value Process.</maml:para> <maml:para>For more information on how to get the current context, see Get-EntraContext (https://learn.microsoft.com/powershell/module/Microsoft.Entra/get-entracontext)command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 12: Connecting to an environment or cloud ------</maml:title> <dev:code>Get-EntraEnvironment Name AzureADEndpoint GraphEndpoint Type ---- --------------- ------------- ---- China https://login.chinacloudapi.cn https://microsoftgraph.chinacloudapi.cn Built-in Global https://login.microsoftonline.com https://graph.microsoft.com Built-in USGov https://login.microsoftonline.us https://graph.microsoft.us Built-in USGovDoD https://login.microsoftonline.us https://dod-graph.microsoft.us Built-in Connect-Entra -Environment 'Global'</dev:code> <dev:remarks> <maml:para>When you use Connect-Entra, you can choose to target other environments. By default, Connect-Entra targets the global public cloud.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 13: Sets the HTTP client timeout in seconds -----</maml:title> <dev:code>Connect-Entra -ClientTimeout 60 Welcome to Microsoft Graph!</dev:code> <dev:remarks> <maml:para>This example Sets the HTTP client timeout in seconds.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 14: Hides the welcome message ------------</maml:title> <dev:code>Connect-Entra -NoWelcome</dev:code> <dev:remarks> <maml:para>This example hides the welcome message.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 15: Allows for authentication using environment variables</maml:title> <dev:code>Connect-Entra -EnvironmentVariable</dev:code> <dev:remarks> <maml:para>This example allows for authentication using environment variables.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Connect-Entra</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-Entra</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Disconnect-Entra</command:name> <command:verb>Disconnect</command:verb> <command:noun>Entra</command:noun> <maml:description> <maml:para>Disconnects the current session from a Microsoft Entra ID tenant.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Disconnect-Entra cmdlet disconnects the current session from a Microsoft Entra ID tenant.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Disconnect-Entra</maml:name> </command:syntaxItem> </command:syntax> <command:parameters /> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------- Example 1: Disconnect your session from a tenant -------</maml:title> <dev:code>Disconnect-Entra ClientId : 00001111-aaaa-2222-bbbb-3333cccc4444 TenantId : bbbbcccc-1111-dddd-2222-eeee3333ffff Scopes : {Agreement.ReadWrite.All, CustomSecAttributeDefinition.ReadWrite.All, TeamMember.Read.All...} AuthType : AppOnly TokenCredentialType : ClientCertificate CertificateThumbprint : AA11BB22CC33DD44EE55FF66AA77BB88CC99DD00 CertificateSubjectName : Account : AppName : MG_graph_auth ContextScope : Process Certificate : PSHostVersion : 5.1.22621.2506 ManagedIdentityId : ClientSecret : Environment : Global</dev:code> <dev:remarks> <maml:para>This command disconnects your session from a tenant.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Disconnect-Entra</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-Entra</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-EntraContext</command:name> <command:verb>Get</command:verb> <command:noun>EntraContext</command:noun> <maml:description> <maml:para>Retrieve information about your current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>`Get-EntraContext` is used to retrieve the details about your current session, which include: - ClientID</maml:para> <maml:para>- TenantID</maml:para> <maml:para>- Certificate Thumbprint</maml:para> <maml:para>- Scopes consented to</maml:para> <maml:para>- AuthType: Delegated or app-only</maml:para> <maml:para>- AuthProviderType</maml:para> <maml:para>- CertificateName</maml:para> <maml:para>- Account</maml:para> <maml:para>- AppName</maml:para> <maml:para>- ContextScope</maml:para> <maml:para>- Certificate</maml:para> <maml:para>- PSHostVersion</maml:para> <maml:para>- ClientTimeOut.</maml:para> <maml:para></maml:para> <maml:para>`Get-EntraCurrentSessionInfo` is an alias for `Get-EntraContext`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-EntraContext</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="named" aliases="none"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="named" aliases="none"> <maml:name>ProgressAction</maml:name> <maml:description> <maml:para></maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para>Please note that `Get-EntraCurrentSessionInfo` is now an alias for `Get-EntraContext` and can be used interchangeably.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Get the current session --------------</maml:title> <dev:code>Get-EntraContext ClientId : 11112222-bbbb-3333-cccc-4444dddd5555 TenantId : aaaabbbb-0000-cccc-1111-dddd2222eeee CertificateThumbprint : Scopes : {User.ReadWrite.All,...} AuthType : Delegated AuthProviderType : InteractiveAuthenticationProvider CertificateName : Account : SawyerM@Contoso.com AppName : Microsoft Graph PowerShell ContextScope : CurrentUser Certificate : PSHostVersion : 5.1.17763.1 ClientTimeout : 00:05:00</dev:code> <dev:remarks> <maml:para>This example demonstrates how to retrieve the details of the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 2: Get the current session scopes ----------</maml:title> <dev:code>Get-EntraContext | Select -ExpandProperty Scopes AppRoleAssignment.ReadWrite.All Directory.AccessAsUser.All EntitlementManagement.ReadWrite.All Group.ReadWrite.All openid Organization.Read.All profile RoleManagement.ReadWrite.Directory User.Read User.ReadWrite.All</dev:code> <dev:remarks> <maml:para>Retrieves all scopes.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Get-EntraContext</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Revoke-EntraBetaSignedInUserAllRefreshToken</command:name> <command:verb>Revoke</command:verb> <command:noun>EntraBetaSignedInUserAllRefreshToken</command:noun> <maml:description> <maml:para>Invalidates the refresh tokens issued to applications for the current user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Revoke-EntraBetaSignedInUserAllRefreshToken` cmdlet invalidates all the refresh tokens issued to applications for a user (as well as session cookies in a user's browser), by resetting the signInSessionsValidFromDateTime user property to the current date-time.</maml:para> <maml:para>Typically, this operation is performed (by the user or an administrator) if the user has a lost or stolen device. This operation prevents access to the organization's data through applications on the device by requiring the user to sign in again to all applications that they have previously consented to, independent of device.</maml:para> <maml:para>Note: If the application attempts to redeem a delegated access token for this user by using an invalidated refresh token, the application will get an error. If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint, which will force the user to sign in.</maml:para> <maml:para>After running this command, there might be a small delay of a few minutes before tokens are revoked.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Revoke-EntraBetaSignedInUserAllRefreshToken</maml:name> </command:syntaxItem> </command:syntax> <command:parameters /> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---- Example 1: Revoke refresh tokens for the current user ----</maml:title> <dev:code>Connect-Entra -Scopes 'User.RevokeSessions.All' Revoke-EntraBetaSignedInUserAllRefreshToken Value ----- True</dev:code> <dev:remarks> <maml:para>This command revokes the tokens for the current user.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Revoke-EntraBetaSignedInUserAllRefreshToken</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Revoke-EntraBetaUserAllRefreshToken</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Revoke-EntraBetaUserAllRefreshToken</command:name> <command:verb>Revoke</command:verb> <command:noun>EntraBetaUserAllRefreshToken</command:noun> <maml:description> <maml:para>Invalidates the refresh tokens issued to applications for a user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Revoke-EntraBetaUserAllRefreshToken` cmdlet invalidates the refresh tokens issued to applications for a user.</maml:para> <maml:para>The cmdlet also invalidates tokens issued to session cookies in a browser for the user.</maml:para> <maml:para>The cmdlet operates by resetting the refreshTokensValidFromDateTime user property to the current date and time.</maml:para> <maml:para>The user or an administrator usually performs this operation if the user's device is lost or stolen. It blocks access to the organization's data by requiring the user to sign in again to all previously authorized applications, regardless of the device</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Revoke-EntraBetaUserAllRefreshToken</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="named" aliases="ObjectId"> <maml:name>UserId</maml:name> <maml:description> <maml:para>Specifies the unique ID of a user.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="named" aliases="ObjectId"> <maml:name>UserId</maml:name> <maml:description> <maml:para>Specifies the unique ID of a user.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Revoke refresh tokens for a user ---------</maml:title> <dev:code>Connect-Entra -Scopes 'User.RevokeSessions.All' Revoke-EntraBetaUserAllRefreshToken -UserId 'SawyerM@contoso.com' Value ----- True</dev:code> <dev:remarks> <maml:para>This example demonstrates how to revoke the tokens for the specified user.</maml:para> <maml:para>- `-UserId` parameter specifies the unique identifier of a user.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Revoke-EntraBetaUserAllRefreshToken</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Revoke-EntraBetaSignedInUserAllRefreshToken</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |