Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Win PS Connector - Update Account Json

gurpreetchanna
New Contributor II
New Contributor II

Hi, 

We have use case, where update account task is getting generated from 2 sources. 

1- Standard Update account task via API request. 

2- Update account task via Analytics

The attribute or Powershell execution requirement is different in both the cases. 

Since we have to implement the logic in Win PS connector (Update Account Json), can you please help with a sample Json where if else block has been used e.g

Requirement 

if (Source == API task)

{run script from this block}

if (Source == Analytics)

{run script from this block}

Sample json from connector is as below - 

{"UPDATEACC":["Script=\$pw = convertto-securestring '' -asplaintext -force;\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist '\\\\',\$pw;Invoke-Command -ComputerName '' -ScriptBlock {Set-ADUser -Identity '${task.accountName}' -City '${user.city}' -Company '${user.companyname}' -Manager '${user.owner}'}"]}

 

3 REPLIES 3

rushikeshvartak
All-Star
All-Star
{"UPDATEACC":["Script=\$pw = convertto-securestring '' -asplaintext -force;\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist '\\\\',\$pw;if('${task.source}' == 'REQUEST'){Invoke-Command -ComputerName '' -ScriptBlock {Set-ADUser -Identity '${task.accountName}' -City '${user.city}' -Company '${user.companyname}' -Manager '${user.owner}'}}else if('${task.source}' == 'ANALYTICS_V2'){Invoke-Command -ComputerName '' -ScriptBlock {Set-ADUser -Identity '${task.accountName}' -City '${user.city}' -Title '${user.title}' -Department '${user.department}'}}"]}

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

gurpreetchanna
New Contributor II
New Contributor II

Hi @rushikeshvartak , 

That was helpful, can you please also guide.. how do we refer the request variable in the json. 

The sample show usage of user profile attributes.. but we need to pass new account owner DN as manager value in Active directory.  

Refer https://docs.saviyntcloud.com/bundle/EIC-Connectors/page/Content/Binding-Variables-for-Provisioning-...


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.