0 votes

Hello, you helped us with a script to set the oof-message. Now we want to know, if it's possible to activate/deactivate the mail-forwarding option time-based. In the script we have

$oofStartDateParameterName = "param-abw-beginn"
$oofEndDateParameterName = "param-abw-ende"

We want to activate mail-forwarding on "param-abw-beginn" and deactivate it accordingly on "param-abw-ende"

Can you help me with that? Thanks Carsten

by (120 points)
0

Hello Carsten,

Yes, it is possible. In addition to your custom command, you will need a Scheduled task. The command will preserve the dates from the parameters in Adaxes custom date attributes and the task will activate/deactivate email forwarding accordingly. For us to provide you with details, please, specify who should be set as forward to when the feature gets enabled.

0

Hello,

forward-to is generated by a template.

CN=Postfach.%departmentNumber%,OU=Team-Postfächer,OU=TEAMS,DC=lohn-ag,DC=local

departmentNumber is from the user the command is run for.

1 Answer

0 votes
by (238k points)

Hello Carsten,

Thank you for specifying. In this case, you should have something like the following:

Custom command image.png

Scheduled task image.png

For details about using the Modify Exchange properties action, have a look at the following tutorial: https://www.adaxes.com/help/AutomateExchangeMailboxConfiguration/.

0

One additional question. the condition in the scheduled task If the 'abw-beginn' parameter equals '%datetime%' should check for the selected date AND time, but it seems to only check for the date. Example: User selects abw-beginn: today, 18:00 the part with the oof-message is correct, oof-message is activated at 18:00. but the mail forwarding part is actived after the next run of the scheduled task (datetime equals current date, the time value is ignored) I check it by selecting the beginning for tomorrow, 08:00. Mail forwarding is set on the next run of the scheduled task after 00:00, not on 08:00 as is selected.

Is there any solution to this? Thanks for helping.

0

Hello Carsten,

You can use a script condition to compare not only the date part, but also the time. However, this is not a good idea as you will need to make sure that the scheduled task is executed exactly at the time set in the attribute. It means that the condition will hardly be met for any user. Still here is the script you can try.

$property = "adm-CustomAttributeDate1" # TODO: modify me

# Get attribute value
try
{
    $compareDate = $Context.TargetObject.Get($property)    
}
catch
{
    $Context.ConditionIsMet = $False
    return
}

# Compare dates
$currentDate = [System.DateTime]::UtcNow
$Context.ConditionIsMet = ($compareDate.Date -eq $currentDate.Date) -and ($compareDate.Hour -eq $currentDate.Hour)

Related questions

0 votes
1 answer

Automation of user creation based on ServiceNow ticket creation.

asked Jan 24, 2022 by tdetmer (20 points)
0 votes
1 answer

I would like the HR to be able to set the date of deprovision User. So that it's executed on set date and not on command. I Tryed with parameter (Date/Time picker) ... it possible with custom command or do i have to make Scheduled Task with (Date/time picker)?

asked Jan 20, 2021 by Sandberg94 (340 points)
0 votes
1 answer

We're trying to setup a new action in our Web interface that runs on User's that are currently in an OU called 'New Starters' that is in all of our domains (An ... no results, There are no other fields we can use that are unique to accounts in those OUs

asked Feb 7, 2020 by richarddewis (260 points)
0 votes
1 answer

I'd like to be able to either send an email report or export a CSV of all of the business rules carried out when a user is disabled. This would be ... Management Activity section but this includes things that weren't part of the disable operation. Thanks

asked Feb 19, 2020 by bavery (250 points)
0 votes
0 answers

Before Deactivation of an Account on the Webinterface our Help Desk need to change the AD User Description manually. Is it possible to force a manual change before deactivation ?

asked Feb 7, 2020 by lv01 (20 points)
2,947 questions
2,663 answers
6,885 comments
162,243 users