Sample using the vPro Module

The following PowerShell code snippet demonstrates how to use the KVM proxy library API. The snippet, like other PowerShell snippets in the SDK, depend on the Intel vPro Scripting Library.

 

Import-Module 'IntelvPro'

Add-Type -Path # Path of the VNCViewer dll (RealVNC.VNCViewerSDK.dll)

 

$kvmLib = New-Object Intel.Management.Redirection.KVMRedirection

$result = $kvmLib.Init()

if($result -eq 0)    

{

    $viewer = [RealVNC.VNCViewerSDK.VNCViewerSDK]::CreateViewer($true)

    # Fill the connection information.

    $kvmLib.Host = "192.168.0.1"

    $kvmLib.UserName = "myUser"

    $kvmLib.Password = "P@ssw0rd"

    $kvmLib.Port = 16994

    $proxyPort = 0

   

    # Open the KVM session via redirection port.

    $result = $kvmLib.Start([ref]$proxyPort)

    if($result -eq 0)

    {

          $viewer.Start("127.0.0.1:" + $proxyPort)

    }

    # Close the session.

    $result = $kvmLib.Stop()

    # Close the library.

    $result = $kvmLib.Deinit()

}

 

 

Copyright © 2006-2022, Intel Corporation. All rights reserved.