Active Directory User Creation tool 1.2

One task that every systems administrator has to go through at some point is the creation of new user accounts. Powershell makes this process simple and adds additional functionality, such as the ability to set defaults and import users from CSV.

ANUC.ps1
 
 
 
 
 
(150)
93,846 times
Add to favorites
Active Directory
12/4/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Add homedrive
    1 Posts | Last post March 03, 2016
    • Hi, great script! Is it possible in a later release to add home folder capability in the profile tab for the user? In the meanwhile does anyone no where in this script I can do it? I think something like this should do it:  
      Set-ADuser -Identity SamAccountName -HomeDrive "H:" -HomeDirectory "\\server\share\%UserName%"
      
      Erik
  • Unique sAMAccountName
    2 Posts | Last post January 26, 2016
    • Hi, this is great however is there anyway it can check if the sAMAccountName is unique and if not add a number to the end until it is?
    • Not sure if this has been answered but here's my crappy input..
      I haven't looked at this form yet (scanned the 1st 50 lines or so?) BUT I got around that one on my own version I made a little while back by creating a Function (Checksam) using ADSI Searcher and checking the result.
      # Function to check for SAM account name
      function checksam 
      {
          param ($findname)
          $check=[adsisearcher]"objectcategory=user"
          $check.filter="samaccountname=$findname"
          $check.findone()
      } #end function
      
      As Samaccountname is unique we only have to do a 'findone' so it's relatively quick. Based on the result you can take action, i.e if the name exists:
      if($result = checksam($samname))  #This executes the code below if there IS a match.
      { 
      DO something
      }
      
      I grab the name in an input box, split the string and build the SAM name by setting a new 'finished' string as the 1st char of the 1st chop and the whole of the last chop ("$1stchar + inputname[1]" the format I use is "INitial" so I simply use ). If there's a prob my 'do something' then get's the second intitial and adds that to the 1st $1stchar and then joins. I could do yet another test but. This is just for me really...so I don't, but you get the picture.
      It's not pretty but it helped me out at the time. I should revise it...
      The cleaner answer, using the above, would be to use a counter or 2 to decide on how many characters to grab and append and also where to point to once the snippet had run.
      You can use a counter in place of grabbing a character; test for existence; rinse and repeat.
      As I said above, I haven't looked at the form yet, just adding my tuppence.
  • New to reading script
    1 Posts | Last post December 19, 2015
  • Exchange 2012 Support
    4 Posts | Last post December 03, 2015
    • Just a small update, to allow this amazing script, immediatelly enable a Mailbox on the Exchange Server 2013:
      
      1) Download the script.
      2) Edit file: ANUC.ps1
      3) Insert, after line 379: else{$SB.Text = "$sAMAccountName created successfully."}
         the following code: Enable-Mailbox -Id $userPrincipalName -Database "MBX1 Database"
      
      TIP: if having problems, run the script in Exchange Shell and import ActiveDirectory Module
      TIP: change MBX1 Database, with your own Exchange Server environment :)
      
    • Another tip on this that I found.  If you are adding the users by importing a CSV and clicking Import All you need to add that same code after line 609 as well.
    • This a good instruction for information base on data collection,sometime the computer issue could happen, the properties can help resolve.
      
      https://docs.google.com/document/d/1TnYG18JtONh6-1Urls5Grty4WnWtfgQkGSUFIpjFpa0/edit?usp=sharing
      https://docs.google.com/document/d/1VC5FpvmD5NpuUcJCAlYRqOmKmE88u4G0Zvc7nTlxuRI/edit?usp=sharing
    • Any way to simply use the UPN to fill in the "E-Mail" field in AD for the user? Preferably with a custom domain name following the "@"
  • Location Setting
    1 Posts | Last post November 06, 2015
    • I have found out that we cannot have more than 3 locations in this script.  If I add another location the following error comes up: "You are using a previous version of the Options file".  Is there a setting I have to change to add more locations?
  • Unix Attribute
    1 Posts | Last post October 09, 2015
    • Hi Rich
      
      Thanks for this amazing tool. It helps us a lot managing our AD infrastructure. As we use AD as well in combination with linux hosts it would be realy helpful if you can add the unix attribute as non mandatory fields. Till now we still add those fields by hand. 
      
      They are uid (which is the same as sAMAccountName), uidNumber (an unique number), gidNumber, unixHomeDirectory, and loginShell.
      
      Thanks a lot!
      -Armin
  • SAM Name - Substring Five Characters of Last name
    1 Posts | Last post October 01, 2015
    • I am trying to set the samAccountName per our company's standard which is first five characters of last name and first character of first name.  I enabled the XML switch for LastNameFirstInitail in the hopes of using 
      $SurName = $txtLastName.text.substring(0,5)
      It actually creates the samAccountName as I want to but I get errors every time I type the first name or last name - Roughly Line 142 (I have added other items so lines numbers may be off)
      Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within the string.
  • How to add Email Address to the GUI
    1 Posts | Last post September 28, 2015
    • How to add Email Address to the GUI?
  • Manager Field
    1 Posts | Last post August 04, 2015
    • Great tool, Kudos. But I noticed that the Manager field is not present. Can you please add?
      
      Thank you,
      Niles
  • Can someone help me with the below error ?
    1 Posts | Last post July 14, 2015
    • Exception calling "Add" with "1" argument(s): "Object reference not set to an i
      nstance of an object."
      At line:261 char:35
      +                 $User.SubItems.Add <<<< ($SubItem)
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : DotNetMethodException
      
      
      
      
      Thanks
1 - 10 of 115 Items