Overview Import-CSV Attribute cmdlet for Bulk Import of Multiple Users and Groups Active Directory‎


Overview Import-CSV Attribute cmdlet for Bulk Import of Multiple Users and Groups Active Directory‎

Description of Import-CSV Attribute : One of the most popular of Windows Active Directory Powershell cmdlet is Import-CSV Attribute cmdlet that let you Bulk import of an Active Directory Users and Groups.

  1. What is Import-CSV Attribute cmdlet?
    1. Why using Import-CSV Attribute cmdlet?
    2. How to Import-CSV Attribute cmdlet?
    3. Recomendation

-----------------------------------------------------------------------------------------------------------------------------
  1. What is Import-CSV Attribute cmdlet?

    One of the most popular of Windows Active Directory Powershell cmdlet is Import-CSV Attribute cmdlet that let you Bulk Import an Active Directory Users and Groups. This article Overviewing Import-CSV Attribute cmdlet for Users and Groups Active Directory‎ via PowerShell
    There is so much we can do using Set-ADUser Attribute, moreover we can collaborate between Set-ADUser Attribute cmdlet with another AD Powershell Attribute cmdlet like Get-ADGroupMember Attribute cmdlet and Import-CSV Attribute cmdlet. Below sample scenario for example on how to collaborate collaborate between Set-ADUser Attribute cmdlet with Get-ADGroupMember Attribute cmdlet and Import-CSV Attribute cmdlet
    1. Why using Import-CSV Attribute cmdlet?

      A simple plan using Import-CSV is if you want to migrate users and groups from one to another active directory server, you can do bulk import users and groups then save it on CSV file.
    2. How to Import-CSV Attribute cmdlet?

      Usually you need to declare everything field you need to import on every column of your csv file, below screenshot :


      Using Import-CSV is simple method, just open your Powershell Active Directory Module by clicking on Start Menu > Administrative tools > Powershell Active Directory Module then run whatever your great script on it. Below is sample using Import-CSV Attribute Cmdlet :
      • Bulk Import Groups Active Directory to Spesific OU
        Import-CSV "C:\yourgrouphere.csv" | Foreach-object {New-ADGroup -Name $_.GroupName -SamAccountName $_.SamAccountName -GroupCategory $_.GroupCategory -GroupScope $_.GroupScope -Path $_.Path}
      • Bulk Import Members of Groups Active Directory
        Import-CSV "C:\gresik-user.csv" | % {Add-ADGroupMember -Identity YOUR-GROUP-NAME -Member $_.samAccountName}

      • Bulk Import Telephone and IP Phone Users Active Directory
        import-csv p:\Extention.csv | ForEach-Object {set-aduser -Identity $_.samaccountname -Replace @{telephoneNumber=$_.telephoneNumber;mobile=$_.mobile;ipPhone=$_.ipPhone}}
      • Bulk Import Title, Department and Employee ID Attribute to AD Object
        import-csv c:\empdet.csv | ForEach-Object {set-aduser -Identity $_.samaccountname -Replace @{title=$_.title;department=$_.department;employeeID=$_.employeeID}}
      • Import all field on active directory users and group properties
        Import-csv .\namafile.csv | ForEach-object { $userprincipal = $_.SamAccountName + "@domainanda.com" New-ADUser -SamAccountName $_.SamAccountName -Name $_.name -UserPrincipalName $userprincipal -Displayname $_.displayName -GivenName $_.cn -SurName $_.sn -l $_.l -state $_.st -description $_.description -postalCode $_.postalCode -title $_.title -department $_.department -employeeNumber $_.employeeNumber -employeeID $_.employeeID -emailAddress $_.mail -homePhone $_.homePhone -mobile $_.mobile -Path "OU=01,OU=02,OU=03,OU=04,OU=05,DC=domaintanpacom,DC=com" -AccountPassword (ConvertTo-SecureString "password" -AsPlainText -Force) -ChangePasswordAtLogon $true -Enable $true } #23456789012345678901234567
    3. Recomendation

      Running Import-CSV script using powershell for active directory will help you manage and maintenance your users and groups very easy since import-csv let you for bulk purpose.
Very easy enough, if you liked this article please share and subscribe for get update a new article. If you have any questions please leave your message through the comments form below, I will respond as soon as possible

** Note : Pay attention to every detail steps that informed, failure or damage to your system or data is not my responsibility "Do With Your Own Risk" or you can do research through the Lab to minimize your system failure

Comments

Popular posts from this blog

Article Configure VMware vCenter Appliance 5.5 (VCSA) Step by Step Guide using OVF Template