I have a repetitive task on Server 2012 R2 I'd love to automate. I have a CSV list of around 40 folder names I want to create (The names in this CSV changes). I then want to have those folders shared with the same name as the folder that is created. I also want to set full permissions for 3 local users on all folders.
I tried dabbling a bit with PowerShell but couldn't seem to get it going I think mainly because I was trying to use WMI to create the shares.. In the end I resorted to running the following and settings up the shares manually.
Set-Location "C:\test\" Import-Csv c:\test\folders.csv | New-Item -type directory
Any help appreciated!