Get-EntraContext
Hämta information om din aktuella session
Syntax
GetQuery (Standard)
Get-EntraContext
Description
Get-EntraContext används för att hämta information om den aktuella sessionen, bland annat:
- Klient-ID
- TenantID
- Tumavtryck för certifikat
- Omfång som godkänts för
- AuthType: Delegerad eller endast app
- AuthProviderType
- CertificateName
- Konto
- AppName
- ContextScope
- Certificate
- PSHostVersion
- ClientTimeOut.
Get-EntraCurrentSessionInfo är ett alias för Get-EntraContext.
Exempel
Exempel 1: Hämta den aktuella sessionen
Get-EntraContext
EntraPSModuleName : Microsoft.Entra.Authentication
EntraPSVersion : 1.0.1
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
Det här exemplet visar hur du hämtar information om den aktuella sessionen.
Exempel 2: Hämta de aktuella sessionsomfattningarna
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
Hämtar alla omfång.