Get-RdsDiagnosticActivities

获取系统中用户操作的详细信息。

语法

Get-RdsDiagnosticActivities
   [-StartTime <DateTime>]
   [-EndTime <DateTime>]
   [-ActivityType <ActivityType>]
   [-UserName <String>]
   [-ActivityId <Guid>]
   [-Outcome <Outcome>]
   [-TenantName <String>]
   [-Deployment]
   [-Detailed]
   [<CommonParameters>]

说明

Get-RdsDiagnosticActivities cmdlet 获取系统中用户操作的详细信息,无论是出于最终用户还是管理目的。 活动列表可以按以下参数进行筛选:

  • ActivityId
  • 活动类型
  • 业务成效
  • StartTime (,也可以选择 EndTime)
  • UserName

可以将多个筛选器合并到单个查询中。 如果未指定开始时间或时间范围,则只会收到过去一小时的活动列表。 还可以使用 -Detailed 参数进行查询,以接收有关每个活动的其他信息。 每个活动的其他信息因活动类型而异。

示例

示例 1:检索租户中的基本诊断活动

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso"

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           :
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       :
Errors            :

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Feed
StartTime         : 1/1/2018 3:52:20 PM
EndTime           : 1/1/2018 3:52:26 PM
UserName          : user2@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           :
LastHeartbeatTime : 1/1/2018 3:52:26 PM
Checkpoints       :
Errors            :

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Management
StartTime         : 1/1/2018 3:44:54 PM
EndTime           : 1/1/2018 3:44:54 PM
UserName          : admin@contoso.com
RoleInstances     : mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           : 
LastHeartbeatTime : 1/1/2018 3:44:54 PM
Checkpoints       : 
Errors            : 

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:14:15 AM
EndTime           : 1/1/2018 3:18:00 AM
UserName          : user2@contoso.com
RoleInstances     : user2client.contoso.com;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782C3626;mrs-eus2r0c001-rdbroker-prod::RD28187853BC78;sh1.contoso.com;
Outcome           : Success
Status            : Completed
Details           : 
LastHeartbeatTime : 1/1/2018 3:18:00 AM
Checkpoints       : 
Errors            :

此命令获取指定租户的活动。 通过在未指定时间范围的情况下运行 Get-RdsDiagnosticActivities cmdlet,将仅接收过去一小时的活动。

示例 2:检索租户中的详细诊断活动

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           : {[ClientOS, ], [ClientVersion, ], [ClientType, ], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       : {RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress...}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Feed
StartTime         : 1/1/2018 3:52:20 PM
EndTime           : 1/1/2018 3:52:26 PM
UserName          : user2@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, Win32 Chrome 70.0.3538.110], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [ClientIPAddress, ]...}
LastHeartbeatTime : 1/1/2018 3:52:26 PM
Checkpoints       : {TenantListComplete, TenantResourceComplete}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Management
StartTime         : 1/1/2018 3:44:54 PM
EndTime           : 1/1/2018 3:44:54 PM
UserName          : admin@contoso.com
RoleInstances     : mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           : {[Object, /RdsManagement/V1/TenantGroups/Default%20Tenant%20Group/Tenants/Contoso], [Method, Get], [Route,
                    Tenant::GetTenantAsync], [ObjectsFetched, 1]...}
LastHeartbeatTime : 1/1/2018 3:44:54 PM
Checkpoints       : {}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:14:15 AM
EndTime           : 1/1/2018 3:18:00 AM
UserName          : user2@contoso.com
RoleInstances     : user2client.contoso.com;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782C3626;mrs-eus2r0c001-rdbroker-prod::RD28187853BC78;sh1.contoso.com;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, WINDOWS 10.0.17763], [ClientVersion, 10.0.17763.1], [ClientType, MSTSC], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 3:18:00 AM
Checkpoints       : {LoadBalancedNewConnection, RdpStackAuthenticaticatedUser, RdpStackAuthorization, OnConnected...}
Errors            : {}

此命令获取指定租户的详细活动。

示例 3:检索特定活动的详细诊断

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -ActivityGuid "xxxx-xxxx-xxxx-xxxx-xxxx" -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           : {[ClientOS, ], [ClientVersion, ], [ClientType, ], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       : {RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress...}
Errors            : {}

此命令获取特定的详细活动。

示例 4:检索特定用户的详细诊断

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -UserName "user2@contoso.com" -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Feed
StartTime         : 1/1/2018 3:52:20 PM
EndTime           : 1/1/2018 3:52:26 PM
UserName          : user2@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, Win32 Chrome 70.0.3538.110], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [ClientIPAddress, ]...}
LastHeartbeatTime : 1/1/2018 3:52:26 PM
Checkpoints       : {TenantListComplete, TenantResourceComplete}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:14:15 AM
EndTime           : 1/1/2018 3:18:00 AM
UserName          : user2@contoso.com
RoleInstances     : user2client.contoso.com;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782C3626;mrs-eus2r0c001-rdbroker-prod::RD28187853BC78;sh1.contoso.com;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, WINDOWS 10.0.17763], [ClientVersion, 10.0.17763.1], [ClientType, MSTSC], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 3:18:00 AM
Checkpoints       : {LoadBalancedNewConnection, RdpStackAuthenticaticatedUser, RdpStackAuthorization, OnConnected...}
Errors            : {}

此命令获取与指定用户名关联的详细活动。

示例 5:按开始时间检索详细诊断

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -StartTime "1/1/2018 3:45:00 PM" -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           : {[ClientOS, Win32 Edge 18.17763], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       : {RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress...}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Feed
StartTime         : 1/1/2018 3:52:20 PM
EndTime           : 1/1/2018 3:52:26 PM
UserName          : user2@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdbroker-prod-staging::RD28187853BC78;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, Win32 Chrome 70.0.3538.110], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [ClientIPAddress, ]...}
LastHeartbeatTime : 1/1/2018 3:52:26 PM
Checkpoints       : {TenantListComplete, TenantResourceComplete}
Errors            : {}

此命令获取在指定时间后完成或截至指定时间一直在进行的详细活动。

示例 6:按开始时间和结束时间检索详细诊断

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -StartTime "1/1/2018 3:45:00 PM" -EndTime "1/1/2018 3:50:00 PM" -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           : {[ClientOS, Win32 Edge 18.17763], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       : {RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress...}
Errors            : {}

此命令获取在指定时间内已完成或自指定时间范围以来一直持续的详细活动。

示例 7:按活动类型检索详细诊断

PS C:\> Get-RdsDiagnosticActivities -TenantName "contoso" -ActivityType Connection -Detailed

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:20:00 PM
EndTime           :
UserName          : user1@contoso.com
RoleInstances     : rdwebclient;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782CE977;mrs-eus2r0c001-rdbroker-prod-staging::RD2818785C1CF1;sh1.contoso.com;
Outcome           :
Status            : Ongoing
Details           : {[ClientOS, Win32 Edge 18.17763], [ClientVersion, 1.0.4-wvd], [ClientType, HTML], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 4:01:00 PM
Checkpoints       : {RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress, RdpConnectionProgress...}
Errors            : {}

ActivityId        : xxxx-xxxx-xxxx-xxxx-xxxx
ActivityType      : Connection
StartTime         : 1/1/2018 3:14:15 AM
EndTime           : 1/1/2018 3:18:00 AM
UserName          : user2@contoso.com
RoleInstances     : user2client.contoso.com;mrs-eus2r0c001-rdgateway-prod-staging::RD2818782C3626;mrs-eus2r0c001-rdbroker-prod::RD28187853BC78;sh1.contoso.com;
Outcome           : Success
Status            : Completed
Details           : {[ClientOS, WINDOWS 10.0.17763], [ClientVersion, 10.0.17763.1], [ClientType, MSTSC], [PredecessorConnectionId, ]...}
LastHeartbeatTime : 1/1/2018 3:18:00 AM
Checkpoints       : {LoadBalancedNewConnection, RdpStackAuthenticaticatedUser, RdpStackAuthorization, OnConnected...}
Errors            : {}

此命令获取与指定活动类型匹配的详细活动。

参数

-ActivityId

活动的 ID。

类型:Guid
别名:Id
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-ActivityType

活动的类型。 活动分为以下类别:

  • 连接
  • 管理
类型:ActivityType
别名:Type
接受的值:Connection, Management, Feed, RegistrationToken
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Deployment

特定于 Windows 虚拟桌面的范围。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Detailed

指示返回每个活动的更多详细信息的开关。 返回的其他信息将因每个活动的类型而异。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-EndTime

用作查询活动的上限的日期时间。

类型:DateTime
别名:End
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Outcome

活动的结果。 活动可以有以下两种结果之一:

  • 成功
  • 失败
类型:Outcome
接受的值:Success, Failure
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-StartTime

用作查询活动的下限的日期时间。

类型:DateTime
别名:Start
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-TenantName

与活动关联的租户的名称。

类型:String
别名:Tenant
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-UserName

用户主体名称 (与活动关联的用户的 UPN) 。

类型:String
别名:User
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

输入

System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

System.Nullable`1[[Microsoft.RDInfra.Diagnostics.Common.ActivityType, Microsoft.RDInfra.Diagnostics.Common, Version=1.0.0.1, Culture=neutral, PublicKeyToken=99498ce06f56ba9d]]

System.String

System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

System.Nullable`1[[Microsoft.RDInfra.Diagnostics.Common.Outcome, Microsoft.RDInfra.Diagnostics.Common, Version=1.0.0.1, Culture=neutral, PublicKeyToken=99498ce06f56ba9d]]

System.Management.Automation.SwitchParameter

输出

System.Object