ipsec600
asked on
Bulk Mailbox creation with custom SMTP address & setting forwarder
Hi Experts,
I need to create bulk user and mailbox and also need to set forwarding address for that mailbox to contact object (Forward to) option.
I am able to create bulk AD user following the below script and also able to create mailbox following the mailbox creation script.
But I need to set custom SMTP address for those mailbox for that is there any way I can define in the mailbox creation script to add custom SMTP address?
Once the users mailbox will be created, Is there any way I can set forwarding address to a contact object of that user via power shell.
In my case, I just need to create mailbox for the internal domain and set to forwarder to the users contact object.
Creating Active Directory user:
Import-csv C:\BulkADUsers.csv | % {New-ADUser -Name $_.Name -SamAccountName $_.SamAccountName -Description
$_.Description -Department $_.Department -Path $_.Path -Enabled $True -AccountPassword (ConvertTo-SecureString
$_.Password -AsPlainText -force)}
CSV Format for AD user:
Name SamAccountName Description Department Path Enabled Password
Test, User Test Test User IT OU=Test,DC=Test,DC=COM $True Pass3434@
Creating mailbox
Import-Csv .\BulkADUsersDB.csv | % {Enable-Mailbox -Identity $_.SamAccountName -Database $_.Database -Alias $_.SamAccountName}
CSV Format for mailbox user:
Name SamAccountName Description Department Path Database Enabled Password
Test, User Test Test User IT OU=Testing,DC=Test,DC=COM MDB01 $True Pass3434@
By following the above script I am able to create user and mailbox but user mailbox is taking default email address but I need to define custom SMTP address via power shell.
Also once users mailbox will be created, I need to set forwarding address for each users to each contact object via PowerShell..On this note, All contact object already exist in our internal domain.
I need to create bulk user and mailbox and also need to set forwarding address for that mailbox to contact object (Forward to) option.
I am able to create bulk AD user following the below script and also able to create mailbox following the mailbox creation script.
But I need to set custom SMTP address for those mailbox for that is there any way I can define in the mailbox creation script to add custom SMTP address?
Once the users mailbox will be created, Is there any way I can set forwarding address to a contact object of that user via power shell.
In my case, I just need to create mailbox for the internal domain and set to forwarder to the users contact object.
Creating Active Directory user:
Import-csv C:\BulkADUsers.csv | % {New-ADUser -Name $_.Name -SamAccountName $_.SamAccountName -Description
$_.Description -Department $_.Department -Path $_.Path -Enabled $True -AccountPassword (ConvertTo-SecureString
$_.Password -AsPlainText -force)}
CSV Format for AD user:
Name SamAccountName Description Department Path Enabled Password
Test, User Test Test User IT OU=Test,DC=Test,DC=COM $True Pass3434@
Creating mailbox
Import-Csv .\BulkADUsersDB.csv | % {Enable-Mailbox -Identity $_.SamAccountName -Database $_.Database -Alias $_.SamAccountName}
CSV Format for mailbox user:
Name SamAccountName Description Department Path Database Enabled Password
Test, User Test Test User IT OU=Testing,DC=Test,DC=COM MDB01 $True Pass3434@
By following the above script I am able to create user and mailbox but user mailbox is taking default email address but I need to define custom SMTP address via power shell.
Also once users mailbox will be created, I need to set forwarding address for each users to each contact object via PowerShell..On this note, All contact object already exist in our internal domain.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You will have to run those commands in the exchange shell
ASKER
Excellent! thank you Foxluv.