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 am working on making a custom Approval Request notification E-mail, and I'd like to include the Approve and Deny buttons, but I haven't found a way to get ... awaiting-their-approval-s212.htm Do you have any suggestions on how to best generate the URLs?

asked Oct 29 by Martin (150 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)
3,548 questions
3,238 answers
8,232 comments
547,810 users