Uncheck and Disable 'Creation of Mailbox' option in Contact creation wizard

Hello,

I'm have tried below script in policy to uncheck and disable 'Create a mailbox' option in the contact creation wizard but its not reflecting on the screen.

function onGetEffectivePolicy($Request)
{
if($Request.Class -ne "contact"){return}
$Request.ClearEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_AUTO_GENERATED)
$Request.ClearEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_GENERATED_VALUE)
$Request.SetEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_GENERATED_VALUE, $FALSE)
$Request.SetEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_AUTO_GENERATED, $FALSE)
}

When I check the wizard checkbox is disabled but its not greyed out.

Thanks you

  • Try adding:

    $Request.SetEffectivePolicyInfo('edsaEstablishEmail', $Constants.EDS_EPI_UI_RESTRICTED , $true) 

    Now, unless you really need a policy script for other reasons, you could also just add a PVG policy for the attribute forcing it to False.

  • Thanks for your reply.

    Do I need to add the line to function onGetEffectivePolicy along with other lines or do i need to replace any?

  • Yes, just add to your existing on onGetEffectivePolicy.

  • I've added the line but no luck

    function onGetEffectivePolicy($Request)
    {
    if($Request.Class -ne "contact"){return}
    $Request.ClearEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_AUTO_GENERATED)
    $Request.ClearEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_GENERATED_VALUE)
    $Request.SetEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_GENERATED_VALUE, $FALSE)
    $Request.SetEffectivePolicyInfo("edsaEstablishEmail", $Constants.EDS_EPI_UI_AUTO_GENERATED, $FALSE)
    $Request.SetEffectivePolicyInfo('edsaEstablishEmail', $Constants.EDS_EPI_UI_RESTRICTED , $true)
    }