Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/27/2024 02:10 AM
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}'}"]}
09/27/2024 02:33 AM
{"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}'}}"]}
09/27/2024 03:15 AM
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.
09/27/2024 03:27 AM
10/01/2024 06:27 AM
Hi @rushikeshvartak ,
I have referred to different forums and documents. I am not able to find a clear answer to below query
Is it possible to refer account properties in WIN PS connection jsons ?