Skip to content

Instantly share code, notes, and snippets.

@harmoniemand
Created January 19, 2018 12:57
Show Gist options
  • Save harmoniemand/cf919bd27d6c36d3afe2046fb60ce48f to your computer and use it in GitHub Desktop.
Save harmoniemand/cf919bd27d6c36d3afe2046fb60ce48f to your computer and use it in GitHub Desktop.
$machinename = "machinename"
$users = @("user1")
$users | ForEach-Object {
$user = $_
$shares = Get-WmiObject -class Win32_Share -computer $machinename
$shares | ForEach-Object {
$share = $_
$( $user + "; " + $share.Path + "; ") | Out-File -FilePath 'out.csv' -Append
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment