I need develop an application that returns information about a registered PI trust in MS Excel worksheet. I know that theoretically it's possible, but how?
Do you want to list the PI Trust details from a server?
Or are you looking for information of which PI Trust a particular connection has been assigned (from the NetMgr Statistics)?
You can poke around the PI SDK and do this...but perhaps you should use the PowerShell Tools for the PI System instead?
I want to see in a MS Excel spreadsheet the trust and the PI User associated with that trust.
How about using the Security add-in to PI SMT. It supports exporting the trust table to XML. I've just tried this and you get the trust table to Excel without writing a single line of code.
If you don't like Gregor's suggestion, another easy alternative is to create a piconfig script to generate a CSV file which can be opened in Excel on a spreadsheet.
My order of preference here would be: PI-SMT (Gregor's suggestion), Powershell Tools for the PI System, "poke around PI SDK". Each of these don't require access to the PI Server host machine...I guess the piconfig approach is okay if the csv is delivered to the end user. Depends on whether you need to continuously check these details or just do it as a one-off / infrequently.
A while ago piconfig has been enhanced to support remote connections against the PI Data Archive. Explicit user login (not recommended), PI Trust and Windows Integrated Security (WIS) are supported authentication methods. I wouldn't really recommend using piconfig.exe as data access method because handling the responses can be challenging especially if the response contains some unforeseen information. It's however possible to programmatically interact with PI Data Archives through piconfig.exe using the .NET Process class. Synchronous and asynchronous operation is possible and the performance is not bad. For the purpose of getting the Trust table into Microsoft Excel, I would not consider the effort reasonable.
Retrieving data ...