Link to home
Start Free TrialLog in
Avatar of Ludovick Lagrevol
Ludovick LagrevolFlag for France

asked on

VBscript : set right for 'send on behalf'

hi,

i'm trying to set in vbscript  publicDelegatesBL and/or publicDelegates to users to grant the 'send on behalf' in outlook 2003 / Exchange 2003,

but i 've always an undefined active directory error  : Err : -2147467259

Must i set the publicDelegates after ? before ? or the two in one time ? (but how) ?. ... ?

or ?

...

Set objSdUtil = GetObject(req)
                                    delegateList = objSdUtil.GetEx("publicDelegates")
                                    'For Each Desc In delegateList
                                    '                  debug "Delegate : " &  Desc
                                    'Next
                                    
                                          ' droits a ajouter
                                          trace "   Ajout des droits d'envoi DE LA PART de " & utilisateur & " sur la boite " &   boiteagerer
                                          monuser = CheckForUser(IDutilisateur,false)
                                          moncn = right(monuser,len(monuser)-7)
                                          debug moncn
                                          
                                          objSdUtil.PutEx ADS_Property_APPEND, "publicDelegatesBL", moncn
                                                                        
                                    objUser.SetInfo

..
ASKER CERTIFIED SOLUTION
Avatar of LeeDerbyshire
LeeDerbyshire
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ludovick Lagrevol

ASKER

yes, it's a const :    
                  Const SEND_AS = "{AB721A54-1E2F-11D0-9819-00AA0040529B}"
                  Const ADS_ACETYPE_ACCESS_ALLOWED_OBJECT = &H5
                  Const ADS_FLAG_OBJECT_TYPE_PRESENT = &H1
                  Const ADS_RIGHT_DS_CONTROL_ACCESS = &H100
                  Const ADS_PROPERTY_CLEAR = 1
                  Const ADS_PROPERTY_UPDATE = 2
                  Const ADS_PROPERTY_APPEND = 3
                  Const ADS_PROPERTY_DELETE = 4

when i try with array, error :

                         Microsoft VBScript: Type incompatible
Are you sure that you have the right object in objSdUtil ?  Try displaying the existing value of publicDelegatesBL , to make sure that you are trying to append it to the right thing.
thanks for your help,

with :

objSdUtil.PutEx ADS_Property_APPEND, "publicDelegatesBL", array(moncn)

all is OK