I am trying to dump our domain pwd policy for each domain. I can get the info individually but wish to do so in a foreach such as this:
$Domains = Import-Csv .\Domains.csv
Foreach ($Domain in $Domains) {Get-ADDefaultDomainPasswordPolicy -Identity $Domain}
but get error:
Cannot validate argument on parameter 'Identity'. The Identity property on the
argument is null or empty.
When I validate for $Domain I do see my csv header and a domain
DOMAINS
-------
Domain1.com
Is it my csv that is issue or the code?
Finally, I wish to dump this info to a single csv, for each domain, so would try:
| export-csv AllDomainsPWDPolicy.csv -NoTypeInformation
Thank you for the assistance…