This script demonstrates how to populate specific user attributes based on a change in a different user attribute.
Note This code may use functions from the Active Roles Script Policy Best Practices. Please, follow the link to obtain instructions and code for those functions.
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.
'*********************************************************************************
'This script populates the address when creating a user based on the users company.
'Create a sub called onPostModify and copy the same information for this work when modifying a user
Sub onPostCreate(Request)
If Request.Class <> "user" Then Exit Sub
DirObj.Getinfo
Comp=DirObj.Get("company")
If Comp = "Quest Software (UK) Limited" Then
DirObj.put "streetAddress", "Westacott Way"
DirObj.put "l", "Maidenhead"
DirObj.put "postalCode", "SL6 3QQ"
DirObj.put "c", "GB"
DirObj.setinfo
End If
If Comp = "Quest Software GmbH" Then
DirObj.put "streetAddress", "Im Mediapark 4e"
DirObj.put "l", "Koln"
DirObj.put "postalCode", "50670"
DirObj.put "c", "DE"
DirObj.setinfo
End If
End Sub
'***** END OF CODE ***************************************************************