Commands › Microsoft Teams

Get-CsOnlineUser

Microsoft Teams MicrosoftTeams Get-*

Returns information about users who have accounts homed on Microsoft Teams or Skype for Business Online.

Quick start script

# Get-CsOnlineUser — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Run and inspect
Get-CsOnlineUser | Format-List

# 3. Export for evidence / drift tracking
Get-CsOnlineUser | Export-Clixml .\CsOnlineUser-$(Get-Date -Format yyyyMMdd).xml

Syntax

Get-CsOnlineUser [[-Identity] <UserIdParameter>]
 [-AccountType <String>]
 [-Filter <String>]
 [-Properties <String>]
 [-ResultSize <Unlimited>]
 [-SkipUserPolicies]
 [-SoftDeletedUser]
 [-Sort]
 [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-AccountType UserIdParameter This parameter is added to Get-CsOnlineUser starting from TPM 4.5.1 to indicate the user type. The possible values for the AccountType parameter are:
-Filter String Enables you to limit the returned data by filtering on specific attributes. For example, you can limit returned data to users who have been assigned a specific voice policy, or users who have not been assigned a...
-Identity UserIdParameter Indicates the Identity of the user account to be retrieved.
-Properties String Allows you to specify the properties you want to include in the output. Provide the properties as a comma-separated list. Identity, UserPrincipalName, Alias, AccountEnabled and DisplayName attributes will always be...
-ResultSize Unlimited **Note**: Starting with Teams PowerShell Modules version 4.0 and later, "-ResultSize" type has been changed to uint32.
-SkipUserPolicies SwitchParameter PARAMVALUE: SwitchParameter
-SoftDeletedUser SwitchParameter This parameter enables you to return a collection of all the users who are deleted and can be restored within 30 days from their deletion time
-Sort String Sorting is now enabled in Teams PowerShell Module by using the "-Sort" or "-OrderBy" parameters. For example:

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.