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
 
 
 
 
 
(116)
64,827 times
Add to favorites
Active Directory
12/4/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • sAMAccountName
    1 Posts | Last post Fri 6:22 PM
    • How do we allow a custom sAMAccountName?
      
      I ask because we format ours differently. We typically use the first initial, middle initial, and first five characters of the last name with a 1 at the end. eg. Captain A. Morgan = camorga1.
      
      Any ideas on how to style this or allow a custom entry from either the field or a CSV.
  • PrimalForms File
    4 Posts | Last post August 22, 2014
    • Hello Rich,
      
      is there a possibility to provide the PrimalForms GUI File?
      I want to have some additional features on my own.
      
      It would be nice to do this with help of the tool instead of editing the GUI components in source code.
      
      Thank you very much!
    • My intension is:
      
      I want to select a Department, for example "IT".
      
      there should be an additional box which content is dynamically loaded by the choose of the Department. 
      
      I already added further information to the XML file:
      
       <Groups>
      	<Group Name="IT">
      		<Entry>value1</Entry>
      		<Entry>value2</Entry>
      		<Entry>value3</Entry>
      	</Group>
       </Groups>
      
      The </Entry> contents should be loaded into a new Box in the GUI. (Maybe a checkedListBox?)
      
      Afterwards i should be able to select or deselect the values inside that box. All selected values have to be proceeded within a new funktion / loop for example.
      
      I am very new to powershell and it would be nice to receive a little advice.
      
      (Especially how to load the content from the XML file into a new box dependent on the selection of the "departments field")
      
      
    • Did an solution on my own (Connected User to predefined AD Group Templates inside the XML file):
      
      1) Created a checkedListBox
      
      	#
      	# clbGroups
      	#
      	$clbGroups.Anchor = 'Top, Left, Right'
      	$clbGroups.FormattingEnabled = $True
      	$clbGroups.Location = '118, 620'
      	$clbGroups.Name = "Groups"
      	$clbGroups.Size = '173, 100'
      	$clbGroups.TabIndex = 88
      
      2) Made a "SelectIndex_Changed" for the "Department" Box:
      
      $cboDepartment_SelectedIndexChanged={ 
      		$clbGroups.Items.Clear()
      		$XML.Options.Groups.ADGroup | ?{$_.Name -match $cboDepartment.Text} | Select -ExpandProperty Entry | %{$clbGroups.Items.Add($_)}	
      }
      
      3) Now if I select "IT" as department, the following attributes are collected by the XML file and presented as checkbox Items in the Checkbox itself:
      
       <Groups>
      	<Group Name="IT">
      		<Entry>value1</Entry>
      		<Entry>value2</Entry>
      		<Entry>value3</Entry>
      	</Group>
       </Groups>
      
      4) The AD Groups are automatically connected to the new user:
      
      $ldapUserpath= "LDAP://" + $Path
      		
      foreach($ADValue in $clbGroups.CheckedItems)
          {
          $Connection = "LDAP://CN="+$ADValue+",OU=Unit2,OU=Unit1,DC=company,DC=de"
          $Group = [adsi] $Connection
          $UserAD = 'LDAP://CN="'+$Name+'",'+ $Path
          $Group.Add($UserAD)
          }
      
      Hope these snippets are helpfull for someone with the same problem!
    • Could you elaborate a little more on this? I'm getting errors saying that it can't find all the properties in the whole clbGroups piece. 
  • Path format
    2 Posts | Last post July 23, 2014
    • HI I'm trying to import from CSV. What is the path format to use?  the delimitation for the CSV file are comma so if I put my path(OU=employeNR,DC=groupetci,DC=com)in the CVS file then the system takes the comma in the path in consideration. hope im clear  
    • I think you have to put Quotes around any entries like the OU path, so "OU=employeNR,DC=groupetci,DC=com" should work.
  • Import-Csv : The member "" is already present
    1 Posts | Last post July 07, 2014
    • Trying to setup a test and have anytime there are duplicate entries it throws the The member "" is already present
      
      Seems like it does it when adding duplicate items to any of the following in the csv
      
      Office	Title	Description	Department	Company
      
      Any thoughs
      
  • password viewable?
    1 Posts | Last post June 12, 2014
    • Hi Rich,
       
      I am wondering if is possible to change the setting to make the password viewable upon entry?
  • add-adgroupMember "GroupName"
    1 Posts | Last post June 06, 2014
    • Hi Rich,
      
      Do you know if it is possible to add a group membership line in the script...
      
      Something like
      add-adgroupMember "GroupName"
      
      Thanks!
  • How to add attributes to the script.
    1 Posts | Last post May 13, 2014
    • I'm looking to add the following AD attributes to this script as well as use them in CSV mode.
      
      employeeNumber
      homeDirectory
      homeDrive
      
      Any help would be greatly appreciated.
      
      Thanks!!
  • email id field
    1 Posts | Last post April 29, 2014
    • Hi,
      
      is there any possibility to populate Active Directory smtp email id field?
      
      Thanks.
  • Help - Can add Single User but when i Submit all it creates errors
    1 Posts | Last post April 02, 2014
    • Hi, 
      
      Can anyone please help, hoping its something simple. when i use the Script to create one user in CSV Mode it works but when i submit all it fails. i get the error in Powershell below 
      
      New-ADUser : The object name has bad syntax
      At D:\ANUC\ANUC.ps1:606 char:4
      +             New-ADUser @User -ErrorVariable ADError
      +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (CN=Controlled U...DC=Cal,DC=local:String) [New-ADUser], ADException
          + FullyQualifiedErrorId : The object name has bad syntax,Microsoft.ActiveDirectory.Management.Commands.NewADUser
      
      Anyone any Ideas? 
      
      Rgds
      Martin Hoolickin
      
      
  • To Set password never expires and User cannot change password.
    1 Posts | Last post March 23, 2014
    • Hi,
      
      I would like to allow the script to Set password never expires and User cannot change password.
      
      I've test adding PasswordNeverExpires = $true to the $User definitions but seems not working. 
      
      Any idea anyone?
      
      Regards
      Chua
1 - 10 of 94 Items