Exchange 2007 PS script: Quota limit exceeded + emailadres?

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

Anoniem: 398658

Topicstarter
Hallo,

ik ben bezig met een powershell scriptje welke ik online vond, wat proberen aan te passen.
Het PS script welke ik vond heeft volgende inhoud:

View only mailboxes that have exceeded their mailbox quotas To view the size and quota status of only those mailboxes that are larger than their configured mailbox quota values, and to export the results to a CSV file named "C:\My Documents\Exceeded Quotas.csv", run the following command:

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -ne "BelowLimit"} | Select DisplayName,StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV "C:\My Documents\Exceeded Quotas.csv" -NoTypeInformation

Nu had ik graag dat in diezelfde CSV ook het primaire SMTP adres van de gebruiker die de quota overschreden heeft, toegevoegd werd. De bedoeling is om het zo bondig mogelijk te houden, enkel de exceeders en hun email adres in 1 CSV file is voldoende, dan kan ik hen meteen mailen om een cleanup te starten.

heb al verschillende aanpassingen gedaan in het script maar kon de kolom die ik liet aanmaken voor het emailadres helaas nog niet automatisch laten invullen...
Iemand die me wat verder kan helpen?

Acties:
  • 0 Henk 'm!

  • alt-92
  • Registratie: Maart 2000
  • Niet online

alt-92

ye olde farte

Anoniem: 398658 schreef op vrijdag 17 juni 2011 @ 17:18:

heb al verschillende aanpassingen gedaan in het script
Welke dan?

ik heb een 864 GB floppydrive! - certified prutser - the social skills of a thermonuclear device


Acties:
  • 0 Henk 'm!

  • Muppet
  • Registratie: Maart 2001
  • Laatst online: 10-09-2024

Muppet

GT: Beestig

Volgens mij is SMTP Adress alleen geen property van Get-MailboxStatistics maar van Get-Mailbox ... dus je zal ff moeten truuken ..

Zoiets?

Get-Mailbox -ResultSize Unlimited | % { $Email = $_.primarysmtpaddress; $_ | Get-MailboxStatistics | % {$_.StorageLimitStatus -ne "BelowLimit"} | Select DisplayName,@{Name="EmailAddress";expression={$Email}},StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV "C:\My Documents\Exceeded Quotas.csv" -NoTypeInformation

There is no art to find the minds construction in the face


Acties:
  • 0 Henk 'm!

Anoniem: 398658

Topicstarter
je hebt me erg veel geholpen, oprechte dank. Dankzij jou heb ik het gevonden door lichte aanpassing van uw script:

Get-Mailbox -ResultSize Unlimited | % { $Email = $_.primarysmtpaddress; $_} | Get-MailboxStatistics | where {$_.StorageLimitStatus -ne "BelowLimit"} | Select DisplayName,@{Name="EmailAddress";expression={$Email}},StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV "\\nas\public\MailboxQuota.csv" -NoTypeInformation