Set-Mailbox -issuewarningquota giving me error when importing CSV

Getting this code when running -

Import-CSV “Filepath” | foreach {Set-Mailbox -IssueWarningQuota 46gb}

 

“Cannot display the prompt for “Identity” because type “Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter” cannot be loaded.”

 

Whats the problem?

There is not enough info here to help you. That one line should not be causing this and it has to be somewhere else in your code.

This error is not unique, it can happen in various ways.

Try…

(Import-Csv C:\temp\userlisttest.csv).Identity | %{Set-mailbox -Identity $_ -IssueWarningQuota 46gb}

My CSV is formatted like…

Identity
mbidentity01
mbidentity02
etc...

 

I have my CSV structured like this -

 

Identity

Email1@domain.com

Email2@domain.com

Email3@domain.com

 

@p42p0wd3r I tried your code and am now getting an error reading "
Cannot bind argument to parameter ‘Identity’ because it is null."

 

 

[quote quote=206106]Try…

<textarea class="ace_text-input" style="opacity: 0; height: 18px; width: 7px; left: 44px; top: 0px;" spellcheck="false" wrap="off"></textarea>
1
(Import-Csv C:\temp\userlisttest.csv).Identity | %{Set-mailbox -Identity $_ -IssueWarningQuota 46gb}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
My CSV is formatted like…
PowerShell
6 lines
<textarea class="ace_text-input" style="opacity: 0; height: 18px; width: 7px; left: 44px; top: 0px;" spellcheck="false" wrap="off"></textarea>
1
2
3
4
5
6
Identity
mbidentity01
mbidentity02
etc...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[/quote] I tried this

I tested on my Exchange 2016 and 2019 installs, worked just fine. It gave me a warning “WARNING: Please update UseDatabaseQuotaDefaults to false in order for mailbox quotas to apply.”, which I added as “-UseDatabaseQuotaDefaults $false” and that warning went away. The quota warning level was changed either way, but would be reset if it was using the default quotas, as the warning suggests.

I also tested with a hybrid Exchange Online, Office 365, and I was NOT able to change the warning quota for those accounts via powershell. The script doesn’t seem to do anything at all. :frowning: Even when I went after a single account, the quota was not adjusted.

Import-CSV “Filepath” | ForEach-Object {
    Set-Mailbox -Identity $_.Identity -IssueWarningQuota 46gb
}

[quote quote=206307]I tested on my Exchange 2016 and 2019 installs, worked just fine. It gave me a warning “WARNING: Please update UseDatabaseQuotaDefaults to false in order for mailbox quotas to apply.”, which I added as “-UseDatabaseQuotaDefaults $false” and that warning went away. The quota warning level was changed either way, but would be reset if it was using the default quotas, as the warning suggests.

I also tested with a hybrid Exchange Online, Office 365, and I was NOT able to change the warning quota for those accounts via powershell. The script doesn’t seem to do anything at all. :frowning: Even when I went after a single account, the quota was not adjusted.

[/quote]

Yea I had to do it the old fashioned way… It is okay though, maybe next time