Thursday, February 16, 2017

get network share and grant full access using powershell Smb-commands


I had problem when I created network share using command Get-WmiObject Win32_Share I only had read access. So I found out that granting full access can be done by Grant-SmbShareAccess.


To get smb share:
Get-SmbShare -Name shareName

To grant user access:
Grant-SmbShareAccess -Name shareName-AccountName accountName@domain.local -AccessRight Full