14 lines
965 B
PowerShell

$handle = "4" # The handle of the user, returned when the entry was created.
$authorizationServiceRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_AuthorizationService WHERE Name='Intel(r) AMT Authorization Service'")
$digestRealm = GetDigestRealm
$digestPassword = ComputeMD5 "myUser" "P@ssw0rd" $digestRealm
$digestPasswordInBase64 = ConvertToBase64 $digestPassword
$inputObject = $authorizationServiceRef.CreateMethodInput("UpdateUserAclEntryEx")
$inputObject.SetProperty("Handle", $handle)
$inputObject.SetProperty("DigestUsername", "myUser")
$inputObject.SetProperty("DigestPassword", $digestPasswordInBase64)
$inputObject.SetProperty("AccessPermission", "2") # 2 = any access permission.
$inputObject.AddProperty("Realms", "2") # 2 = Redirection realm.
$inputObject.AddProperty("Realms", "4") # 4 = HardwareAsset realm.
$outputObject = $authorizationServiceRef.InvokeMethod($inputObject)
$returnValue = $outputObject.GetProperty("ReturnValue")