dy625
dy625

Reputation: 85

Retrieving Remote File Share 'Share Permissions' Using Powershell

I have a share hosted on another computer FILESERVER1 at \\FILESERVER1\FILESHARE1.

How do I view the Share Permissions of this folder using PowerShell? Is this possible?

Please note, I am NOT referring to NTFS permissions.

Upvotes: 0

Views: 6507

Answers (1)

Rich Moss
Rich Moss

Reputation: 2384

Get-SmbShare and Get-SmbShareAccess seem to be what you want, as long as you have PowerShell 5. Those commands are not present on a Windows 7/PSh4 computer I'm using.

You can run the commands on the remote computer by using a session:

$s = New-PsSession -ComputerName FILESERVER1
Invoke-Command -Session $s {Get-SmbShare}
Invoke-Command -Session $s {Get-SmbShareAccess 'FILESHARE1'} 

Upvotes: 1

Related Questions