Share via


Constants.RoleAuditor property

The RoleAuditor property retrieves a value that specifies auditor privileges.

This property is read-only.

Syntax

Constants.RoleAuditor

Property value

This property returns an integer value (0x1).

Remarks

The role is returned when you call the Initialize method on the ConfigurationManager object, and it is determined by the access control list on the AD RMS Administration website. The role can be a bitwise-combination of the following flags.

Value Description
RoleAuditor (0x1) The auditing role is defined.
RoleTemplateEditor (0x2) The rights template editing role is defined.
RoleAdministrator (0x4) The administrator role is defined.

Examples

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

SUB InitObject()

  DIM config_manager
  DIM admin_role
  DIM constant

  ' Retrieve a ConfigurationManager object.
  CALL WScript.Echo( "Create ConfigurationManager object...")
  SET config_manager = CreateObject _
    ("Microsoft.RightsManagementServices.Admin.ConfigurationManager")      
  CheckError()

  ' Retrieve a Constants object.
  SET constant = config_manager.Constants
  CheckError()

  ' Retrieve the role.    
  CALL WScript.Echo( "Initialize...")
  admin_role=config_manager.Initialize(false,"localhost",80,"","","")
  CheckError()

  IF config_manager.IsInRoles(constant.RoleAuditor) THEN
    CALL WScript.Echo("Role is auditor.")
  END IF

  IF config_manager.IsInRoles(constant.RoleTemplateEditor) THEN
    CALL WScript.Echo("Role is template editor.")
  END IF

  IF config_manager.IsInRoles(constant.RoleAdministrator) THEN
    CALL WScript.Echo("Role is administrator.")
  END IF

  IF admin_role < 1 OR admin_role > 4 THEN
    CALL WScript.Echo("Role is undefined.")
  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

Requirements

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

See also

Constants

RoleAdministrator

RoleTemplateEditor