An example of a well-formed Active Roles script policy that uses the suggested library.
SCRIPT
'*********************************************************************************
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,
' PLEASE CONTACT ONE IDENTITY PROFESSIONAL SERVICES.
'*********************************************************************************
Option Explicit
Sub onPostGet (Request)
'-- serve user accounts only
If (Not IsObjectClassRequested("user", Request)) Then Exit Sub
'-- serve specified attribute only
If (Not Request.IsAttributeRequested("esdvaMyAttribute1")) Then Exit Sub
Request.Put "esdvaMyAttribute1", "some value"
End Sub
Sub onPreModify (Request)
'-- serve user accounts only
If (Not IsObjectClassRequested("user", Request)) Then Exit Sub
'-- serve specified attribute only
If (Not IsAttributeModified("esdvaMyAttribute2", Request)) Then Exit Sub
Dim strOldValue, strNewValue
'-- prepare old values reading
DirObj.GetInfoEx Array("esdvaMyAttribute2"), 0
'-- read old value
strOldValue = GetAttribute ("esdvaMyAttribute2", DirObj)
'-- read new value
strNewValue = GetAttribute ("esdvaMyAttribute2", Request)
'-- if a new value is same as an old value
If (strOldValue = strNewvalue) Then
'-- generate a new value for the processed attribute
Request.Put "esdvaMyAttribute2", "some value"
End If
End Sub
'***** END OF CODE ***************************************************************