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
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 >