0 votes

Hello,

I'm writing another approval cleanup script but i cannot seem to find the attribute I am looking for.
When u check the Adaxes Console u can see a request date for each approval.

When i loop through my approvals with powershell i need to remove the approvals for a certain task after 15 days.
I can find a creationdate attribute on the request, but it is not the same date as shown on the request date.
Is there another attribute i am missing for the moment?
Here is my code:

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

$admNS = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$admService = $admNS.GetServiceDirectly("localhost")

$teller = 0

# Bind to the Approval Requests container
$containerPath = $admService.Backend.GetConfigurationContainerPath(
    "ApprovalRequests")
$container = $admService.OpenObject($containerPath.ToString(),
    $NULL, $NULL, 0)

# Get all pending approval requests
$requests = $container.GetApprovalRequests("ADM_APPROVALSTATE_PENDING")

# Iterate through the requests
foreach ($requestID in $requests)
{
    # Bind to the approval request
    $guid = New-Object "System.Guid" (,$requestID)
    $guid = $guid.ToString("B")
    $requestPath = "Adaxes://<GUID=$guid>"
    $request = $admService.OpenObject($requestPath, $NULL, $NULL, 0)
}
by (470 points)

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Hi Are there any plans to allow the creation of approval requests via PowerShell? My client has a requirement to allow staff to request new Teams, but the Team needs to ... could be a balance of both automated approval emails and not as required. Thanks Matt

asked Oct 12, 2023 by chappers77 (2.0k points)
+2 votes
1 answer

I am attempting to build out a report that shows all user accounts were approved by two different persons before being created. I have the workflow running correctly, ... this data stored in a specific location thats accessible by the reporting engine? Thanks!

asked Dec 16, 2019 by hendersonw (210 points)
0 votes
1 answer

Hi, I was just wondering if there was a way to force the format of the date picker value in the web approval interface. We have operation that are very time specific ... like that in the web interface. Example of the problem: Thank you, Jean-Simon Tremblay

asked Dec 3, 2021 by jsimon.tremblay (20 points)
0 votes
1 answer

I turned on the option to have "Approve" and "Deny" links sent in the approval request email. It seems to not be working through. Here is a screenshot of what it ... the link. I also tried using incognito mode in chrome. Same look. Appreciate the assistance!

asked Mar 29, 2021 by mark.it.admin (2.3k points)
+4 votes
1 answer

We set up a new hire form that has serveral custom text attributes that include pay rate, etc. These fields are routed to the correct departments via a PowerShell ... Is there anyway to prevent certain attributes from displaying in the approver request email?

asked Jan 8, 2020 by dhuffman (80 points)
3,348 questions
3,049 answers
7,789 comments
545,046 users