1 00:00:02,140 --> 00:00:05,160 As I had mentioned previously, PowerShell can also be used to view 2 00:00:05,160 --> 00:00:08,440 system health and user activity information. 3 00:00:08,440 --> 00:00:09,680 So to view system health, 4 00:00:09,680 --> 00:00:16,140 the command to do that is Get‑RemoteAccessHealth, and this will give 5 00:00:16,140 --> 00:00:19,170 you a high‑level overview of the system health. 6 00:00:19,170 --> 00:00:22,090 Now you'll see there's a lot of these that don't apply and they show as 7 00:00:22,090 --> 00:00:25,320 Disabled in the HealthState, so you can actually filter out any output 8 00:00:25,320 --> 00:00:31,860 where HealthState is set to Disabled to eliminate some of that noise. 9 00:00:31,860 --> 00:00:36,620 That cleans that up just a little bit. 10 00:00:36,620 --> 00:00:37,090 So anyway, 11 00:00:37,090 --> 00:00:40,640 this information can be used programmatically to determine system health. 12 00:00:40,640 --> 00:00:43,370 You can also use PowerShell to view user activity. 13 00:00:43,370 --> 00:00:47,460 So if we want to look at the remote access connection summary or the 14 00:00:47,460 --> 00:00:50,940 connection statistics summary, the PowerShell command for that is 15 00:00:50,940 --> 00:00:57,240 Get‑RemoteAccessConnectionStatisticsSummary. 16 00:00:57,240 --> 00:00:59,440 And here you'll see this outputs the same information that 17 00:00:59,440 --> 00:01:02,860 we saw in the UI, our TotalConnections, our 18 00:01:02,860 --> 00:01:06,660 TotalUniqueUsers, MaximumConcurrentConnections, 19 00:01:06,660 --> 00:01:09,790 the total amount of data that's been transferred, and so forth. 20 00:01:09,790 --> 00:01:14,420 And, again, this comes from the same data repository, and as I had 21 00:01:14,420 --> 00:01:17,810 mentioned before, when you're looking at this in the UI, all of these 22 00:01:17,810 --> 00:01:22,210 numbers get reset if the service is restarted or if the VPN server is 23 00:01:22,210 --> 00:01:25,720 rebooted, and that same applies here. 24 00:01:25,720 --> 00:01:27,170 So if you're looking at this data, 25 00:01:27,170 --> 00:01:30,740 this is all valuable data since the last time the service 26 00:01:30,740 --> 00:01:33,340 was restarted or the system was rebooted. 27 00:01:33,340 --> 00:01:36,670 We can actually also use PowerShell to look at current sessions, and 28 00:01:36,670 --> 00:01:42,940 that command is Get‑RemoteAccessConnectionStatistics. And here you'll 29 00:01:42,940 --> 00:01:45,440 see all of the current active sessions. 30 00:01:45,440 --> 00:01:49,120 If you'd like to look at what's available to you in each of these sessions, 31 00:01:49,120 --> 00:01:59,090 we'll filter it by an individual user, and here you have all of the 32 00:01:59,090 --> 00:02:03,340 information that's in that individual record that you can report on. 33 00:02:03,340 --> 00:02:04,020 And finally, 34 00:02:04,020 --> 00:02:06,430 you can actually view historical data using the 35 00:02:06,430 --> 00:02:09,190 Get‑RemoteAccessConnectionStatistics command. 36 00:02:09,190 --> 00:02:26,000 You just need to supply a start date and an end date, and it will pull up all of the historical information during that timeframe.