DESCRIPTION
This script policy sample demonstrates how to provide default mailbox store on user copy.
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
'**************************************************************************
' 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 ***************************************************************
COMPATIBILITY
Script compatible with the following version(s): <Not specified>