{"id":2183,"date":"2022-11-14T13:53:03","date_gmt":"2022-11-14T13:53:03","guid":{"rendered":"https:\/\/m365news.net\/?p=2183"},"modified":"2022-11-14T13:52:30","modified_gmt":"2022-11-14T13:52:30","slug":"how-to-create-a-user-account-or-mailbox-in-microsoft-365-using-windows-powershell","status":"publish","type":"post","link":"https:\/\/m365news.net\/how-to-create-a-user-account-or-mailbox-in-microsoft-365-using-windows-powershell\/","title":{"rendered":"How to Create a User Account or Mailbox in Microsoft 365 using Windows PowerShell"},"content":{"rendered":"\n

Learn how to create a user account\/mailbox through Windows PowerShell in Microsoft Office 365. Most users with technical knowledge prefer to use Windows PowerShell to create a user account in Microsoft Office 365.<\/p>\n\n\n\n

Steps to create a user account using Microsoft PowerShell<\/strong><\/p>\n\n\n\n

    \n
  1. In Windows PowerShell, you need to type some commands for installing ActiveAD and MSOnline services.
    \uf0a7 Install-Module \u2013Name AzureAD
    \uf0a7 Install-Module \u2013Name MSOnline<\/li>\n\n\n\n
  2. Now enter the below command to connect to Office 365 admin account.
    \uf0a7 $UserCredential = Get-Credential<\/li>\n\n\n\n
  3. A new popup will appear on the screen. Type your mailbox ID and password, and click the OK button.<\/li>\n\n\n\n
  4. After logging in with the online exchange mailbox, you need to connect to Msolservice. To run this service, enter the given command.\n
      \n
    • \uf0a7 Connect-MsolService -Credential $UserCredential<\/li>\n<\/ul>\n<\/li>\n\n\n\n
    • Create a user account product license and location.<\/li>\n\n\n\n
    • Verify the producer license before creating an account. Type the command to verify.<\/li>\n\n\n\n
    • Display an error if you are not connected to MsolService or view a list of all users\u2019 mailboxes.\n
        \n
      • Type the below command to check the license<\/li>\n\n\n\n
      • Get-MsolAccountSku<\/li>\n<\/ul>\n<\/li>\n\n\n\n
      • You can enter the following command to create a user account.<\/li>\n\n\n\n
      • New-MsolUser DisplayName \u201cusername\u201d -FirstName \u201cuser first name\u201d -LastName \u201cuser surname\u201d-UserPrincipalName UserName@domainname.onmicrosoft.com UsageLocation In -LicenseAssignment DomainName:ENTERPRISEPACK<\/li>\n<\/ol>\n\n\n\n
          \n
        1. If you do not want to assign the license to the user, you can skip this command.<\/li>\n\n\n\n
        2. If you want to modify the password, you must enter the command after the user mailbox, and default password has been created.
          Set-MsolUserPassword -UserPrincipalName username@domain.onmicrosoft.com -NewPassword xxxxxxxxxx<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

          Learn how to create a user account\/mailbox through Windows PowerShell in Microsoft Office 365. Most users with technical knowledge prefer to use Windows PowerShell to create a user account in Microsoft Office 365. Steps to create a user account using Microsoft PowerShell<\/p>\n","protected":false},"author":21,"featured_media":2191,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1,18,141,147,184],"tags":[20,167,166,283],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/posts\/2183"}],"collection":[{"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/comments?post=2183"}],"version-history":[{"count":2,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/posts\/2183\/revisions"}],"predecessor-version":[{"id":2193,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/posts\/2183\/revisions\/2193"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/media\/2191"}],"wp:attachment":[{"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/media?parent=2183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/categories?post=2183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/m365news.net\/wp-json\/wp\/v2\/tags?post=2183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}