Answer the question
In order to leave comments, you need to log in
How to mass create mailboxes and set up forwarding for all?
Colleagues.
There is a domain: @blabla.ru
And there are users: [email protected]
I'm trying to create mailboxes for all users.
Get-User -OrganizationalUnit "IT" -RecipientTypeDetails User -Filter { UserPrincipalName -ne $Null } | Enable-Mailbox
[email protected]
-> to [email protected]
Set-Mailbox -Identity "user" -ForwardingAddress "[email protected]"
Get-User -OrganizationalUnit "IT" -RecipientTypeDetails User -Filter { UserPrincipalName -ne $Null } | Enable-Mailbox | Set-Mailbox -ForwardingAddress ?????
Answer the question
In order to leave comments, you need to log in
Enable-MailBox unfortunately has no output parameters. Therefore, you will have to do your activities in two stages.
1. Enable all boxes:
2. Enable redirection for them:
Get-User -OrganizationalUnit "IT" -RecipientTypeDetails User -Filter { UserPrincipalName -ne $Null } | %{$forwardedEmail = "{0}@bleble.ru" -f $_.SamAccountName; Set-Mailbox -ForwardingAddress $forwardedEmail}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question