Get-CsUserSession

Use the Get-CsUserSession cmdlet to retrieve user session information within a specified date range within the past 30 days.

Syntax

Get-CsUserSession
   -StartTime <DateTimeOffset>
   -User <String>
   [-EndTime <DateTimeOffset>]
   [-AsJob]
   [<CommonParameters>]

Description

Use the Get-CsUserSession cmdlet to retrieve session information for users within a specified date range within the past 30 days.

To return a list of all the Role-Based Access Control (RBAC) roles a cmdlet has been assigned to (including any custom RBAC roles you have created), run the following command:

Get-CsAdminRole | Where-Object {$_.Cmdlets -Match "\<DesiredCmdletName\>"}

Examples

-------------------------- Example 1 --------------------------

Get-CsUserSession -User "Ken.Myer@Contoso.com" -StartTime "02/22/2016 07:30:15 PM"

This example returns user session information for Ken Myer from "02/22/2016 07:30:15 PM" to the current date.

Required Parameters

-StartTime

Specifies the start date, time and offset of the date range.

Type:DateTimeOffset
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Skype for Business Online
-User

Specifies the user whose session data will be retrieved. The input format is any form of user URI defined in Skype for Business Online. For instance: -User "Ken.Myer@Contoso.com".

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Skype for Business Online

Optional Parameters

-AsJob

Indicates that this cmdlet runs as a background job.

When you specify the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. The job is created on the local computer and the results from the Skype for Business Online session are automatically returned to the local computer. To get the job results, use the Receive-Job cmdlet.

For more information about Windows PowerShell background jobs, see about_Jobs and about_Remote_Jobs.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Skype for Business Online
-EndTime

Specifies the end date, time and offset of the date range.

Type:DateTimeOffset
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Skype for Business Online

Inputs

None.

Outputs

The Get-CsUserSession cmdlet returns an instance of the Microsoft.Rtc.Management.Hosted.Data.UserSession object.