To get list of interfaces via powershell.

Hello,

I would like to how can i get the interface list(similar to SMT-->Interfaces-->Interface list) from powershell.

Thanks,

Rupesh

  • Hi PI team, correct me if I'm wrong.

     

    Sure, here's how you can get a list of interfaces using PowerShell, similar to what you see in SMT (System Management Tools):

    1.Install PowerShell Tools for the PI System: Ensure you have the PowerShell Tools for the PI System installed. These tools are included with PI System Management Tools (SMT).

    2.Import the Module: Import the OSIsoft.PowerShell module if it's not already imported.

    <Import-Module OSIsoft.PowerShell>

    3.Connect to the PI Data Archive: Use the Connect-PIDataArchive cmdlet to connect to your PI Data Archive.

    <$piServer = "YourPIServerName">

    <Connect-PIDataArchive -PIDataArchiveMachineName $piServer>

    4.Retrieve the Interface List: Use the Get-PIInterface cmdlet to retrieve the list of interfaces.

    <$interfaces = Get-PIInterface -PIDataArchiveMachineName $piServer $interfaces>

    This script will connect to your PI Data Archive and retrieve the list of interfaces, similar to what you would see in SMT under Interfaces.

     

     

  • Hello ​,

    Thanks for your swift reply on this.

    I have checked the command "Get-PIInterface", but could not find this command in OSIsoft.powershell.

    Even i checked it on AvevaDoc(https://docs.aveva.com/bundle/pi-powershell/page/html/R_Project_PI_Powershell.htm) as well, but could not find "Get-PIInterface".

     

    Thanks,

    Rupesh

  • Hello ​ ,

    I also don't see a Get-PIInterface cmdlet with OSIsoft.Powershell and believe ​ will have some customization including a Get-PIInterface cmdlet.

    PI Interfaces registrations, if configured using PI ICU, are persisted to the PI Module Database (MDB) which appears not accessible through OSIsoft.Powershell and I know that using AF SDK is also not an option because AF SDK doesn't provide access to the MDB. You will have to look into using PI SDK or a dependent Developer Technology like PI OLEDB Provider.