DESCRIPTION
This script policy sample demonstrates how to provide the default mailbox store on user copy.
Note This code may use functions from the Active Roles 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 MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,
' PLEASE CONTACT ONE IDENTITY PROFESSIONAL SERVICES.
'*********************************************************************************
Option Explicit
'**************************************************************************
' EVENT HANDLERS
'**************************************************************************
Sub onGetEffectivePolicy(Request)
'----- serve user objects only -----
If (Not IsObjectClassRequested("user", Request)) Then Exit Sub
'----- serve copying operations only -----
If (Request.Parameter("InterestingRequestType") <> EDST_REQ_COPY) Then Exit Sub
Dim strSourceDN, objSource, strHomeMDB
'----- get source user object DN -----
strSourceDN = GetInControl(EDS_CONTROL_SOURCE_OBJECT_DN, Request)
'----- exit if source DN is not present -----
If (IsEmpty(strSourceDN)) Then Exit Sub
'----- bind to the source user object DN -----
Set objSource = GetObject("EDMS://" & strSourceDN)
'----- get mailbox store from the source user object -----
objSource.GetInfoEx Array("homeMDB"), 0
strHomeMDB = GetAttribute("homeMDB", objSource)
'----- select the mailbox store as default mailbox store on UI -----
Request.SetEffectivePolicyInfo "homeMDB", EDS_EPI_UI_GENERATED_VALUE, strHomeMDB
'----- force selected mailbox store on UI -----
Request.SetEffectivePolicyInfo "homeMDB", EDS_EPI_UI_AUTO_GENERATED, True
End Sub
'***** END OF CODE ***************************************************************