need to create a bulk of contacts in my AD and add them to a distrebution group

Hi all, i need your help.

I need to create a bulk of contacts in my AD and add them to a distrebution group.

I have this script for import: $CSVPath = “C:\1\MekomiNewcontacts.csv”

Import-Csv $CSVPath | foreach{New-ADObject -type contact -path ‘OU=Contacts,OU=KMH Users,OU=KMH,DC=KMH,DC=co,DC=il’ -Name $.FirstName - OtherAttributes @{‘FirstName’=$.FirstName;‘LastName’=$.LastName;‘displayname’=$.displayname;‘mail’=$.mail;‘mobile’=$.mobile’}

But it dosent work.

and i need a script that will help me to create multiple contacts.

Michel,
Welcome to the forum. :wave:t4:

Unfortunately

is not helpful at all. Please elaborate a little more detailed what or how exactly it is not working. If you get an error message please share this here as well.

And BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org <— Click :point_up_2:t4: