0 votes

hello permission to ask about how to make a report based on time span, in my case, I want to create a report of the recently created user but the result of my script execution doesn't show anything.

here is the script from my code:

`# Get parameter values
$str = "%param-str%"
$end = "%param-end%"

$span = New-TimeSpan -Start $str -End $end


# Search filter
$filterUsers = "(&(sAMAccountType=805306368)(|(!(msExchRecipientTypeDetails=*))(!(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=7276219883574))))"
$filterCreatedAfter = "(whenCreated>=$span)"
$filter = "(&" + $filterUsers + $filterCreatedAfter + ")"
$Context.DirectorySearcher.AppendFilter($filter)

# Generate report
$Context.Items.Add($Context.DirectorySearcher)`

Output Script:

Capture.PNG

by (100 points)

1 Answer

0 votes
by (301k points)

Hello,

To achieve the desired behavior, there is no need to use scripts. You can have the report generated based on search and use the following LDAP filter:

(&(sAMAccountType=805306368)(whenCreated>=%param-str:format[yyyyMMddHHmmss.0Z],,,utc%)(whenCreated<=%param-end:format[yyyyMMddHHmmss.0Z],,,utc%)(|(!(msExchRecipientTypeDetails=*))(!(msExchRecipientTypeDetails:1.2.840.113556.1.4.804:=7276219883574))))

For more details on how to use value references, have a look at the following helpa rticle: https://www.adaxes.com/help/ValueReferences.

0

Thank you is solved

Related questions

0 votes
1 answer

Hi team, is it somehow possible to fetch and export information from scheduled tasks and rule based groups about their schedule time? Maybe also about the next run time and how ... an overview and see if some or too many tasks are running at the same time.

asked Mar 5 by wintec01 (1.8k points)
0 votes
1 answer

I created a Report asking the report to get the Assinged Microsoft Supbsription license assinged to the Users, When the Reports runs it geta few users but time out ... way to increase the time Out oprtion fro Reports that are getting information from Azure?

asked May 16, 2024 by George.Holden (60 points)
0 votes
1 answer

Hi, I've tried to modify a existing report to my needs, without success. The requirement ist to see the add/moved from a group. Like here: Would this be possible with Adaxes? Thanks

asked Feb 20, 2023 by boris (570 points)
0 votes
1 answer

Good Day I've found what i want and is this Scripts Repository https://www.adaxes.com/script-repository/output-the-last-time-a-distribution-list-received-mail-s122.htm. Is ... in to a Report with the addition to add one more then one Distribution? Thank you

asked May 11, 2022 by Sandberg94 (340 points)
0 votes
1 answer

This is only to disable user account

asked Apr 18 by Erik Lovlie (20 points)
3,679 questions
3,361 answers
8,504 comments
549,369 users