ConfigurationManager.IsInRoles method
The IsInRoles method retrieves a Boolean value that specifies whether a role is permitted.
Syntax
ConfigurationManager.IsInRoles( _
ByVal role _
)
Parameters
-
role
-
A value that identifies the role. This can be one of the following.
-
RoleAuditor (0x1)
-
The auditing role is defined.
-
RoleTemplateEditor (0x2)
-
The rights template editing role is defined.
-
RoleAdministrator (0x4)
-
The administrator role is defined.
Return value
This method returns a Boolean value.
Remarks
The access control list on the AD RMS Administration website determines whether a role is supported.
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
' *******************************************************************
' Determine whether the Auditing role is supported.
SUB ChkSupportedRole()
DIM bRole
bRole = config_manager.IsInRoles(1)
CheckError()
IF bRole <> 0 THEN
' TODO: Do something.
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 |
|