0 votes

I am in need of a way to email a csv of everyone who's EmplyeeHireDate (AD feild) is in the current month but not in this year. I will need to have the ablity to define which AD fields I use. I am going to need to have this export send monthly. I searched the repo but did not find anything. Has one already been written?

by (1.3k points)
0

Hello,

It can be done by creating and then scheduling a custom report. For us to help you with the report, please, specify what exactly you mean by define which AD fields I use. Is it about the columns to be present in the report?

0

Yes it is the coliumns in the report

0

Hello,

Thank you for clarifying. It can be done using a custom report. The report can be available for manual generation in the Web interface and Administration console. Also, you can schedule the report delivery (e.g. as a CSV file via email). In the latter case, you will be able to predefine the columns that will be present in the delivered report. Does this approach meet your needs?

0

How to I create it to include every account that has a Hire Date with in the current month but not in the current year?

1 Answer

0 votes
by (289k points)

Hello, To create the report:

  1. Launch Adaxes Administration console.
  2. In the Console Tree, right-click your service node.
  3. In the context menu, navigate to New and click Report. image.png
  4. Specify a report name.
  5. In the Generate the report using section, keep the Active Directory search option selected. image.png
  6. Click Next.
  7. Click New.
  8. Click Next twice.
  9. Click Finish.
  10. Click Next three times.
  11. In the Search filter field, enter the following: (sAMAccountType=805306368)
  12. Click Exclude below (it will change to Include). image.png
  13. Click Add Condition. image.png
  14. Select If PowerShell script returns true.
  15. Paste the below script into the Script field. In the script, the $property variable specifies the LDAP name of the Hire Date property.
$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.Month -eq $currentDate.Month) -and ($compareDate.Year -ne $currentDate.Year)

image.png 6. Enter a short description and click OK. 7. Click Next and finish creating the report.

For information on how to schedule reports, have a look at the following tutorial: https://www.adaxes.com/tutorials_ActiveDirectoryManagement_ScheduleReports.htm.

Related questions

0 votes
1 answer

Can you clarify the answer as it's a bit confusing? Will there be new major release available this month?

asked Nov 17, 2022 by ColinB (180 points)
0 votes
1 answer

I need to insert this condition: # The condition is met if $Context.ConditionIsMet is set to $True. # $Context.ConditionIsMet = $False $day = Get-Date -UFormat %V $Context. ... I need to get week number of month in gregorian calendar. Thanks in advance, Simone

asked Jan 17, 2022 by Simone.Vailati (430 points)
0 votes
1 answer

We have a preoperty pattern for accepted Country names which has a list of codes. For our case country code VM which "Vietnam" and I believe based on some google research "Viet Nam" is also correct.

asked Jul 12 by Vish539 (460 points)
0 votes
1 answer

I don't understand how you would use this searcher function. Can you show me in this example? Import-Module ImportExcel #set up variables $currentTime = Get-Date ... $Context.BindToObjectByDN($NewU) $U.Put("adm-CustomAttributeBoolean6", $False) $U.SetInfo() }

asked Dec 14, 2023 by mightycabal (1.0k points)
0 votes
1 answer

As the title says is it still a requirement?

asked Feb 23, 2023 by techg (320 points)
3,549 questions
3,240 answers
8,233 comments
547,827 users