Error in creating Role Owner.

Error in creating Role Owner.

Post by Hollis D. Pau » Sat, 04 Nov 2000 07:02:24

There is this code at the end of three pages of performeradd in the
Role Administrator Sample Application (for NT4 and Exchange 5.5) that
creates the new Alias as a DL.
      ' This code creates the new role performer DL in the Recipients
      strRecipientsPath = "LDAP://" + strServer + "/cn=Recipients,ou="
+ strSite + ",o=" + strOrganization
      Set objRecipients = GetObject(strRecipientsPath)
      Set objNewDL = objRecipients.Create("groupOfNames", "cn=" +

      ' This code puts all the required properties on the role
performer DL.
      objNewDL.Put "cn", CStr(strDisplayName)
      objNewDL.Put "uid", CStr(strAliasName)
      objNewDL.Put "distinguishedName", CStr("cn=" + strAliasName +
",cn=Recipients,ou=" + strSite + ",o=" + strOrganization)
      objNewDL.Put "mail", CStr(strSMTPAddr)
      objNewDL.PutEx ADS_PROPERTY_UPDATE, "otherMailbox",
      objNewDL.Put "Report-To-Originator", True
      objNewDL.Put "Report-to-Owner", False
      objNewDL.Put "Replication-Sensitivity", CInt(20)
      objNewDL.Put "rfc822Mailbox", CStr(strSMTPAddr)
      objNewDL.Put "textEncodedORaddress", CStr(strx400Addr)
      objNewDL.Put "givenName", CStr(objRole.rdn)
      objNewDL.Put "owner", CStr(objOwner.distinguishedName)
      If Err.Number <> 0 Then
        If Err.Number = &H800700B7 Then
          displayError "Duplicate ADSI object:\n" & objNewDL.ADsPath,0,
          displayError "Failed to create role performer:\n" &
objNewDL.ADsPath,0, 0
        End If
        objRole.Add objNewDL.ADSPath
        If Err.Number <> 0 Then
          displayError "Failed to add ADSI object:\n" & strRole & "\nto
ADSI object:\n" & objNewDL.ADSPath, 0, 0
          Call objRecipients.Delete("groupOfNames", objNewDL.Name)
          If Err.Number <> 0 Then
            displayError "Failed to delete ADSI object:\n" &
objNewDL.ADSPath, 0, 0
          End If
          temp = parent.main.document.Tree.getSelectedNode();

          parent.main.document.Tree.setExpanded(temp, true)
        End If
      End If
    End If
  End If
End If
A DL of the proper name gets created, but no owner is assigned to it.  
I suspect the following line is not right:

      objNewDL.Put "owner", CStr(objOwner.distinguishedName)

Anybody know what it should be?

 Hollis D. Paul [MVP - Outlook]

 Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2195

 Mukilteo, WA  USA