Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Provision Exchaneg Mailbox

varunpuri
Regular Contributor
Regular Contributor

Hi,

We are trying to provision mailbox to the user using the directions provided in the Exchange Connector guide and Win PS connector guide. We have configured the connection object, have installed and configured the Saviynt APP and IIS Server on a Windows machine also.

We are using the sample JSON snippet provided in the Win PS connector for Create Account. Attaching the Create Account snippet from Win PS Connector here :

{
"CREATEACC": "{\"script\":\"\\$pw = convertto-securestring \\\"${PSSCRIPT_PASSWORD}\\\" -asplaintext -force; \\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist \\\"Administrator\\\",\\$pw;Invoke-Command -ComputerName '<ComputerName>' -Credential \\$mycred -ScriptBlock {New-ADUser -SamAccountName \\\"${user.systemUserName}\\\" -Enabled \\$True -AccountPassword (ConvertTo-SecureString -AsPlainText \\\"${randomPassword}\\\" -Force) -PassThru}\"}",
"SuccessResponses": {
"OBJECTTOREAD": "get(0).PSShowComputerName",
"SUCCESSVALUE": "True"
}
}

We are able to trigger Create Account of Exchange connection object too, but the same is throwing JSON parsing exception. Additionally, the sample snippet provided in the document contains powershell command to create a new AD account and NOT mailbox. I am attaching the log snippet here. Please do provide a solution and also share the snippet sample which will be useful for creation of mailbox :

varunpuri_0-1676039590058.png

Best Regards,
Varun

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

{
"CREATEACC": "{\"script\":\"\\$pw = convertto-securestring \\\"${PSSCRIPT_PASSWORD}\\\" -asplaintext -force; \\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist \\\"Administrator\\\",\\$pw;Invoke-Command -ComputerName '<ComputerName>' -Credential \\$mycred -ScriptBlock {New-ADUser -SamAccountName \\\"${user.systemUserName}\\\" -Enabled \\$True -AccountPassword (ConvertTo-SecureString -AsPlainText \\\"${randomPassword}\\\" -Force) -PassThru}\\\"}",
"SuccessResponses": {
"OBJECTTOREAD": "get(0).PSShowComputerName",
"SUCCESSVALUE": "True"
}
}


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

varunpuri
Regular Contributor
Regular Contributor

Getting this error :

"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379884074Z stdout F groovy.lang.MissingPropertyException: No such property: pw for class: SimpleTemplateScript371"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379890374Z stdout F at SimpleTemplateScript371.run(SimpleTemplateScript371.groovy:1)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379895074Z stdout F at com.saviynt.utility.TemplateUtilityService.getSimpleTemplateString(TemplateUtilityService.groovy:60)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379899474Z stdout F at com.saviynt.utility.TemplateUtilityService.getTemplateString(TemplateUtilityService.groovy:33)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379903874Z stdout F at com.saviynt.ecm.services.WindowsConnectorService.fetchCommand(WindowsConnectorService.groovy:1266)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379908674Z stdout F at com.saviynt.ecm.services.WindowsConnectorService$_createAccount_closure17.doCall(WindowsConnectorService.groovy:839)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379912774Z stdout F at com.saviynt.ecm.services.WindowsConnectorService.createAccount(WindowsConnectorService.groovy:802)"
"ecm-worker","2023-02-11T10:21:53.919+0000","2023-02-11T10:21:53.379924174Z stdout F at com.saviynt.ecm.services.ArsTaskService.createAccountTarget(ArsTaskService.groovy:11267)"

Also, when i remove the lines from the script which contains the variable pw, then it get the same error for variable mycred 

Best Regards,
Varun

varunpuri
Regular Contributor
Regular Contributor

@rushikeshvartak - any resolution if you can suggest ?