get-mailbox -Filter scriipt issue

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jbrines
Posts: 14
Last visit: Tue Apr 28, 2009 11:07 pm

get-mailbox -Filter scriipt issue

Post by jbrines »

Hi Guys,
I have the follwoing script that creates a text file of users who are over the default quota and it works a treat. Until I want it to create it as an HTML or and CSV file. Insteah of only giving me the filtered detail it gives me all of the get-mailbox data.
So the following works....
get-mailbox -Filter "UseDatabaseQuotaDefaults -eq `$false" -ResultSize Unlimited > OverDefaultQuota.txt
but this gives me too much info....
get-mailbox -Filter "UseDatabaseQuotaDefaults -eq `$false" -ResultSize Unlimited | ConvertTo-Html | Out-File quota.html
and
get-mailbox -Filter "UseDatabaseQuotaDefaults -eq `$false" -ResultSize Unlimited | Export-csv quota.csv
Any ideas?
John
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

get-mailbox -Filter scriipt issue

Post by jhicks »

You need to use Select-Object to specify the properties you want:get-mailbox | select this,that,anotherthing | export-csv myfile.csv
User avatar
jbrines
Posts: 14
Last visit: Tue Apr 28, 2009 11:07 pm

get-mailbox -Filter scriipt issue

Post by jbrines »

Cheers.
This topic is 15 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked