nikhleshsdg
(Nikhlesh Sheoran)
August 7, 2024, 7:52am
1
Hello,
I am using After Modify Rule to trigger the Powershell script. After requesting Entitlement access, After Modify rule is triggered which contains the Requestor Comments (as per attached logs), now I need to get these comments in Powershell script.
Can anyone help on this?
Thanks.
jesvin90
(Jesvin Joseph)
August 7, 2024, 1:42pm
3
Hi @nikhleshsdg ,
Try something as below :
$sReader = New-Object System.IO.StringReader([System.String]$requestString);
$xmlReader = [System.xml.XmlTextReader]([sailpoint.utils.xml.XmlUtil]::getReader($sReader));
$requestObject = New-Object Sailpoint.Utils.objects.AccountRequest($xmlReader);
$attributesMap = $requestObject.Attributes
You can then write the value of $attributesMap to a log file to see if the comments value exist in the output.
If yes, you can call it. As I can’t see your full log file, it could be something as below or make required adjustments
$attributesMap.comments
OR $attributesMap.comments.value
OR
$attributesMap.IdnAccessRequestAttributes.comments
OR $attributesMap.IdnAccessRequestAttributes.comments.value
1 Like
nikhleshsdg
(Nikhlesh Sheoran)
August 9, 2024, 6:06am
4
HI @jesvin90 ,
Thanks for the suggestion but it did not work out. I have attached the complete log of After modify script, if you can suggest something else.
jesvin90
(Jesvin Joseph)
August 9, 2024, 8:12am
5
Try this:
$sReader = New-Object System.IO.StringReader([System.String]$requestString);
$xmlReader = [System.xml.XmlTextReader]([sailpoint.utils.xml.XmlUtil]::getReader($sReader));
$requestObject = New-Object Sailpoint.Utils.objects.AccountRequest($xmlReader);
$comments = $requestObject.AttributeRequests.Attributes.comments
nikhleshsdg
(Nikhlesh Sheoran)
August 9, 2024, 9:36am
6
HI @jesvin90 ,
Yes, it worked. thank you for your help.
system
(system)
Closed
October 8, 2024, 9:37am
7
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.