Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Exchange 2010 Query

$
0
0

I have a very odd issue and I am not sure if it is PoSh or Exchange related but I will post it here anyway

Basically I have put together a PS1 file for our administrators to use which will prompt them for a username and it will return the name, mailbox size and warning status of the user. All of this works when locally run from the exchange server but when it is run remotely the MB information does not display but everything else does, very strange!

This is the process for a remote connection

Set-ExecutionPolicy RemoteSigned

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://OurExhcangeFQDN/powershell/" -Authentication Kerberos

Import-PSSession $Session

Then I run the script 

Get-MailboxStatistics | where {$_.ObjectClass -eq "Mailbox"} | Sort-Object TotalItemSize -Descending | ft @{label="User";expression={$_.DisplayName}},@{label="Total Size (MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="Items";expression={$_.ItemCount}},@{label="Storage Limit";expression={$_.StorageLimitStatus}} -auto

This is the result from a remote machine 

and this is this is the result from the same script being run from the Exchange server

Very strange!!!


Viewing all articles
Browse latest Browse all 10624

Trending Articles