{"id":630,"date":"2015-05-11T16:10:33","date_gmt":"2015-05-11T14:10:33","guid":{"rendered":"https:\/\/www.em-soft.si\/myblog\/elvis\/?p=630"},"modified":"2015-05-11T16:10:33","modified_gmt":"2015-05-11T14:10:33","slug":"adding-ad-users-via-powershell-script-and-csv-file","status":"publish","type":"post","link":"https:\/\/em-soft.si\/myblog\/elvis\/?p=630","title":{"rendered":"Adding AD users via PowerShell script and CSV file"},"content":{"rendered":"<p><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">In one of my previous posts, I wrote how to add groups and their members in AD. Some of my friends validated this post as very usable, but they missed the first step: how to add users with all properties to AD. There are many scripts on the net, but I didn\u2019t find a script with enough properties and I decided to write my own one.<\/span><br \/>\n<span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">I tried to think what the IT persons want and I arrived to those fields:<\/span><\/p>\n<ul>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Users name<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Users surname<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Users Display name<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Users SAM name<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Company with complete address<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Department where users are working<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Manager<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Office where who is situated<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Home directory<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Mobile phone<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Company phone<\/span><\/li>\n<li><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">OU where user is created (it is not the best idea to create them in default OU)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">In addition I tried to do some more things like users password is always the same and users has always to change this password on first login (be careful with some users, who are working for example only true RDP). I found all this data useful also for future use like for creating a script for Mail signature and similar.<\/span><br \/>\n<span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">All that you need you will find in this <a href=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2015\/05\/ADUsers.zip\">ADUsers script<\/a>. You will find a script and an Excel file where to add user\u2019s data. You have to fill white cells; yellow cells are formula based and are calculated in base of white ones. The formula that you have to change, as you need, is how the username is created. At the end be careful that you will avoid duplicated data.<\/span><br \/>\n<span style=\"font-size: 12pt; font-family: times new roman,times,serif;\">Have a good usage and good work!<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/em-soft.si\/myblog\/elvis\/wp-content\/uploads\/2015\/05\/ADUsers.zip\">ADUsers.zip download link<\/a><a style=\"text-decoration:none\" href=\"\/index.php?s=imusporin-online-123\">.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In one of my previous posts, I wrote how to add groups and their members in AD. Some of my friends validated this post as very usable, but they missed the first step: how to add users with all properties to AD. There are many scripts on the net, but I didn\u2019t find a script [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,15],"tags":[41,40],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows-server","tag-powershell","tag-windows-server"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=630"}],"version-history":[{"count":1,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":632,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=\/wp\/v2\/posts\/630\/revisions\/632"}],"wp:attachment":[{"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/em-soft.si\/myblog\/elvis\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}