I am trying to build a script meant to send email to a targeted set of users (iPHone Users)
This is what I have so far.
$ASDevices = get-activesyncdevice -resultsize unlimited
$ASDisplaynames = $ASDevices | ?{$_.DeviceType -like "ip*"}
foreach ($ASdisplayname in $ASDisplayNames) {
get-mailbox -identity $ASdisplayname._UserDisplayName | select-object primarysmtpaddress
}
The part I'm having a problem with is it's not getting the list of users who are only iphone users.
If I run the $ASDevices String section and the $ASDisplaynames Sections
and then run $ASDisplayNames | ft UserDisplayName,DeviceType
I get the list of users I want.
However, if I instead run the script with foreach section and the getmailbox section, I end up with all Activesync users.
Bobby Pendino