Solved

PowerShell Quota Violation Error

Posted on 2010-08-20
3
1,077 Views
Last Modified: 2012-05-10
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
Comment
Question by:jahhan
3 Comments
 
LVL 39

Expert Comment

by:Adam Brown
ID: 33490626
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
 
LVL 6

Accepted Solution

by:
craig_j_Lawrence earned 500 total points
ID: 33490970
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
 

Author Comment

by:jahhan
ID: 33512667
Is it possible to run the script against multiple arrays in an attempt to reduce the quota violation?
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question