PowerShell Management Series (22) PowerShell Operations statistics mobile device logon Exchange situation

Source: Internet
Author: User

-----provide ad\exchange\lync\sharepoint\crm\sc\o365 and other Microsoft product implementation and outsourcing, qq:185426445. Phone 18666943750

Get-activesyncdevice Get mobile device information that the current user owns using the ActiveSync protocol
Get-activesyncdevicestatistics getting connection information for the current device

The Exchange 2013 command has been changed to the following command:

Get-mobiledevice Get mobile device information that the current user owns using the ActiveSync protocol
Get-mobiledevicestatistics getting connection information for the current device

The script is as follows:

Add-pssnapin microsoft.exchange*
$device =get-mobiledevice-resultsize Unlimited | Foreach-object {$_.identity}
$userlist = @ ()
foreach ($i in $device)
{
$DeviceStatistics =get-mobiledevicestatistics $i
$username =get-mobiledevice $i | Select-object Userdisplayname,name,friendlyname,devicetype,devicemodel,firstsynctime | Sort-object Userdisplayname
$userobject =new-object PsObject
$userobject | Add-member-membertype noteproperty-name Login name-value $username. Userdisplayname
$userobject | Add-member-membertype noteproperty-name Device detailed name-value $username. Name
$userobject | Add-member-membertype noteproperty-name device name-value $username. FriendlyName
$userobject | Add-member-membertype noteproperty-name Device Type-value $username. DeviceType
$userobject | Add-member-membertype noteproperty-name device Model-value $username. Devicemodel
$userobject | Add-member-membertype noteproperty-name First sync time-value $username. Firstsynctime
$userobject | Add-member-membertype noteproperty-name Device status-value $DeviceStatistics. Status
$userobject | Add-member-membertype Noteproperty-name Last Sync time-value $DeviceStatistics. Lastsuccesssync
$userlist + = $userobject
Echo $userlist
}
$userlist | Export-csv-path c: \ "Mobile device login summary table. csv"-notypeinformation-encoding utf8650) this.width=650; "Width=" 916 "height=" 314 " Title= "1.png" style= "width:713px;height:285px;" src= "http://s3.51cto.com/wyfs02/M02/59/B8/ Wkiom1tczz-xujplaamr7tvxskw678.jpg "alt=" Wkiom1tczz-xujplaamr7tvxskw678.jpg "/>

The final effect is as follows:

650) this.width=650; "Width=" 1137 "height=" 585 "title=" 1.png "style=" width:714px;height:490px; "src="/HTTP/ S3.51cto.com/wyfs02/m00/59/b5/wkiol1tc0mxyhksraal3ith7h_m947.jpg "alt=" Wkiol1tc0mxyhksraal3ith7h_m947.jpg "/>

This article is from the "Zhou Ping Microsoft Technology Exchange Platform" blog, please be sure to keep this source http://yuntcloud.blog.51cto.com/1173839/1614177

PowerShell Management Series (22) PowerShell Operations statistics mobile device logon Exchange situation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.