script for listing email addresses from two domains
greetings!
does know powershell script list email addresses users in primary , secondary domain?
with best regards,
bostjanc
i have solved script:
foreach($mailaddress in get-recipient -domaincontroller domain.company.local -resultsize unlimited | select -expand emailaddresses | %{$_.smtpaddress} | sort)
{
if ($mailaddress -like '*@domain.com')
{
$mailaddress+' ok'
}
}
foreach($mailaddress in get-recipient -domaincontroller domain2.company2.local -resultsize unlimited | select -expand emailaddresses | %{$_.smtpaddress} | sort)
{
if (($mailaddress -like '*@company.com') -or ($mailaddress -like '*@company.si'))
{
$mailaddress+' ok'
}
}
bostjanc
Windows Server > Windows PowerShell
Comments
Post a Comment