Quantcast
Channel: TechCenter
Viewing all articles
Browse latest Browse all 2350

Workaround: Establish user (or group) email address in pure Exchange 2007 organization

$
0
0
Revision 1 posted to Active Roles Script Center by DELL-Tatiana G on 2/24/2014 6:09:57 AM

Back to User management: Other

Back to Exchange management

DESCRIPTION

Starting version 6.0, the ActiveRoles Server began support of Exchange 2007 for user mailbox creation, moving, deletion. For other Exchange tasks (establish email address for user, contact, or group) the ARS still rely on Recipient Update Service (RUS) of earlier version of Exchange.

Thus, if you don't have earlier version of Exchange (2000 or 2003) installed in your environment, or if you don't have RUS enabled on Exchange, you can't establish e-mail addresses for user, contacts, groups.

This script sample demonstrates a workarround.


Note This code may use functions from the ARS Script Policy Best Practices. Please, follow the link to obtain instructions and code for those functions.


SCRIPT

 

'*********************************************************************************

' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,

' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED

' WARRANTIES OF MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

'

' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,

' PLEASE CONTACT QUEST PROFESSIONAL SERVICES.

'*********************************************************************************

'

' This code is published on the ActiveRoles Script Center:

' http://communities.quest.com/docs/DOC-9991

'

' This code may use functions from the ARS Script Policy Best Practices:

' http://communities.quest.com/docs/DOC-10016

'

' Please, follow the link to obtain instructions and code for those functions.

'*********************************************************************************

Option Explicit

'***********************************************************************************

'** CUSTOMIZABLE SETTINGS.

'** Change the following 2 settings to values applicable to your environment

'***********************************************************************************

'-- Domain DNS name is used to constuct SMTP addresses

Const strDNSName = "foo-company.com"

'-- Distinguished name of Exchange Default Global Address List

Const strDefaultGALDN = "CN=Default Global Address List,CN=All Global Address Lists,CN=Address Lists Container,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=foo-company,DC=com"

'***********************************************************************************

'** SUBROUTINES

'***********************************************************************************

Function GetAttribute(ByRef Request, ByVal strName)

Dim Value

On Error Resume Next

Value = Request.Get(strName)

On Error GoTo 0

GetAttribute = Value

End Function

Function Execute(ByRef Request)

'-- Optimization: procceed for specific classes only

If ((LCase(Request.Class) <> "user") And _

(LCase(Request.Class) <> "contact") And _

(LCase(Request.Class) <> "inetorgperson") And _

(LCase(Request.Class) <> "group")) Then Exit Function

'-- Optimization: procceed for specific Exchange tasks only

If ((CBool(GetAttribute(Request, "edsaEstablishEmail")) <> True) And _

(CBool(GetAttribute(Request, "edsaEstablishGroupEmail")) <> True)) Then Exit Function

'-- Get necessary attribute values

DirObj.GetInfoEx Array("displayName", "mailnickName", "targetAddress"), 0

Dim strAlias, strMail

'-- Get alias, constuct e-mail address

strAlias = GetAttribute(DirObj, "mailnickName")

strMail = strAlias & "@" & strDNSName

'-- Fill display name if it is empty

If (IsEmpty(GetAttribute(Request, "displayName"))) Then

DirObj.Put "displayName", strAlias

End If

'-- Add proceed object to default GAL

DirObj.Put "showInAddressBook", strDefaultGALDN

'-- Fill another attributes

Select Case (LCase(Request.Class))

Case "user", "contact", "inetorgperson"

DirObj.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", Array(GetAttribute (DirObj, "targetAddress"), "smtp:" & strMail)

DirObj.Put "mail", GetAttribute(DirObj, "targetAddress")

Case "group"

DirObj.PutEx ADS_PROPERTY_APPEND, "proxyAddresses", "SMTP:" & strMail

DirObj.Put "mail", strMail

End Select

'-- Apply changes

DirObj.SetInfo

End Function

'***********************************************************************************

'** EVENT HANDLERS

'***********************************************************************************

Sub onPostCreate(Request)

Execute(Request)

End Sub

Sub onPostModify(Request)

Execute(Request)

End Sub

'****************** END OF CODE ****************************************************

'***** END OF CODE ***************************************************************

COMPATIBILITY

Script compatible with the following version(s): <Not specified>

 

Back to User management: Other

Back to Exchange management


Viewing all articles
Browse latest Browse all 2350

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>