ExcludedUserAccount.Date

[This documentation is preliminary and is subject to change.]

The Date property retrieves the day and time upon which the account was excluded.

Property Date

Property Value

This property returns a DateTime value. The property is read-only.

Example Code

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

Product Requires Windows ServerĀ "Longhorn".
Library

Use Microsoft.RightsManagementServices.Admin.dll registered as a custom type library.

See Also

ExcludedUserAccount