Last user created and if domain admins member

Hello everybody
I ask for help regarding a Powershell script:

Get the list of users created in the last x days and whether or not they
are part of the Domain Admins group.

The list should look like this:

Username Created DomainAdmin
Superman 5-10-2021 Yes
WonderWoman 2021/05/09 No

The script should be run on the main forest DC and must query the DCs of the sub domains.

My forest is so composed

The script must run on the DC and query

This script only works on the current domain (example
I can’t change it to query sub domains

Import-Module ActiveDirectory
$FileName = "C:\Scripts\Progetto - RecentlyUserCreated\Export.csv"
if (Test-Path $FileName) {
  Remove-Item $FileName

$Tab = [char]9

"SAMACCOUNTNAME"+$Tab+"NAME"+$Tab+"Surname"+$Tab+"WhenCreated"+$Tab+"Domain Admin" >> $FileName
$Members = Get-ADUser -Filter * -Property whenCreated | Where {$_.whenCreated -gt $datecutoff} 
Foreach ($Member in $Members) {
	[bool]$IsDomainAdmin = (Get-ADUser $Member -Properties memberof).memberof -contains (Get-ADGroup "Domain Admins")
	$Member.samaccountname+$Tab+$Member.givenname+$Tab+$Member.surname+$Tab+$Member.whenCreated+$Tab+$IsDomainAdmin >> $FileName

I’ve been trying for a few days but I can’t.
Someone knew how to help me.

Thanks everyone in advance.

Hello @thebonapowershell,
Did you try to use -Server parameter to specify server you want to query?

You would loop trough list of your servers and query them with your script.
Reference: Get-ADUser
Hope that helps.