Object " " could not be found.

dawnnewell
dawnnewell used Ask the Experts™
on
I have a shared mailbox that I did not create.  The name is "EOC2010 Shared Mail"  
It's alias is EOC2010.

Trying to issue the following command:

set-mailbox -id EOC2010 -GrantSendOnBehalfto (get-content c:\temp\users.csv)
get error:
Object " " could not be found.  Please make sure that it was spelled correctly or specify a different object.

If you do a get-mailbox -id EOC2010 it returns info.
If you issue get-mailbox -id "EOC2010 Shared Mail" it returns data also.  But neither command will work with the set-mailbox.

Get-mailbox -id "EOC2010 Shared Mail" | set-mailbox -GrantSendOnBehalfto (get-content c:\temp\users.csv)

or any combination of set command returns the same error with the name or the alias.

Can anyone tell me what might be the problem with this?  Is it the multiple spaces in the name? Or the numbers?  or both?  Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
try to put the guid value of the mailbox and see
get-mailbox -identity "EOC2010 Shared Mail" |fl
it will give you GUID try that

Author

Commented:
I gave that a try.  Using the Guid does return the get-mailbox info, but piping it to set  grant send on behalf still returns the same error.

[PS] H:\>Get-Mailbox -id 2b359cc7-8be6-46b6-9355-7704c9f0124d | Set-Mailbox -Gra
ntSendOnBehalfTo (get-content c:\temp\users2.csv)
Object " " could not be found. Please make sure that it was spelled correctly o
r specify a different object.
At line:1 char:1
+ G <<<< et-Mailbox -id 2b359cc7-8be6-46b6-9355-7704c9f0124d | Set-Mailbox -Gra
ntSendOnBehalfTo (get-content c:\temp\users2.csv)
[PS] H:\>
Tried it also with "" around the guid and it returned the same error.
issuing get-content with csv file produced the id's
issuing the command without csv file with users separated by commas worked.  removing rows of cells below id's in csv file fixed the issue.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial