Powershell Set-MailboxJunkEmailConfiguration issues

Hi,

Really trying hard to get into Powershell, but way too often hitting the wall! (I will be in bed by now if I was using the GUI) anyway...

I am trying to add an email to the sender blacklist. After logging in successfully to the Exchange (365), I run the following command to add the email address I wish to block:

Get-Mailbox | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains "spam@me.com"

I then get the following error:
The junk Email configuration couldn't be set. The user needs to sign in to Outlook Web App before they can modify their safe senders and recipients or blocked senders lists.

How can I make this work?
I thought that powershell could do anything, so why logging in to the GUI?
I have also logged in to the Outlook Web App many times before & only using 1 user

Thank you
LVL 1
defreyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AmitIT ArchitectCommented:
You first need to sign-in to PS console. Follow this
https://technet.microsoft.com/en-us/library/jj984289%28v=exchg.150%29.aspx

Then use this KB:

https://support.microsoft.com/en-us/kb/2545137

Basically, you need to create a session with your user id. When you are login remotely to PS session. That is same on On-premises also.
0
defreyAuthor Commented:
hi Amit,

I have no issues connecting to the console.

the error shows up after running the following command (as explained here https://support.microsoft.com/en-us/kb/2545137 & follow instructions step by step)

Command:
Get-Mailbox | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains "spam@me.com"

I get the following error
"The junk Email configuration couldn't be set. The user needs to sign in to Outlook Web App before they can modify their safe senders and recipients or blocked senders lists."

How can I enter the command without having any errors?

Thanks
0
defreyAuthor Commented:
any ideas, anyone?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Guy LidbetterCommented:
hi Defrey,

That command looks correct to me. Nothing wrong there... (Other than if you have any current entries... they will all be replaced. Updating with new entries is a bit different)

I can only imagine that you more than likely have a mailbox which has not yet been logged into and as such cannot be updated. The command might be breaking with the error.

Try adding "-ErrorAction SilentlyContinue" to the end and see what happens.

Regards

Guy
0
defreyAuthor Commented:
still no luck!
I even deleted the shared mailbox just in case.
I only got one user in the entire 365, logged in to the OWA countless time & still the same error
Headache!
0
Guy LidbetterCommented:
OK, Basic question, but we should cover all bases...
Are you assigned to the required roles?
Organization Management
Records Management
Recipient Management
Help Desk


Are you able to run a Get-MailboxJunkEmailConfiguration -identity MailboxName?
0
defreyAuthor Commented:
Hi Guy,

Yes I am able to run this command & get a result

Cheers
0
defreyAuthor Commented:
Please see screenshot error after running

Get-Mailbox | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains "spam@me.com"

Thanks
ps-MailboxJunk.PNG
0
Guy LidbetterCommented:
Hi Defrey,

Apologies been offline for a bit.

Can you please try creating a new user from scratch, send an email to the account and then log into OWA with the account, then run the above commands against the mailbox specifying the indentity?

Everything you are posting shows to be correct, why you are still getting the error is odd.
If you have a) logged in with the account and b) sent and received some mail into the account in question, you should be all good.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
defreyAuthor Commented:
i cannot so it from scratch as I only have 1 subscription...
0
Guy LidbetterCommented:
And everything else works fine?
0
defreyAuthor Commented:
everything is perfect
Just learning the powershell......the hard way
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.