9 lines
780 B
PowerShell

$endpointAccessControlServiceRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_EndpointAccessControlService WHERE Name='Intel(r) AMT Endpoint Access Control Service'")
$instanceID = # The ID of the instance that equals the handle of the desired certificate
$eacCredentialContextInstance = $wsmanConnectionObject.NewInstance("AMT_EACCredentialContext")
$publicKeyCertificateRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_PublicKeyCertificate WHERE InstanceID='" + $instanceID + "'")
$eacCredentialContextInstance.SetProperty("ElementInContext", $publicKeyCertificateRef)
$eacCredentialContextInstance.SetProperty("ElementProvidingContext", $endpointAccessControlServiceRef)
$eacCredentialContextInstance.Create()
EnableEACService("2")
UpdatePostureState