What is wrong? How can I Fix it?

Abdel loukan 41 Reputation points
2021-12-01T19:19:16.29+00:00

Issue scripting:

Import-CSV address BulkuserMailboxes.csv | ForEach {New-Mailbox -Alias
$ .alias -Name $.name -userPrincipalName $.UPN -Database “Mailbox Database 2091411052” -OrganizationalUnit Users -Password $Password}

csv text:
Alias Name UPN
Bulkuser_1 Bulkuser1 ******@extraining.com
Bulkuser_2 Bulkuser2 ******@extraining.com

errorr:154187-image.png

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

Windows for business | Windows Server | User experience | PowerShell

Answer accepted by question author
KyleXu-MSFT 26,406 Reputation points
2021-12-02T02:09:27.313+00:00

@Abdel loukan

This screenshot is not visible.

So, I provide a script which could work in my lab:

CSV file:
154266-qa-kyle-10-06-06.png

Script:

$users = Import-CSV c:\temp\users.csv  
$PassWord = ConvertTo-SecureString -String "Password123" -AsPlainText -Force  
  
ForEach($user in $users){  
    New-Mailbox -Alias $user.alias -Name $user.name -userPrincipalName $user.UPN -Database "DB16" -OrganizationalUnit Users -Password $Password -ResetPasswordOnNextLogon $true  
}  

Run this script(.PS1 file) in EMS:
154268-qa-kyle-10-05-34.png


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Abdel loukan 41 Reputation points
    2021-12-02T15:13:30.1+00:00

    thank you guys, for some strange reason , excel worked notepad did not. Was prop the PS mode

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.