Creating user accounts from a CSV in Powershell

When I created the powershell script to create a user from CSV file I get this error when I run the script

1 Like

Is that the full file path or just the directory? Please show me what the $filePath variable equals. I have seen this error before when you try to import a CSV but don’t specify a file name.

I moved the file to the C drive. .

#this is how the csv file looks when you open it

file Path with error

1 Like

You typed CVS not CSV. The convenience store is messing you up, ha!

2 Likes

I get the script to work without -Path $user.“Organizational Unit”
I have tried:
-Path $user.“Organizational Unit”
-Path $user.‘Organizational Unit’

without it is working fine. Why?

The moving part is also giving an error.

The syntax in your first screenshot appears to be incorrect. Don’t just pass the “-”, you need to pass “-path”.

For the second screenshot, verify that your path does exist.

1 Like

It works now :slight_smile: Thanks for the help.

1 Like