21 lines
1.1 KiB
PowerShell
21 lines
1.1 KiB
PowerShell
$handleToDelete = "1" # The handle of the application that should be removed.
|
|
$thirdPartyDataStorageAdministrationServiceRef = $wsmanConnectionObject.NewReference("SELECT * FROM AMT_ThirdPartyDataStorageAdministrationService WHERE Name='Intel(r) AMT Third Party Data Storage Administration Service'")
|
|
$inputObject = $thirdPartyDataStorageAdministrationServiceRef.CreateMethodInput("EnumerateStorageAllocEntries")
|
|
$outputObject = $thirdPartyDataStorageAdministrationServiceRef.InvokeMethod($inputObject)
|
|
$returnValue = $outputObject.GetProperty("ReturnValue")
|
|
if($returnValue -like "0")
|
|
{
|
|
$handles = $outputObject.GetProperty("Handles")
|
|
for($i = 0; $i -lt $handles.Count; $i++)
|
|
{
|
|
$handle = $handles.Item($i).ToString()
|
|
if($handle -like $handleToDelete)
|
|
{
|
|
$inputObject = $thirdPartyDataStorageAdministrationServiceRef.CreateMethodInput("RemoveStorageFpaclEntry")
|
|
$inputObject.SetProperty("Handle", $handle)
|
|
$outputObject = $thirdPartyDataStorageAdministrationServiceRef.InvokeMethod($inputObject)
|
|
$returnValue = $outputObject.GetProperty("ReturnValue")
|
|
break
|
|
}
|
|
}
|
|
} |