Forum Discussion
dannytveria
May 19, 2021Brass Contributor
Share & NTFS permissions export
Hi, I need to export a report from my file server for all the share & NTFS permissions to csv file. I found the next script: $FolderPath = dir -Directory -Path "#Requested Folder path" -Recurse -F...
Josh977
May 19, 2021Copper Contributor
You're going to need to use a combination of https://docs.microsoft.com/en-us/powershell/module/smbshare/get-smbshare?view=windowsserver2019-ps and https://docs.microsoft.com/en-us/powershell/module/smbshare/get-smbshareaccess?view=windowsserver2019-ps
This is also PowerShell version dependent.
$cSession = New-CimSession -ComputerName "server" -Credential (get-credential)
$Results = Get-SmbShare -CimSession $cSession | Get-SmbShareAccess
$cSession | Remove-CimSession
$Results | Export-CSV -Path "<pathToCSVFile>"
dannytveria
May 20, 2021Brass Contributor
Hi Josh,
if you can help me, I need Share & NTFS permissions for specific folders.
I didn`t understand your script
if you can help me, I need Share & NTFS permissions for specific folders.
I didn`t understand your script