Hi Guys,
I am trying to import users from a CSV into active directory. I have the following script but it doesn't do anything.
Import-CSV "C:\PowerShell\User\import\Intake2013.csv" | ForEach-Object {New-ADUser -Path 'OU=Intake2013,OU=Students,OU=Users,OU=ASH,OU=Establishments,DC=Ashdown,DC=INTERNAL' -Description $_.Description -AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -Force) -SamAccountName $_.sAMAccountName -GivenName $_.FirstName -Surname $_.LastName -DisplayName $_.DisplayName -Name $_.Name -OtherAttributes @{pager=$_.Pager} -UserPrincipalName $_.UPN -ProfilePath $_.ProfilePath -HomeDrive N: -HomeDirectory $_.HomeDir} Import-CSV "C:\PowerShell\User\import\Intake2013.csv" | ForEach-Object {Add-ADGroupMember -identity 'CN=ASH Student Users,OU=Student Users,OU=User Groups,OU=Groups,OU=ASH,OU=Establishments,DC=Ashdown,DC=internal' $_.sAMAccountName} Import-CSV "C:\PowerShell\User\import\Intake2013.csv" | ForEach-Object {Add-ADGroupMember -identity 'CN=ASH File Server 4,OU=General,OU=Groups,OU=ASH,OU=Establishments,DC=Ashdown,DC=INTERNAL' $_.sAMAccountName}
Does anyon ehave any idea what is going on?
Kind Regards
Tom Park
TPark IT Technician