Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Dynamic Generation of Values

$
0
0

Hi everybody,

 

I have a fully functional script. It can populate correctly the drop-down menu to create a new user object.

 

Sub onGetEffectivePolicy(Request)     Set adoCommand = CreateObject("ADODB.Command")    Set adoConnection = CreateObject("ADODB.Connection")    adoConnection.Provider = "ADsDSOObject"    adoConnection.Open "Active Directory Provider"    Set adoCommand.ActiveConnection = adoConnection    strParent = Request.Parent    strOU = Replace(strParent, "OU=TOTO","OU=Groups,OU=TITI")     strBaseTemp = Replace(strOU, "EDMS://","")    strBase = "<LDAP://"&strBaseTemp &">"    strFilter = "(&(objectCategory=group)(cn=*_Redirect_*)(description=ACTIF))"    strAttributes = "Name"   strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"    adoCommand.CommandText = strQuery    adoCommand.Properties("Page Size") = 100    adoCommand.Properties("Timeout") = 30    adoCommand.Properties("Cache Results") = False   i = 0    Set adoRecordset = adoCommand.Execute            Do Until adoRecordset.EOF            ReDim Preserve T_ListGroup(i)            ReDim Preserve J_ListGroup(i)                      T_ListGroup(i) = adoRecordset.Fields("Name").Value            J_ListGroup(i) = Replace(Ucase(Left(T_ListGroup(i),0)) & Ucase(Right(T_ListGroup(i),len(T_ListGroup(i))-11)),"REDIRECT_","U")            Request.ReportEvent EDS_EVENTLOG_INFORMATION_TYPE, "T_ListGroup : "  & T_ListGroup(i)            Request.ReportEvent EDS_EVENTLOG_INFORMATION_TYPE, "J_ListGroup : "  & J_ListGroup(i)                        i = i + 1            adoRecordset.MoveNext        Loop        Request.SetEffectivePolicyInfo "extensionAttribute14", EDS_EPI_UI_POSSIBLE_VALUES, J_ListGroup         Request.SetEffectivePolicyInfo "extensionAttribute14", EDS_EPI_UI_AUTO_GENERATED, True            adoRecordset.Close    adoConnection.Close

End Sub

 

But, when I select a user to display its properties, I get this error on EDM Server log :

 

Pre-processing operation on object caused a policy violation 
Policy: Runs the script 'DFS' 
Object: CN=myUser ...
Details: The 'Script Execution' policy encountered an error when running the script 'DFS' (33, 5) Active Directory: There is no such object on the server.

 

Is there a way that the policy "onGetEffectivePolicy" does not apply when ARS launches the command "User Properties" ?

 

Thanks for the help.

Kind Regards


Viewing all articles
Browse latest Browse all 1277

Trending Articles