When i run this powershell command i get an error “the term get-mailboxstatistics is not recognized” why is that?<\/p>\n
$ExchangeServer = “xxxx\"<\/p>\n
$Top300Users = Get-MailboxStatistics -server $ExchangeServer |sort-object -Property totalitemsize -des |select-object Displayname, ItemCount, @{name=’Total Item Size (MB)’;expression={$_.totalitemsize/1MB}} -first 300 |Convertto-html<\/p>\n
$FromAddress = “xxxx”
\n$ToAddress = “xxxx”
\n$MessageSubject = “Weekly report: Biggest mailboxes on Exchange server ” + $ExchangeServer
\n$SMTPServer = “xxxx”<\/p>\n
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $Top300Users
\n$SMTPMessage.IsBodyHtml = $true<\/p>\n
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SMTPServer
\n$SMTPClient.Send($SMTPMessage)<\/p>","upvoteCount":1,"answerCount":2,"datePublished":"2012-03-19T12:25:14.000Z","author":{"@type":"Person","name":"effietsiopras6913","url":"https://community.spiceworks.com/u/effietsiopras6913"},"acceptedAnswer":{"@type":"Answer","text":"
Are you using regular powershell on the server or the exchange management shell? The EMS has a bunch of extra profile items and such that get loaded in specific to exchange.<\/p>","upvoteCount":3,"datePublished":"2012-03-19T12:31:24.000Z","url":"https://community.spiceworks.com/t/powershell-get-mailbox-stats/132911/2","author":{"@type":"Person","name":"chrisseiter","url":"https://community.spiceworks.com/u/chrisseiter"}},"suggestedAnswer":[{"@type":"Answer","text":"
When i run this powershell command i get an error “the term get-mailboxstatistics is not recognized” why is that?<\/p>\n
$ExchangeServer = “xxxx\"<\/p>\n
$Top300Users = Get-MailboxStatistics -server $ExchangeServer |sort-object -Property totalitemsize -des |select-object Displayname, ItemCount, @{name=’Total Item Size (MB)’;expression={$_.totalitemsize/1MB}} -first 300 |Convertto-html<\/p>\n
$FromAddress = “xxxx”
\n$ToAddress = “xxxx”
\n$MessageSubject = “Weekly report: Biggest mailboxes on Exchange server ” + $ExchangeServer
\n$SMTPServer = “xxxx”<\/p>\n
$SMTPMessage = New-Object System.Net.Mail.MailMessage $FromAddress, $ToAddress, $MessageSubject, $Top300Users
\n$SMTPMessage.IsBodyHtml = $true<\/p>\n
$SMTPClient = New-Object System.Net.Mail.SMTPClient $SMTPServer
\n$SMTPClient.Send($SMTPMessage)<\/p>","upvoteCount":1,"datePublished":"2012-03-19T12:25:14.000Z","url":"https://community.spiceworks.com/t/powershell-get-mailbox-stats/132911/1","author":{"@type":"Person","name":"effietsiopras6913","url":"https://community.spiceworks.com/u/effietsiopras6913"}}]}}