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)
}