Hi experts i am using the below ps1 to get mailbox statistics from exchange online powershell module for 3500 users, but i am getting session timeout on powershell so i have exported my mailboxes to a csv file, i want to import the csv file and pull the below information, experts guide me on this.<\/p>\n
foreach($users in Get-Mailbox -ResultSize Unlimited){$users | Foreach-Object { \n$user = $_ \n$stats = Get-MailboxStatistics $user.Name \nNew-Object -TypeName PSObject -Property @{ \nFirstName = $User.Firstname\nLastName = $User.Lastname\nIssueWarningQuota = $User.IssueWarningQuota \nProhibitSendQuota = $User.ProhibitSendQuota \nProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota \nTotalItemSize = $stats.TotalItemSize \n} \n}\n}\n\n<\/code><\/pre>","upvoteCount":4,"answerCount":8,"datePublished":"2018-10-24T15:21:44.000Z","author":{"@type":"Person","name":"rogerroger3","url":"https://community.spiceworks.com/u/rogerroger3"},"acceptedAnswer":{"@type":"Answer","text":"
Advertisement
1st name lastname do do support here, maybe this helps<\/p>\n
$outtbl = @()\n$users = Get-Mailbox -ResultSize Unlimited|select alias, Name,displayname,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,@{n='Firstname';e={$_.displayname.split(' ')[0]}},@{n='Lastname';e={$_.displayname.split(' ')[1]}}\n$users | % {\n $x = Get-MailboxStatistics $_.alias | Select TotalItemSize\n $t = New-Object PSObject -Property @{\nName = $_.Name\nFirstname = $_.Firstname\nLastName = $_.lastname\nIssueWarningQuota = $_.IssueWarningQuota \nProhibitSendQuota = $_.ProhibitSendQuota \nProhibitSendReceiveQuota = $_.ProhibitSendReceiveQuota \nTotalItemSize = $X.TotalItemSize\n }\n $outtbl += $t\n}\n\n$outtbl ## |export-csv c:\\data.csv -NoTypeInformation\n<\/code><\/pre>","upvoteCount":1,"datePublished":"2018-10-24T23:44:45.000Z","url":"https://community.spiceworks.com/t/mailbox-statistics/680301/5","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},"suggestedAnswer":[{"@type":"Answer","text":"
Advertisement
Hi experts i am using the below ps1 to get mailbox statistics from exchange online powershell module for 3500 users, but i am getting session timeout on powershell so i have exported my mailboxes to a csv file, i want to import the csv file and pull the below information, experts guide me on this.<\/p>\n
foreach($users in Get-Mailbox -ResultSize Unlimited){$users | Foreach-Object { \n$user = $_ \n$stats = Get-MailboxStatistics $user.Name \nNew-Object -TypeName PSObject -Property @{ \nFirstName = $User.Firstname\nLastName = $User.Lastname\nIssueWarningQuota = $User.IssueWarningQuota \nProhibitSendQuota = $User.ProhibitSendQuota \nProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota \nTotalItemSize = $stats.TotalItemSize \n} \n}\n}\n\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2018-10-24T15:21:44.000Z","url":"https://community.spiceworks.com/t/mailbox-statistics/680301/1","author":{"@type":"Person","name":"rogerroger3","url":"https://community.spiceworks.com/u/rogerroger3"}},{"@type":"Answer","text":"If you post code, please use the insert code button! Please and thank you!<\/p>