Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1118
  • Last Modified:

PowerShell Quota Violation Error

I am running the following script to collect the number of emails each Exchange 2003 generates.

$Date = get-date -uformat "%Y%m%d"
$outFile = "C:\scripts\get-exchangevolume_$date.csv"
$servers= ‘server01','server02'
$transform = @{  
    1028 = "deliver";  
    1021 = "badmail";  
    1031 = "send";  
    1026 = "fail"}  
$res = Get-WmiObject -Namespace "root\MicrosoftExchangeV2" -computername $servers -Class Exchange_MessageTrackingEntry  |  
    where-object{$_.senderaddress -notmatch "-IS@" -and $_.senderaddress -and $_.senderaddress -notmatch "EX:/"} |  
        %{new-object -TypeName psobject -Property @{
                  eventid = $transform.([int]$_.entrytype);  
            week = get-date([DateTime]::ParseExact($_.timelogged.substring(0,8),"yyyyMMdd", [System.Globalization.CultureInfo]::InvariantCulture)) -uformat %V  
            }  
        } | ?{$_.eventid} |  
        Group-Object week, eventid | %{new-object -typename psobject -property @{week=$_.values[0];eventid=$_.values[1];volume=$_.count}} `
            | Select-Object eventid, volume, week, @{n='Server';e={$servers}}`
            | Sort-Object week | export-csv $outFile -notype


When I run this script I receive an error message of:
Quota violation
At :line:9 char:20
+ $res = Get-WmiObject <<<<  -Namespace "root\MicrosoftExchangeV2" -computername $servers -Class Exchange_MessageTrackingEntry  |  


0
jahhan
Asked:
jahhan
1 Solution
 
Adam BrownSr Solutions ArchitectCommented:
You can only pass one computer at a time to get-wmiobject. Passing an array of strings to get-wmiobject is likely causing that particular error. I haven't really tried to use Powershell to pull information off an Exchange 2k3 server, so I don't think I can help you with the rest, though.
0
 
craig_j_LawrenceCommented:
there is also a known issue with large wmi queries to Windows 2003 server as per this article: http://support.microsoft.com/kb/828653

hope this helps
0
 
jahhanAuthor Commented:
Is it possible to run the script against multiple arrays in an attempt to reduce the quota violation?
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now