VBscript : set right for 'send on behalf'


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
                                          ' 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

Who is Participating?
LeeDerbyshireConnect With a Mentor Commented:
Those 'Unspecified Errors' are the worst to fix.



suggests that putting the string in an Array

  moncn = Array(right(monuser,len(monuser)-7))

might help, but apparently, it was supposed to be fixed in Win2000.

Where does your script get the value of ADS_Property_APPEND from?  Did you declare it at the start of the script?
ingeticAuthor Commented:
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.
ingeticAuthor Commented:
thanks for your help,

with :

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

all is OK
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.