次の方法で共有


Enterprise.ResetServiceKeyPassword method

The ResetServiceKeyPassword method specifies a password used to encrypt the server licensor private key.

Syntax

Enterprise.ResetServiceKeyPassword( _
  ByVal password _
)

Parameters

password

A string value that contains the password.

Return value

This method does not return a value.

Remarks

The password is used to encrypt the private key. The encrypted data is then saved in the configuration database and the registry of the local computer. The key is saved by using the current user logon account. This method does not support remote access.

Examples

DIM config_manager
DIM admin_role

' *******************************************************************
' Create and initialize a ConfigurationManager object.

SUB InitObject()

  CALL WScript.Echo( "Create ConfigurationManager object...")
  SET config_manager = CreateObject _
    ("Microsoft.RightsManagementServices.Admin.ConfigurationManager")      
  CheckError()
    
  CALL WScript.Echo( "Initialize...")
  admin_role=config_manager.Initialize(false,"localhost",80,"","","")
  CheckError()

END SUB

' *******************************************************************
' Reset the password.

SUB SetPassword()

  DIM enterprise

  ' Retrieve the Enterprise object.
  SET enterprise = config_manager.Enterprise
  CheckError()

  ' Reset the password.
  IF config_manager.IsServerOnLocalMachine THEN
    enterprise.ResetServiceKeyPassword("some_password")
    CheckError()
  ELSE
    CALL RaiseError(-504, "Server must be local computer.")
  END IF

END SUB

' *******************************************************************
' Error checking function.

FUNCTION CheckError()
  CheckError = Err.number
  IF Err.number <> 0 THEN
    CALL WScript.Echo( vbTab & "*****Error Number: " _
                       & Err.number _
                       & " Desc:" _
                       & Err.Description _
                       & "*****")
    WScript.StdErr.Write(Err.Description)
    WScript.Quit( Err.number )
  END IF
END FUNCTION

' *******************************************************************
' Generate a runtime error.

SUB RaiseError(errId, desc)
  CALL Err.Raise( errId, "", desc )
  CheckError()
END SUB

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008
Assembly
Microsoft.RightsManagementServices.Admin.dll

See also

Enterprise