VBscript : set right for 'send on behalf'

Posted on 2006-05-02
Last Modified: 2008-01-09

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

Question by:ingetic
    LVL 31

    Accepted Solution

    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?
    LVL 7

    Author Comment

    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
    LVL 31

    Expert Comment

    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.
    LVL 7

    Author Comment

    thanks for your help,

    with :

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

    all is OK

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
    In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now