AD GUI not picking up scalixEmailAddress

Best practice information from Scalix users relating to integration of Scalix with other products.

Moderator: ScalixSupport

Derek
Posts: 169
Joined: Fri Mar 24, 2006 4:53 pm
Contact:

AD GUI not picking up scalixEmailAddress

Postby Derek » Wed Jul 26, 2006 4:24 pm

Ok, so the situation is that I'm writing some VBScript to prepopulate some AD attributes. One of the reasons is that we are moving from flast@domain.com format to first.last@domain.com. So, I need to create all of the first.last default addresses in AD as well as the legacy email address (flast).

Here's part of the code:

Code: Select all

email = chr(34) & givenNameNew & " " & surNameNew & chr(34) & " <" & LCase( givenNameNew & "." & surNameNew & "@domain.com> " )
email = email & ";" & LCase( Left( givenNameNew, 1 ) & surNameNew & "@domain.com" )
If( Len( surName ) > 6 ) Then
   email = email & ";" & Left( givenNameNew, 1 ) & Left( surNameNew, 6 ) & "@domain.com"
End If

email = Split( email, ";" )

Set objUser = GetObject( ADsPath )
objUser.Put "givenName", givenNameNew
objUser.Put "sn", surNameNew
objUser.Put "scalixMailnode", "default"
objUser.Put "scalixMailboxClass", "FULL"
objUser.Put "scalixScalixObject", "TRUE"
objUser.Put "scalixEmailAddress", email
objUser.SetInfo


More explanation: any email address over 7 characters actually has to be an alias for a truncated real email address. So, I have to create those as aliases too.

Anyway, the code works just it should, but it appears that AD or the GUI extensions don't.

Once the code has been run, checking the update by using ADSIEdit.msc shows that the scalixEmailAddress attribute contains the following:

Code: Select all

"Test User" <test.user@domain.com>;tuser@domain.com


When I compare this to a test user that I update by hand, they have exactly the same format.

However, when I check the AD entry in ADUC, the default email address is listed in the "Others" box along with the alias (tuser@domain.com).

So, I changed the following line of code:

Code: Select all

objUser.Put "scalixEmailAddress", email

to

Code: Select all

objUser.Put "scalixEmailAddress", email(0)

Now I have just the default email address being added. Again, I run the script, the attribute appears to be formatted correctly when viewing it in ADSIEdit.msc but when I check it in ADUC only the name appears in the "Default Email". In other words, the only part that shows up is "Test User" and the address is not seen. But again, if I check the actual AD entry, it's there.

So, where did I screw up? Should the "< >" characters be something different because it's unicode?

Derek
Posts: 169
Joined: Fri Mar 24, 2006 4:53 pm
Contact:

Postby Derek » Thu Jul 27, 2006 9:47 am

Ok, I think I've figured this out...though admittedly through brute-force trial and error.

This is the only combination that I found that produced the results I expected. The code above should be modified as follows:

Code: Select all

email0 = LCase( givenName & "." & surName & "@domain.com" )
email1 = LCase( Left( givenName, 1 ) & surName & "@domain.com" )
email2 = ""
If( Len( surName ) > 6 ) Then
   email2 = LCase( Left( givenName, 1 ) & Left( surName, 6 ) & "@domain.com" )
End If

If Len( email2 ) > 0 Then
   email = Array( email0, email1, email2 )
Else
   email = Array( email0, email1 )
End If

Set objUser = GetObject( ADsPath )
objUser.Put "scalixMailnode", "default"
objUser.Put "scalixMailboxClass", "FULL"
objUser.Put "scalixScalixObject", "TRUE"
objUser.Put "mail", email(0)
objUser.PutEx 2, "scalixEmailAddress", email
objUser.SetInfo


Return to “Third Party Integration”



Who is online

Users browsing this forum: No registered users and 2 guests