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 (294k 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

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 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 (550 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

I need to change the following script to evaluate if the timestamp in a custom atribute is older than 1 year than the current date. # The condition is met ... .DayOfYear)) { $Context.ConditionIsMet = $True } else { $Context.ConditionIsMet = $False }

asked Dec 13 by msheppard (660 points)
0 votes
1 answer

Hi, Looking to see if this is normal behaviour which can be adjusted. I re-created one of our Dynamic Groups as a Test, when accessing the Group in the Admin Web ... which members are updated, is this controlled by SQL or the Web Service. Best Regards Mark

asked Oct 10 by MrLogan (40 points)
3,589 questions
3,278 answers
8,303 comments
548,123 users