Share via


ExcludedUserAccount.UserType property

The UserType property retrieves the type of the excluded user account.

This property is read-only.

Syntax

ExcludedUserAccount.UserType

Property value

This read-only property returns one of the following integer values.

ExcludedDomainUserType (0)

Domain account.

ExcludedFederationUserType (1)

Federated account.

ExcludedExternalUserType (2)

External account.

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

' *******************************************************************
' Get information about each excluded user.

SUB ExcludedUserInfo()

  DIM exclusionPolicy
  DIM excludedUser
  DIM excludedUserColl   

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

  ' Retrieve the ExcludedUSerAccountCollection object.
  SET excludedUserColl = exclusionPolicy.UserAccounts
  CheckError()

  ' Loop through the collection and retrieve the date and type.
  For Each excludedUser in excludedUserColl
    CALL WScript.Echo( "UserId: " & excludedUser.UserId)
    CALL WScript.Echo( "Type: " & excludedUser.UserType)
    CALL WScript.Echo( "Date: " & excludedUser.Date)
  Next

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

ExcludedUserAccount