Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Fri, 14 Mar 2008 13:01:20 -0000,    group: microsoft.public.exchange.tools        back       


Powershell Question   
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
date: Fri, 14 Mar 2008 13:01:20 -0000   author:   Pete Piper

Re: Powershell Question   
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

> 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
>
date: Fri, 14 Mar 2008 13:54:59 +0000 (UTC)   author:   Shay Levi

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us