0 votes

Are there any APIs or Powershell options that would allow me to pull out the exact action that is being approved in workflow?

Thanks!

by (950 points)

1 Answer

0 votes
by (215k points)

Hello,

You can get a description of the operation that is being approved. See the article called Managing Approval Requests in our SDK.

Can you specify more information on what you are trying to accomplish so that we could provide you with more specific guidance?

0

Hello,

Then this means that you do not have any approved requests that were initiated during the last 30 days.

If you want to output the information for all requests that were approved, you should use the following script:

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

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

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

# Get approval requests
$state = "ADM_APPROVALSTATE_APPROVED"
#$state = "ADM_APPROVALSTATE_DENIED"
#$state = "ADM_APPROVALSTATE_CANCELED"
$requests = $container.GetApprovalRequests($state)

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

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

Ok - I found the problem with the script. The inner "{" had to be commented out also, then it is just like your "all" script. If the inner "{" are left in, the result is the output I posted earlier.

But, there is another issue - this still does not return all the approvals in that have taken place. We do have many approvals in the last 30 days.

It only returned items in this range: 5/21/2012 12:00:00 AM to 6/26/2012 12:00:00 AM

Is there a resultsize limitation?

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

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

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

# Get approval requests  
$state = "ADM\_APPROVALSTATE\_APPROVED"  
#$state = "ADM\_APPROVALSTATE\_DENIED"  
#$state = "ADM\_APPROVALSTATE\_CANCELED"  
$requests = $container.GetApprovalRequests($state)  

$startDateTime = (Get-Date).AddDays(-30)  

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

# if ($request.CreationDate -gt $startDateTime)  
# {  
 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  
# }  
}
0

Hello,

Please check if you have any approved requests that were initiated since 6/26/2012. To do this:

  1. Login to Adaxes Administration Console under the credentials of a Service Administrator.
  2. Expand the service node that represents your service and select the Approval Requests node.
  3. In the Results Pane, click the arrow inside the Show field and select All requests.
  4. Click the arrow inside the Status field and select Approved.
  5. Click the Apply Filter button.
  6. Check if you have any requests with a Request Date that is later than 6/26/2012.
0

In this interface, it shows the same dates, but only shows 1000 records:


In the security log, there are thousands of additional approvals up through today.

0

Hello,

The thing is that Adaxes can output 1000 approval requests only. It should output the latest approval requests, but, instead, it outputs the first 1000 requests. This is a bug. Thank you for the bugreport. We'll fix it in one of our future releases.

For now, you can use a modified version of the above script. It 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()

Related questions

0 votes
1 answer

I am looking for a way to have approvers modify a tentative user account before approval. Is this feature available yet?

asked Nov 11, 2020 by mkvidera (60 points)
0 votes
1 answer

We are using a rolling number for Contract Resource accounts, contract0001, contract0002 and so on. We would like a script that parses the Contractor OU and assigns the ... Directors to create the accounts by themselves with just an approval from the IT dept.

asked Dec 6, 2017 by willy-wally (3.2k points)
0 votes
1 answer

On rare occasions, I get the following message when viewing the exchange properties; 'The operation cannot be executed by any available API.' This only happens to a ... these properties are displayed for users. Has anyone else experienced this issue at all?

asked Sep 1, 2016 by Martyn (70 points)
0 votes
1 answer

Hi, I'm going through my first Adaxes upgrade, from 2013.1 to 2014.1. I don't see all the properties I think are configured in the simple search. Config: Search ... 'd really like to sort these values in the "Available Columns" file, is that possible?

asked Dec 23, 2014 by theckel (520 points)
0 votes
1 answer

Hello We are currently building HRIS automation capabilties over the Adaxes API and it works quite well. The main issue we have is that Adaxes API works with simple ... to the least one): OAuth2 via the web UI Certificate Based Authentication Kerberos Thanks

asked Jun 25 by ygini (200 points)
2,779 questions
2,512 answers
6,576 comments
26,871 users