0 votes

I have reviewed the the actual logs under logging and can see tasks that went off for approval, but when I select Approval Requests - I cannot find them under approved, denied, or cancelled. Where can I find out who approved these items and when? I believe it may be a limitation problem as when I select All - Approved it shows me 1000 and that never grows beyond that number.

by (360 points)

1 Answer

0 votes
by (215k points)

Hello Michael,

Currently, Adaxes shows you only 1000 latest Approval Requests. The task to show all Approval Requests is in our TODO list.

For now, you can use a PowerShell script that outputs all approved requests that were initiated during the last X days. The number of days is specified by the $daysNumber variable. Here it is:

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

$daysNumber = 30 # TODO: modify me

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

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

# Get approval requests
$state = 1 # Approved request
#$state = 2 # Denied request
#$state = 3 # Canceled request

$startDateTime = ((Get-Date).AddDays(-$daysNumber)).ToFileTime()

$searcher.SearchFilter = "(&(objectCategory=adm-ApprovalRequest)(adm-ApprovalState=$state)(adm-ApprovalRequestCreationTime>=$startDateTime))"
$searcher.PageSize = 500

$requests = $searcher.ExecuteSearch()

# Iterate through the requests
foreach($request in $requests.FetchAll())
{
    $request = $admService.OpenObject($request.AdsPath, $NULL, $NULL, 0)

    Write-Host "Date: " $request.CreationDate
    Write-Host "Operation:" $request.DescriptionOfOperationToApprove
    Write-Host "ProcessedBy:" $request.ProcessedBy.Get("name")
    Write-Host "Requestor:" $request.Requestor.Get("name")
    Write-Host
}

$requests.Dispose()
0

Thank you, could I get this to wrtie to a file?

0

Hello Michael,

Yes, sure. This version of the script outputs the Approval Requests information to the CSV file specified by $csvFilePath.

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

$csvFilePath = "\\server\share\File.csv" # TODO: modify me
$daysNumber = 30 # TODO: modify me

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

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

# Get approval requests
$state = 1 # Approved request
#$state = 2 # Denied request
#$state = 3 # Canceled request

$startDateTime = ((Get-Date).AddDays(-$daysNumber)).ToFileTime()

$searcher.SearchFilter = "(&(objectCategory=adm-ApprovalRequest)(adm-ApprovalState=$state)(adm-ApprovalRequestCreationTime>=$startDateTime))"
$searcher.PageSize = 500

$requests = $searcher.ExecuteSearch()

# Iterate through the requests
$newCSVObject = @()
foreach($request in $requests.FetchAll())
{
    $request = $admService.OpenObject($request.AdsPath, $NULL, $NULL, 0)

    $newPSObject = New-Object PSObject
    $newPSObject | Add-Member -Name Date -Value $request.CreationDate -MemberType NoteProperty
    $newPSObject | Add-Member -Name Operation -Value $request.DescriptionOfOperationToApprove -MemberType NoteProperty
    $newPSObject | Add-Member -Name ProcessedBy -Value $request.ProcessedBy.Get("name") -MemberType NoteProperty
    $newPSObject | Add-Member -Name Requestor -Value $request.Requestor.Get("name") -MemberType NoteProperty

    $newCSVObject += $newPSObject
}

$newCSVObject | Export-CSV $csvFilePath -NoType
$requests.Dispose()
0

Starting from version 2013.1, Adaxes shows all Approval Requests that match the search filter. The limitation of showing only 1000 Approval Requests has been removed.

Related questions

0 votes
1 answer

I have have admin rights and am in the "Request Approvers" group. I have a dearth of old approval requests to delete. I saw I could not delete them until I denied them ... says I have "No approval requests." How can I delete these denied entries? Thanks, Scott

asked Feb 26, 2021 by chappyshi (40 points)
0 votes
1 answer

On Approval Requests, in the web console, Initiator shows "N/A" instead of the custom command scheduled task. The admin console shows the custom command scheduled task though. Any way to fix that?

asked Jan 21, 2021 by mark.it.admin (1.8k points)
0 votes
1 answer

Hi, How can I get only 1 mail with the Approval notifications in, instead of multiple? I have a sheduled task to disable all inactive users after 90 days, and it should be approved.. but I don't want 1 mail per user.. Thanks.

asked Sep 9, 2019 by dkkela (100 points)
0 votes
1 answer

Is there a way to show the details of the operation in the My Approvals request? In previous version, the operation details were expanded to see the target. In the latest ... and new version interfaces. How can I get the operation details to be visible again?

asked Oct 8, 2018 by anthony.phan (50 points)
0 votes
1 answer

I previously had access to this area but when I now look at the area I can see All Requests > Pending but not My Requests or My Approvals. when I attempt that I get the ... accessing. I've asked our other Admins and no one has made changes as far as I know.

asked Feb 21, 2018 by AlanWJ (150 points)
2,756 questions
2,490 answers
6,522 comments
1,458,707 users