get-mobiledevicestatistics command exchange online

Welcome Forums General PowerShell Q&A get-mobiledevicestatistics command exchange online

Viewing 0 reply threads
  • Author
    • #211029
      Topics: 1
      Replies: 0
      Points: -9
      Rank: Member

      Need assistance with a script. The script works great, except for one thing. I cant seem to figure out how to export the primary smtp address for the mailbox. Script is below. Thank you very much for any assistance.


      $today = get-date -format yyyyMMdd

      $thisdevice [email protected]()
      $incre = 0
      $o365users = import-csv C:\temp\MobileDevice\mobiledevice_$today.csv
      foreach ($item in $o365users)
      $userdevices= get-mobiledevicestatistics -mailbox $item.alias
      if($null -ne $userdevices) {
      foreach ($device in $userdevices) {
      $device=$device |Select-Object deviceos,DeviceModel,lastsuccesssync,guid
      $thisdevice+=new-object psobject -property @{loginID=$item.alias;Name=$;Email=$item.primarysmtpaddress;Model=$device.devicemodel;Deviceos=$device.deviceos;lastsuccesssync=$device.lastsuccesssync;guid=$device.guid}
      #if($device.lastsuccesssync -lt (get-date).addDays(-30)){
      #remove-mobiledevice $device.guid#
      $thisdevice |export-csv -append c:\temp\mobiledevice\mobiledeviceoutput_$today.csv

Viewing 0 reply threads
  • The topic ‘get-mobiledevicestatistics command exchange online’ is closed to new replies.