CollapseAll image

Admin: Remove an Enterprise

If an enterprise is not needed anymore, it should be removed so that there is room for a new one. Users are most likely to supply the name of the enterprise to be removed; application code will have to map the name to an enterprise handle.

1.  Retrieve the instance of AMT_ThirdPartyDataStorageAdministrationService, where the “Name” key equals “Intel(r) AMT Third Party Data Storage Administration Service”.

2.  Use the Admin: Enumerate all Enterprises flow to retrieve of a list of application handles and their corresponding names, associating each handle with its name.

3.  Find the handle that corresponds with the enterprise name to be removed supplied by the user. If that name is not in the list, return an error to the user.

4.  Invoke AMT_ThirdPartyDataStorageAdministrationService.RemoveStorageEaclEntry to remove the enterprise. Pass the handle of the enterprise to be removed that was found in step 4 as an input parameter.

 Note:

All applications associated with an enterprise must be removed before attempting to remove the enterprise. Otherwise the removal operation will fail.

 

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$enterprise ="Intel" # The name of the enterprise 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("EnumerateStorageEaclEntries")

$outputObject =$thirdPartyDataStorageAdministrationServiceRef.InvokeMethod($inputObject)

$returnValue =$outputObject.GetProperty("ReturnValue")

if($returnValue -like "0")

{

    $handles =$outputObject.GetProperty("Handles")

    for($i = 0;$i -lt $handles.Count;$i++)

    {

          $inputObject =$thirdPartyDataStorageAdministrationServiceRef.CreateMethodInput("GetStorageEaclEntry")

          $inputObject.SetProperty("Handle",$handles.Item($i).ToString())

          $outputObject =$thirdPartyDataStorageAdministrationServiceRef.InvokeMethod($inputObject)

          $returnValue =$outputObject.GetProperty("ReturnValue")

          if($returnValue -like "0")

          {

                $enterpriseName =$outputObject.GetProperty("EnterpriseName").ToString()

                if($enterpriseName -like $enterprise)

                {

                      $inputObject =$thirdPartyDataStorageAdministrationServiceRef.CreateMethodInput("RemoveStorageEaclEntry")

                      $inputObject.SetProperty("Handle",$handles.Item($i).ToString())

                      $outputObject =$thirdPartyDataStorageAdministrationServiceRef.InvokeMethod($inputObject)

                      $returnValue =$outputObject.GetProperty("ReturnValue")

                      break

                }

          }

    }

}

 

 

Instance Diagram

Not applicable

Classes Used in This Flow

SDK Sample

If there is a sample demonstrating this flow, it is included in the SDK installation file. See SDK Installation Layout for details.

 

See Also:

   Storage Concepts and Objects

   Application Development Guidelines

   Examples of Using the Storage Feature

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