Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Issue processing multiple csv files for AD import

$
0
0

I know this is probably a rookie thing but I cant seem to figure this one out. I have a website that will be a new hire portal. once the person hit submit a csv file is generated and is moved to a directory for powershell to process the import of the new user into AD.

It works great with one file in the directory. As soon as two or more hit it it breaks miserably. I know my syntax is wrong but for the life of me i cant figure out how to process file after file in the directory

This is my original and again with one file awesome

#Import-Csv c:\new_users\*.csv | foreach-object { 

So i goofed around with what i could find online and i may be close, or not. ANY help is appreciated

$files = Get-ChildItem -Path c:\new_users\ Foreach ($file in $files) { import-csv $file

Thanks Guys/Gals


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>