I have talked about the Intel vPro hardware based KVM. I received feedback on my post about starting KVM that it would be nice to have a short Cmdlet to

easily turn the KVM feature on and off. So here it is!

 

There are many different ways to perform the action of toggling the KVM enabled state - I decided to use the Intel vPro AmtSystem PowerShell drive provider. Please don't think that this is the easiest, elegant-ist or only way...it is just the one I chose. Your feedback is always welcome.

 

For efficiency I started with the get-amtfirmwareversion.ps1 source located at C:\Program Files\Intel Corporation\PowerShell\Modules\IntelvPro...assuming the default install location. This source was used so I can leverage all of the parameter passing and AmtSystem drive provider logic.

 

First I removed the function header and the signature block and renamed the file "set-AMTKVM.ps1".

 

Now, what parameters do we need? Just a verb for on and off. but those seem a little informal and vague. Let's settle on enable and disable.

 

First add the new enable/disable parameter. Mandatory, yes. And let's only accept the strings "enable" and "disable":

[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$false, position=1,

HelpMessage="Intel vPro KVM 'enable' or 'disable'")][ValidateSet("enable","disable")][String] $StateToset

 

Next, remove the lines we do not need:

Get-Item $tempAMTPSDrive":\Config\Etc\CodeVersions\AMT FW Core Version" | ForEach-Object {
                $obj = New-Object PSObject
                $obj | Add-Member -MemberType noteproperty -Name Name -value $_.Name
                $obj | Add-Member -MemberType noteproperty -Name Value -value $_.Value
                $obj | Add-Member -MemberType noteproperty -Name ComputerName -value $Comp
                $obj | Add-Member -MemberType noteproperty -Name Properties -value $_.Properties
               $Results += $obj
            }

 

In this code's place we need to connect to the already mounted $tempAMTPSDrive AmtSystem drive.

 

The item we want to change is AccessPointEnabled

$tempAMTPSDrive":\Config\KVM\AccessPointEnabled

 

if ($StateToset -eq "enable")
     {             
                Set-Item $tempAMTPSDrive":\Config\KVM\AccessPointEnabled" $true
                $obj = New-Object PSObject
                $obj | Add-Member -MemberType noteproperty -Name ComputerName -value $Comp
                $obj | Add-Member -MemberType noteproperty -Name "AMT KVM State" -value Enabled
                $results += $obj
     }
     else
     {
               Set-Item $tempAMTPSDrive":\Config\KVM\AccessPointEnabled" $false
                $obj = New-Object PSObject
                $obj | Add-Member -MemberType noteproperty -Name ComputerName -value $Comp
                $obj | Add-Member -MemberType noteproperty -Name "AMT KVM State" -value Disabled
                $results += $obj
       }

That's it! The full source is included below.

run setAMTKVM.jpg

 

I want to explain the other items int he KVM folder.

If you have an amt drive mounted,

New-PSDrive -Name AMT -PSProvider amtsystem -Root "/" -ComputerName yourSystem name -Credential $yourPScredential

go ahead and get the child items to see what is there

cd amt:\Config\KVM

ls

get-childitem KVM directory.jpg

 

AccessPointEnabled:

  determines if the AMT endpoint can serve KVM data.

EnabledByMEBX:

  is an information flag relating if the KVM feature was enabled in the Intel ME BIOS eXtension.

ConsentRequired:

  determines if the user's consent is required and the sprite is displayed. For security, I recommend this be left on.

ConsentDisplayTimeout:

  the amount of time the Intel hardware displays the user consent sprite. I recommend the default.

SessionTimeout:

  the amount of time the session consent persists after a disconnect - useful for handling connectivity issues. I recommend the default.

DefaultScreen:

  which screen to display the sprite on. I recommend the primary.

RFBPassword:

  the remote frambuffer protocol password, which of course we cannot see.

UseStandardPort:

  determines which port KVM uses - I recommend this be left as is.