0 votes

When reviewing approval tasks in the console under the properties of an existing request, you have the ability to ADD approvers to the request. The request is then available under the newly assigned users My Approvals. It would be great if when you ADDed an approver if they got an email as well. IF thats supposed to happen and this is a bug, please let me know. Thanks!

by (360 points)

1 Answer

0 votes
by (18.0k points)

Hello,

That is not a bug. We have a similar feature request for this in our issue tracker so I'll add another +1 to it. ;)
For now you can define a Scheduled Task that will execute a script to remind approvers to do their job. If necessary, we can modify the script to suit your needs.

# Reminder of Approval Requests that have not been handled yet
# Should be run as scheduled task every N hours

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

# Bind to the Approval Requests container
$approvalsPath = $admService.Backend.GetConfigurationContainerPath("ApprovalRequests")
$aprovalsContainer = $admService.OpenObject($approvalsPath.ToString(), $NULL, $NULL, 0)
# Get all pending approval requests
$aprovals = $aprovalsContainer.GetApprovalRequests("ADM_APPROVALSTATE_PENDING")

# Process all the pending requests
foreach ($requestID in $aprovals)
{
    # Bind to the approval request
    $guid = New-Object "System.Guid" (,$requestID)
    $guid = $guid.ToString("B")
    $approvalsPath = "Adaxes://<GUID=$guid>"
    $approval = $admService.OpenObject($approvalsPath, $NULL, $NULL, 0)
    $approvers = $approval.GetApproversInfo()
    # Send a notification reminder email to all aprovers
    foreach ($approver in $approvers.GetApproversEx($approval.Requestor, $approval.TargetObject))
    {
        try
        {
            $mail = $approver.Get("mail")
        }
        catch [System.Runtime.InteropServices.COMException]
        {
            $name = $approver.Name
            $Context.LogMessage("Email not specified for $name!", "Warning")
            continue
        }
        $Context.SendMail($mail, "<SUBJECT>", "<BODY-TEXT>", "<BODY-HTML>")
    }
}
0

Hello,

I tried this script in the current version. But it seems that the command
$aprovals = $aprovalsContainer.GetApprovalRequests("ADM_APPROVALSTATE_PENDING")
returns als requests (pending, approved, canceled).
Was something changed?

Thank you
Regards,
Thorsten

0

Hello,

No, nothing was changed in this method. Our QA team has just tested it once again and everything works as expected.
The only thing is that this script can be optimized a little by using new methods of the $Context variable. Here is rewritten script:

# Reminder of Approval Requests that have not been handled yet
# Should be run as scheduled task every N hours

# Bind to the Approval Requests container
$approvalsPath = $Context.GetWellKnownContainerPath("ApprovalRequests")
$aprovalsContainer = $Context.BindToObject($approvalsPath.ToString())
# Get all pending approval requests
$aprovals = $aprovalsContainer.GetApprovalRequests("ADM_APPROVALSTATE_PENDING")

# Process all the pending requests
foreach ($requestID in $aprovals)
{
    # Bind to the approval request
    $guid = New-Object "System.Guid" (,$requestID)
    $guid = $guid.ToString("B")
    $approvalsPath = "Adaxes://<GUID=$guid>"
    $approval = $Context.BindToObject($approvalsPath)
    $approvers = $approval.GetApproversInfo()
    # Send a notification reminder email to all aprovers
    foreach ($approver in $approvers.GetApproversEx($approval.Requestor, $approval.TargetObject))
    {
        try
        {
            $mail = $approver.Get("mail")
        }
        catch [System.Runtime.InteropServices.COMException]
        {
            $name = $approver.Name
            $Context.LogMessage("Email not specified for $name!", "Warning")
            continue
        }
        $Context.SendMail($mail, "<SUBJECT>", "<BODY-TEXT>", "<BODY-HTML>")
    }
}

Please test this script once again and let us know if it works incorrectly in your environment.

0

Hello,

same behaviour with the "old" script.
I want to check for 4 groups if there are group membership changes to be approved.
For one group I have such a approval request.
When I start the script a emal is sent to all managers of all 4 groups, not only to the one with an open request.

I have created a sheduled task with object type group and with the action run the script.

Did I understand something wrong ?

Thank you
Regards,
Thorsten

0

Hello,

The script sends an email notification to all approvers specified for the request. If you need a different behaviour, please provide more details.
To view approvers of a request:

  1. Launch Adaxes Administration Console.
  2. Select Approval Requests in the Console Tree.
  3. Right-click the request you need in the Result Pane and click Properties.
0

Hello,

it is ok to have all approvers of the request in the email.
But in my case it sends a email to managers/approvers of groups without a approval request as well.

Regarssa,
Thorsten

0

But in my case it sends a email to managers/approvers of groups without a approval request as well.

I don't think that's possible. Please do the following:

  1. Open Adaxes Administration Console.
  2. Select the Approval Requests node in the Console Tree.
  3. In the Show: drop-down list, select All Requests.
  4. In the Status: drop-down list, select Pending.
  5. Apply the filter.

You'll see all pending approval requests.
Right-click a request for which you think the scripts sends email notifications incorrectly. Click Properties in the context menu.
Post a screenshot of the Properties dialog here. Or send me a PM with the screenshot.

0

Thank you, but what I really needed and asked for was a script that when an approver was manually added through the Approval Requests console - that the new person would immediately(or in some reasonable timeframe) be notified with the same email(format and information) provided to the original approver.

Say someone is out on vacation and the original requestor calls and asks where and who their operation is waiting on, we tell them and they respond "but they are on vacation for 2 weeks, I can't wait that long!" We then go into the console Approval Requests and add the vacationing person's supervisor as an approver for the operation. I'd like them to get a notification(just like the originators) shortly thereafter which they can take action on.

Second, it would be great to have script similar to this, but that read the operations pending action creation date and after a determined period of time had expired, say 2 weeks, a script like this could send them a reminder email that they have requests pending which need their attention.

This really breaks down into two different requests/purposes and scripts.

0

Hello,

Thank you, but what I really needed and asked for was a script that when an approver was manually added through the Approval Requests console - that the new person would immediately(or in some reasonable timeframe) be notified with the same email(format and information) provided to the original approver.

This feature is already in out TODO list. We'll implement it in one of the nearest releases.

Second, it would be great to have script similar to this, but that read the operations pending action creation date and after a determined period of time had expired, say 2 weeks, a script like this could send them a reminder email that they have requests pending which need their attention.

Here is a modified script:

# Reminder of Approval Requests that have not been handled yet.
# Should be run as scheduled task.

$pendingDays = 14

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

# Bind to the Approval Requests container
$approvalsPath = $admService.Backend.GetConfigurationContainerPath("ApprovalRequests")
$aprovalsContainer = $admService.OpenObject($approvalsPath.ToString(), $NULL, $NULL, 0)
# Get all pending approval requests
$aprovals = $aprovalsContainer.GetApprovalRequests("ADM_APPROVALSTATE_PENDING")

# Process all the pending requests
foreach ($requestID in $aprovals)
{
    # Bind to the approval request
    $guid = New-Object "System.Guid" (,$requestID)
    $guid = $guid.ToString("B")
    $approvalsPath = "Adaxes://<GUID=$guid>"
    $approval = $admService.OpenObject($approvalsPath, $NULL, $NULL, 0)

    # Determine whether a notification needs to be sent
    $requestDeadLine = $approval.CreationDate.AddDays($pendingDays)
    if ([System.DateTime]::Now -lt $requestDeadLine)
    {
        continue
    }

    $approvers = $approval.GetApproversInfo()
    # Send a notification reminder email to all aprovers
    foreach ($approver in $approvers.GetApproversEx($approval.Requestor, $approval.TargetObject))
    {
        try
        {
            $mail = $approver.Get("mail")
        }
        catch [System.Runtime.InteropServices.COMException]
        {
            $name = $approver.Name
            $Context.LogMessage("Email not specified for $name!", "Warning")
            continue
        }
        $Context.SendMail($mail, "<SUBJECT>", "<BODY-TEXT>", "<BODY-HTML>")
    }
}

Related questions

0 votes
1 answer

Hi: With LAPS using new schema and encryption, is there a way to return that with Adaxes? Thanks!

asked May 30, 2023 by crobitaille (80 points)
0 votes
1 answer

How to deal with approval requests in a AD and AAD environment? I have recently created a workflow where I log on as a AD user and request to be a member of a AAD group, ... of member works despite the initial request was based on a AD user and not a AAD user.

asked May 2, 2023 by Daniel (80 points)
0 votes
1 answer

Hello, I'm trying to setup a business rule that will send an email to the user when they are added to a group. Under the User Object I don't have an option to Launch ... to get the new group member's email address so I can send a notification to it? Thanks!

asked Dec 1, 2015 by drew.tittle (810 points)
0 votes
1 answer

I'm creating a process where after a user account has been created some manual steps are completed and then, then the helpdesk will approve the confirmation email to be ... to do this? Screenshot of the disabled approval checkbox: https://imgur.com/a/mLa1H

asked Mar 22, 2018 by jake_h (300 points)
0 votes
1 answer

I need to be able to create a csv and email it once a week of accounts that have a date in %hiredate% that starts in the next 7 days. I need to include the full ... dept, and %hiredate% feilds in the CSV. Any help you can provide would be great. Thank you,

asked Sep 9, 2020 by hgletifer (1.3k points)
3,326 questions
3,026 answers
7,727 comments
544,679 users