Morning and happy new year : )

I noticed my script to deny pending approvals >30 days is failing currently due to the error

Approvals: You are not allowed to deny this request.

I am using this script since a while and it was working well in the past, no changes has been made so far. https://www.adaxes.com/script-repository/approvedeny-outdated-approval-requests-s546.htm

The PowerShell script log shows Exception calling "Deny" with "1" argument(s): "You are not allowed to deny this request." Stack trace: at <ScriptBlock>, <No file>: line 35

Line 35 is

$request.Deny($reason)

My full script

$requestExpirationDays = 30 
$reason = "The request is denied because it was not processed within $requestExpirationDays days" 

# Bind to the 'Approval Requests' container
$approvalRequestsPath = $Context.GetWellKnownContainerPath("ApprovalRequests")
$container = $Context.BindToObject($approvalRequestsPath)

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

# Iterate through the requests
foreach ($guidInBytes in $requestGuidsInBytes) {
    # Bind to the approval request
    $guid = [Guid]$guidInBytes
    $request = $Context.BindToObjectEx("Adaxes://<GUID=$guid>", $True)

    # Check if we need to skip special approvals
    if( $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***" -or `
        $request.DescriptionOfOperationToApprove -like "***"      
        ) {
            continue
    }

    # Check whether the request must be denied
    $deadlineDate = $request.CreationDate.AddDays($requestExpirationDays)
    if ([System.DateTime]::Now -lt $deadlineDate) {
        continue
    }

    $request.Deny($reason)
}

My scheduled task (already re-created it for testing) image.png My action image.png

ago by (2.4k points)
ago by (307k points)
0

Hello,

To help us troubleshoot the issue, please, provide a screenshot of the Multi-server environment dialog. The dialog displays how many Adaxes services you have and what their versions are. For information on how to view it, see https://www.adaxes.com/help/MultiServerEnvironment. You can post the screenshot here or send to support@adaxes.com.

Also, please, log on into service with the credentials of the Adaxes service account (specified during Adaxes installation) and try running the script manually. Does it work fine then?

Finally, please, specify whether you can see the Adaxes service account in the list of service administrators. What about the unmanaged accounts list? For details on how to check the latter, have a look at section Add manually of the following article: https://www.adaxes.com/help/AddUsersToUnmanagedList/#add-manually.

ago by (2.4k points)
0

To help us troubleshoot the issue, please, provide a screenshot of the Multi-server environment dialog.

image.png

Also, please, log on into service with the credentials of the Adaxes service account (specified during Adaxes installation) and try running the script manually. Does it work fine then?

Do yo refer to this? image.png

If so, execution was successfully and approvals were denied image.png

Finally, please, specify whether you can see the Adaxes service account in the list of service administrators.

Where exactly?

What about the unmanaged accounts list?

The service account is not part of it. image.png

ago by (307k points)
0

Hello,

Do yo refer to this? If so, execution was successfully and approvals were denied

Did you log in as the Adaxes service account?

Where exactly?

There is a link to an article on how to check/change the list of service administrators in our previous post. Here it is again: https://www.adaxes.com/help/AddRemoveServiceAdministrators.

Please log in or register to answer this question.

Related questions

We get the following error when attempting to edit a room or equipment mailbox in the web interface. We can edit them using the admin console. I am a full Adaxes Admin so I don't think permissions. I also don't see an error in the logs.

asked Dec 9, 2020 by mark.it.admin (2.3k points)
0 votes
1 answer

Just recently built a new server, installed 2025.1, and restored configuration from a backup of our other server running 2023.2. I updated the web interface address in ... d6d4f3bd7654 and I'm able to approve/deny from that interface without issue. Any ideas?

asked May 13, 2025 by msinger (230 points)
0 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)
+4 votes
1 answer

Hi Evryone, I am trying to set up an external portal within a new webserver on dmz, and with only access to a webservice created from selfservice. The new webservice is only ... login, only reset password. What I am mising there that its not working? Thanks,

asked Nov 26, 2021 by yagoityd (20 points)
0 votes
0 answers

Is there a comparison between the OnPrem user object and Entra user object in the built-in condition? Which determines the most recent inactivity from both environments. Or should a choice be made between the OnPrem domain or Entra based on the Activity scope?

asked Dec 13, 2024 by IwistIT (60 points)
0 votes
1 answer