Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Exchange Mailbox provisioning issue in WIN - PS

gwagh
Regular Contributor
Regular Contributor

Hi Team,

 

While Enable Mail script is not working. we are using WIN connector for enable disable mail box.

Script

{
"CREATEACC": [
"Script=\$pw = convertto-securestring 'password' -asplaintext -force;\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist ('xxxxxxl\\\\svcSaviynt',\$pw); \$onprem = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionURI http://hostname/PowerShell/ -Authentication Kerberos;Import-PSSession \$onprem-AllowClobber| out-null; -ScriptBlock {Enable-RemoteMailbox -Identity \'${user.username}' -RemoteRoutingAddress \'${user.username}@xxxxx.mail.onmicrosoft.com'}"],
"SuccessResponses": ["true"]
}

 

Could you please tell me the correct syntax ? Getting 500 error msg.

gwagh_0-1704709080077.png

 

 

 

Thanks,

Gaurav

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

Does script working from powershell ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

gwagh
Regular Contributor
Regular Contributor

Yes, It's working in powershell.

aundreb
Regular Contributor II
Regular Contributor II

Were you able to resolve this? I have the same issue currently. Get a 500 error from Saviynt but script works locally and invoking a rest method via powershell works locally.