How do i add a new user to exchange online with powershell?
- User
How do i add a new user to exchange online with powershell?
Assistant
To add a new user to Exchange Online using PowerShell, you can use the following steps:
- Connect to Exchange Online using the following command:
Connect-ExchangeOnline -UserPrincipalName user@domain.com -Credential (Get-Credential)This will prompt you to enter your credentials to connect to Exchange Online.
- Once you are connected, you can create a new user account using the following command:
New-Mailbox -Name "John Doe" -FirstName "John" -LastName "Doe" -UserPrincipalName johndoe@domain.com -Password (ConvertTo-SecureString "Password123!" -AsPlainText -Force) -MicrosoftOnlineServicesID john.doe@domain.comThis will create a new user account with the name "John Doe", first name "John", last name "Doe", and user principal name "johndoe@domain.com". The password for the account will be "Password123!".
- You can verify that the new user was created by running the following command:
Get-Mailbox -Identity "johndoe@domain.com"This will display information about the new user account.
Note: You'll need to have the necessary permissions to create new users in Exchange Online.