To bring the permissions back in, you'd just feed the Get-AccessControl output into Add-AccessControlEntry: Import-Csv -Path CsvLocation.csv | Add-AccessControlEntry -WhatIfĪdd-AccessControlEntry prompts for confirmation by default. You'll get errors for built-in system shares, e.g., C$, so you may want to add an -ErrorAction Silentl圜ontinue and/or an -ErrorVariable to the Get-AccessControlEntry call. Get-AccessControlEntry #| Export-Csv -Path CsvLocation.csv
If you use it, you could do something like this (the Export-Csv call is commented out, but you can put it in after confirming this is the output you're looking for): Get-WmiObject Win32_Share -ComputerName ServerName | It's a script module, so you can actually open it up and look at/modify the code. I'm working on a module ( see here) that should be able to do this for you.