Hello everyone,
After creating a mailbox using a template we would like to run a convert.ps1 script which converts the mailbox to shared mailbox.
The template consists of this code:
/* (optional) Hide the scripting area. Stronger than IsHiddenFromRequester. If a script is defined it will be executed even if the area is hidden. */
"IsHidden": false,
// (optional) Hide the scripting area for requesters in web interface. Weaker than IsHidden.
"IsHiddenFromRequester": false,
// (optional) Define the checkbox preset. Default is false (if not set).
"IsScriptEnabledDefault": true,
// Set a display name.
"DisplayName": "Convert to Shared Mailbox",
// Path to the script file. Use UNC format and mention escaping.
"Path": "\\\\xxxx\\\\xxxxxxxx\\convert.ps1",
// (optional) Define the parameters that will be passed to the script.
"CommandLineParameters": "{mail}"
It doesn't work this way. The script seems to be running but does not convert the mailbox.
The script itself looks like this:
Start-Sleep -s 60
Set-Mailbox {mail} -Type shared
So, we start the job, the user-account/mailbox is created, the ps1 should wait 60 sec and convert the {mail} into a shared mailbox.
Any ideas how to solve this?
Thanks