DESCRIPTION
Sample scripting policy that populates the drop-down for virtual attribute Department
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.
'*********************************************************************************
Sub onGetEffectivePolicy(Request)
If Request.Class <> "user" Then Exit Sub
Dim Arr()
CorporateConnectStr = "myHR" 'ODBC data source name
Set CorporateDBConnection = CreateObject("ADODB.Connection")
CorporateDBConnection.Open CorporateConnectStr
' CCDeptOU - the name of the Table
' CCDept - the name of the Column in the Table
SQLQuery = "SELECT * FROM dbo.CCDeptOU"
Set RS = CorporateDBConnection.Execute(SQLQuery)
i=0
While Not RS.EOF
ReDim Preserve Arr(i)
Arr(i) = RS("CCDept")
i=i+1
RS.MoveNext
Wend
Request.SetEffectivePolicyInfo "Department", EDS_EPI_UI_POSSIBLE_VALUES, Arr
End Sub
'***** END OF CODE ***************************************************************