Hi ,
Based on my understanding, you want to run the command of Get-RemoteAccessConnectionStatistics to build a list or array of the UserNames, then pipe that into the command of Get-RemoteAccessUserActivity? Is that right? Please feel free to let me correct me if my understanding is wrong.
Here is a similar thread discussed before, you could have a look:
Windows VPN Server (RRAS) User Activity Export
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
If it still doesn't help you, I would suggest you have this asked in PowerShell forum to know how to tie the information together with two cmdlets.
Best Regards,
Candy
--------------------------------------------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.