Would like to compile a list of users using PI Data Link. How to track the list of PI Data Link users?
The easiest way to track which users are using DataLink is to look in the message logs on your PI Data Archive(s) for connections from EXCEL.EXE which is the process which connects to the server when a user uses DataLink. If your users are authenticating using Windows Integrated Security then the data archive will log their user account as part of the connection attempt. The following powershell script will output all connection messages (messages with ID 7082) from the EXCEL.EXE application over the last 35 days (the length of time for which the PI Data Archive keeps message logs by default).
$PIServer = "MY PI SERVER"$start = (Get-Date).AddDays(-35)$end = (Get-Date)$con = Connect-PIDataArchive -PIDataArchiveMachineName $PIServerGet-PIMessage -Connection $con -StartTime $start -EndTime $end -Message "*Excel.exe*" -Id 7082
Note that if you have multiple PI Data Archives and/or a collective then you will need to run this script against each server/collective member.
In order for this to work, your PI Data Archive's version needs to be 2016 R2 or higher.
Below command from PI Data server will show you and more options and details are in this part of the user guide:
PI\ADM> pidiag.exe -connectionhistory
Thanks for your help. The script provided is working and I've amended according to my needs. Thanks a lot. Very useful.
Retrieving data ...