{"id":1731,"date":"2015-09-30T17:45:08","date_gmt":"2015-09-30T17:45:08","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1731"},"modified":"2015-09-30T17:45:30","modified_gmt":"2015-09-30T17:45:30","slug":"1731","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1731","title":{"rendered":"Creating Test Users In Bulk Using Powershell"},"content":{"rendered":"<p>There is always a requirement to create test users in bulk in your lab, maybe even in live network to test something. You can quickly create mailbox users using a one liner. Run the command.<\/p>\n<p><span style=\"color: #ff0000;\">1..100 | ForEach { Net User \u201cUser$_\u201d MyPassword=01 \/ADD \/Domain; Enable-Mailbox \u201cUser$_\u201d -Database \u201cMailbox Database\u201d<\/span><\/p>\n<p><img decoding=\"async\" id=\"BLOGGER_PHOTO_ID_5354249928466206386\" src=\"http:\/\/1.bp.blogspot.com\/_1Z-H-ni-Cj0\/Sk4d8SDjjrI\/AAAAAAAAAKY\/kMHvll3cVtg\/s400\/Tip+create+Users+In+Bulk.JPG\" alt=\"\" border=\"0\" \/>Moral of the story \u2013 Do read the tips\u2026<\/p>\n<p>Another method which I use very often is shown below. Get a password and store it as a secure string in a variable and use the variable in the new mailbox creation process.<\/p>\n<p><span style=\"color: #ff0000;\">$password = Read-Host \u201cEnter Password\u201d -AsSecureString<\/span><\/p>\n<p>Then run the command shown in the snapshot to create test users in bulk. Change the numbers depending upon the number of test users you need.<\/p>\n<p><img decoding=\"async\" id=\"BLOGGER_PHOTO_ID_5355262505137193730\" src=\"http:\/\/3.bp.blogspot.com\/_1Z-H-ni-Cj0\/SlG24AGrwwI\/AAAAAAAAAKg\/Ti9SYnOUEmM\/s400\/Test+Users.JPG\" alt=\"\" border=\"0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is always a requirement to create test users in bulk in your lab, maybe even in live network to test something. You can quickly create mailbox users using a one liner. Run the command. 1..100 | ForEach { Net User \u201cUser$_\u201d MyPassword=01 \/ADD \/Domain; Enable-Mailbox \u201cUser$_\u201d -Database \u201cMailbox Database\u201d Moral of the story \u2013 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-1731","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1731"}],"version-history":[{"count":2,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1731\/revisions"}],"predecessor-version":[{"id":1733,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1731\/revisions\/1733"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}