How do I query for AD groups which were created or updated yesterday?

Hi,

I'm trying to work out how I can query/filter AD groups which were created or updated yesterday? The below works as intended for created groups but I can't find anything that allows me to query for updated date? The below is part of a larger script which I can share if needed. 

$cutOff = (get-date).AddDays(-1) 

# Retrieve AD groups and export output
Get-QADGroup -createdon $cutOff -proxy -Connection $Connect -Credential $Credentials -SizeLimit 0 | Export-Csv $file -NoTypeInformation 

Regards,

Steven

Parents
  • You can query the groups that were modified yesterday using the -LastChangedOn parameter:

    Get-QADGroup -LastChangedOn $cutOff -proxy -Connection $Connect -Credential $Credentials -SizeLimit 0 | Export-Csv $file -NoTypeInformation

    You can't do this all in one query as far as I can tell, but you could gather your results, format, and organize it before outputting it to a file, or just output to two files to make it simpler.

Reply
  • You can query the groups that were modified yesterday using the -LastChangedOn parameter:

    Get-QADGroup -LastChangedOn $cutOff -proxy -Connection $Connect -Credential $Credentials -SizeLimit 0 | Export-Csv $file -NoTypeInformation

    You can't do this all in one query as far as I can tell, but you could gather your results, format, and organize it before outputting it to a file, or just output to two files to make it simpler.

Children