I'm trying to find a way to get the install date and time of the current Pi Server. I want to get this via the AF SDK.
This information is not exposed in the AF SDK. It is possible to find installation date in the registry and this can be done via Powershell. I'm not sure of other methods to programmatically get this information though. how to get installation date of an application in windows
What you are asking for is what we refer to as FirstRun and as Barry mentioned, this information is not exposed through any of our Developer Technologies. Nonetheless the information is accessible remotely and programmatic access is possible.
Probably the easiest way is through PI SMT -> Operation -> Licensing -> section Usage -> FirstRun.
Another approach is using piartool.exe and the cool thing is that it works remote or on the PI Server in a command prompt:
cd /d %pihome%
piartool -node <PIDataArchive> -windows -lic usage
On a PI Data Archive host replace %pihome% with %piserver% and for sure host information and authentication is than optional.
-node precedes the host name of the PI Data Archive node or IP address.
-windows refers Windows Integrated Security and means that you would like to authenticate through the logged on Windows user. Alternatively you can use -trust
-lic usage lists the license usage information
Finally, I like to suggest OSIsoft.PowerShell which shouldn't require additional explanation after the above. And for sure this works remote too.
$conn = Connect-PIDataArchive -PIDataArchiveMachineName PIServer -AuthenticationMethod Trust
$LicRep = Get-PILicenseReport -Connection $conn
Retrieving data ...