码迷,mamicode.com
首页 > 系统相关 > 详细

【转载】Powershell获取世纪互联Office365所有用户最后一次登录时间

时间:2014-10-21 10:04:59      阅读:472      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   ar   for   sp   div   on   

 1 #$Mails=get-mailbox -ResultSize 10
 2 $Mails=get-mailbox -ResultSize Unlimited
 3 $Mails | Measure-Object
 4 
 5 $i=0
 6 
 7 foreach ($Mail in $Mails) 
 8 {
 9 $i=$i+1
10 $mailbox=Get-MailboxStatistics $Mail.UserPrincipalName
11 $content=-join($i,"`t",$Mail.UserPrincipalName,"`t",$mailbox.LastLogonTime)
12 #echo $content
13 $contents=-join($contents,$content,"`n")
14 }
15 
16 Start-Transcript -path .\Office365LastLogon.csv -Append -Force
17 $contents
18 Stop-Transcript 

http://www.smallrascal.cn/smallrascal/article.asp?id=2085

【转载】Powershell获取世纪互联Office365所有用户最后一次登录时间

标签:style   blog   http   color   ar   for   sp   div   on   

原文地址:http://www.cnblogs.com/SignalTips/p/4026776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!