Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Powershell Question

167 views
Skip to first unread message

Pete Piper

unread,
Mar 14, 2008, 9:01:20 AM3/14/08
to
Hi

I am trying to update a number of users in our Exchange 2007 environment. I
have seen that I can use "set-mailbox -Identity -ApplyMandatoryProperties"
to apply properties to an existing mailbox and when I manually enter:

set-mailbox domain\alias -ApplyMandatoryProperties

everything works perfectly.

So then I tried to do a bulk update using:

Get-Mailbox -OrganizationalUnit "Users"
|set-mailbox -Identity -ApplyMandatoryProperties

(If I do "Get-Mailbox -Organizational Unit "Users" the correct list of
mailboxes is returned)

However when I run the above script I receive an error:

Set-Mailbox : Missing an argument for parameter 'Identity'. Specify a
parameter of type
'Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter' and try again.

At C:\Documents and Settings\Administrator\My Documents\upd.ps1:4 char:72
+ Get-Mailbox -OrganizationalUnit "Users" |set-mailbox -Identity <<<<
-ApplyMandatoryProperties

Can anyone help me out?

Thanks

JB


Shay Levi

unread,
Mar 14, 2008, 9:54:59 AM3/14/08
to

Try without the -Identity parameter, set-mailbox should resolve it automatically
for each mailbox account:

Get-Mailbox -OrganizationalUnit "Users" | set-mailbox -ApplyMandatoryProperties

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com

Shay Levi

unread,
Mar 14, 2008, 10:02:31 AM3/14/08
to

> ... resolve it automatically for each mailbox account

... resolve it automatically for each PIPED mailbox account.

Pete Piper

unread,
Mar 14, 2008, 12:41:08 PM3/14/08
to
Thanks Shay - worked a treat!

JB


"Shay Levi" <n...@addre.ss> wrote in message
news:8766a944236578...@news.microsoft.com...

0 new messages