is it possible to Remove or Add a Pi-Server from a Client PC(SDK + Prozess Book) with a script?
I have only found a Silend full install with adding a default Server.
Clients such as ProcessBook, PISDK Utility, and DataLink all get their list of known servers from the Known Servers Table (KST). This table can be manually adjusted using the PISDK Utility, however, the contents for this table are housed in the registry at HKLM\SOFTWARE\PISystem\PI-SDK\1.0
It sounds like you are trying to roll out removing a known server for a bunch of clients, is this correct? If so, unfortunately there is no easy out of the box way to do this. However, you could take an existing entry for a known server you would like to remove, then export as a .reg file. This is basically a script that can be run to add, modify, or remove entries from the registry. This file can then be slightly edited according to the following article so that the KST entry is removed. (Simply add "-" before the key paths to signal a remove)
For example, for the lines in the exported .reg file where the path is supplied, add a "-" so that the line looks as such:
This .reg file could then be rolled out to many clients via an IT update package or other means. Keep in mind that this is making direct changes to the registry, so you should test prior to rolling out to other clients.
Hope this helps!
- Adam Fink
This is great
Have a look at the PowerShell script option in this forum thread. Note that this relies on using the OSIsoft PowerShell cmdlets, so you would have to have those available either on the client machine, or see if you can adapt the script for remoting. I haven't tried this myself yet with the OSIsoft cmdlets (it's on the to-do list).
If this isn't an option for you, then a simple script to deploy a registry key file update along the lines of Adam Fink's suggestion is the other way - I've seen and implemented similar KST updates to this option before.
We've had a few cases where we needed to push out changes to clients.
I'd reccomend pushing a regestry change via AD/GPO or similar. The PowerShell option is a good option but as John mentioned it requres OSIsoft.PowerShell which have to manually be installed (installed automatically with PI System Managment Tools ~2014 and newer)
With previous experience, i have used AF SDK to clean KST and add new PI Server. Please note that default PI server cannot be removed unless a new PI server is added and made it as default PI server. I have created a AF SDK console application where Admin team and push and run on all PI machines which automatically adds new PI server and cleans old PI server. Other option would be using a vbscript for editing the registry but always recommend to use AF SDK .
Retrieving data ...