{"id":3067,"date":"2020-12-11T14:56:52","date_gmt":"2020-12-11T20:56:52","guid":{"rendered":"https:\/\/microsoftgeek.com\/?p=3067"},"modified":"2020-12-11T14:56:52","modified_gmt":"2020-12-11T20:56:52","slug":"how-to-use-powershell-to-create-ad-user-accounts-in-bulk-in-windows-server-2016","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=3067","title":{"rendered":"How to Use PowerShell to Create AD User Accounts in Bulk in  Windows Server 2016"},"content":{"rendered":"\n<p><strong>Lets get started..<\/strong><\/p>\n\n\n\n<p>1 \u2013 For this demo, I will use my existing AD Server with&nbsp;<strong>Windows.ae<\/strong>&nbsp;domain and previously created empty OU call&nbsp;<strong>Network<\/strong>&nbsp;<strong>Branch<\/strong>.<\/p>\n\n\n\n<p>My&nbsp;<strong>Network<\/strong>&nbsp;<strong>Branch<\/strong>&nbsp;OU is now empty without any User in it, so I would like to<strong>&nbsp;import 25 users<\/strong>&nbsp;in just 1 shot.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/190.png?w=1108\" alt=\"1.png\" class=\"wp-image-5142\"\/><\/figure>\n\n\n\n<p>2 \u2013&nbsp;For this step, you need a Notepad with Your Domain user information. This can be done in MS Excel. See example here.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>DN,objectClass,sAMAccountName,sn,givenName,userPrincipalNAme<\/strong><\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/247.png?w=1108\" alt=\"2.png\" class=\"wp-image-5146\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>3 \u2013&nbsp;After you have modify the script, save it (make sure you save it in .CSV format) &amp; copy the script into&nbsp;<strong>C:\\Users\\Administrator folder.<\/strong><\/p>\n\n\n\n<p>verify the file by run&nbsp;<strong>DIR<\/strong>&nbsp;Powershell Command<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/347.png?w=1108\" alt=\"3.png\" class=\"wp-image-5170\"\/><\/figure>\n\n\n\n<p>4 \u2013 in CMD, run this command and press enter :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>CSVDE -i -f&nbsp;users.csv<\/strong><\/p><\/blockquote>\n\n\n\n<p>if everything ok, you will see a command stated&nbsp;<strong>* entries modified successfully<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/436.png?w=1108\" alt=\"4.png\" class=\"wp-image-5174\"\/><\/figure>\n\n\n\n<p>5 \u2013 Now open your&nbsp;<strong>Active Directory Users &amp; Computers<\/strong>, and&nbsp;<strong>refresh<\/strong>&nbsp;the interface. You will see your users that you type in the bulk user script now listed in your specific OU.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/530.png?w=1108\" alt=\"5.png\" class=\"wp-image-5178\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>6 \u2013 Next, highlight all your newly created users, right click and choose<strong>&nbsp;Enable Account<\/strong>.<\/p>\n\n\n\n<p>When you Enable Account, then only your selected users can log into their system.<\/p>\n\n\n\n<p><img decoding=\"async\" srcset=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=1108 1108w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=150 150w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=300 300w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=768 768w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=1024 1024w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png 1366w\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/625.png?w=1108\" alt=\"6\"><img decoding=\"async\" srcset=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=1108 1108w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=150 150w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=300 300w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=768 768w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=1024 1024w, https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png 1366w\" src=\"https:\/\/newhelptech.files.wordpress.com\/2017\/07\/722.png?w=1108\" alt=\"7\">Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lets get started.. 1 \u2013 For this demo, I will use my existing AD Server with&nbsp;Windows.ae&nbsp;domain and previously created empty OU call&nbsp;Network&nbsp;Branch. My&nbsp;Network&nbsp;Branch&nbsp;OU is now empty without any User in it, so I would like to&nbsp;import 25 users&nbsp;in just 1 shot. 2 \u2013&nbsp;For this step, you need a Notepad with Your Domain user information. This [&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,63],"tags":[],"class_list":["post-3067","post","type-post","status-publish","format-standard","hentry","category-powershell","category-server-2016-2016"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3067","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=3067"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3067\/revisions"}],"predecessor-version":[{"id":3070,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/3067\/revisions\/3070"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}