Share Folder

  Create ShareFolder

cd /d <drive letter>:

cd /d Y: 
mkdir ShareFolder
Copied!

  Create the Security Group in the OU

New-ADGroup `
-Name "groupAshareFolder" `
-SamAccountName "groupAshareFolder" `
-GroupCategory Security `
-GroupScope Global `
-Path "OU=team,DC=server,DC=kh"
Copied!

DC=server is serverName

-Path "<OU or Domain Path>"

  Add Users to the Group

Add-ADGroupMember -Identity "groupAshareFolder" -Members "user"
Copied!

Add-ADGroupMember -Identity "groupAshareFolder" -Members "<user use with client>"

  Create the SMB Share

New-SmbShare `
-Name "ShareFolder" `
-Path "Y:\ShareFolder" `
-ReadAccess "groupAshareFolder"
Copied!

-Path "<drive letter>:\ShareFolder"

-ReadAccess → grants read‑only permissions.

-ChangeAccess → grants read + write permissions.

-FullAccess → grants full control.

  Remove SMB Share (ShareFolder)

Remove-SmbShare -Name "test" -Force
Copied!

New-SmbShare -Name "test" -Path "E:\test" -ChangeAccess "groupAshareFolder" -FullAccess "Administrator"

  Verify Permissions

Get-SmbShareAccess -Name "ShareFolder"
Copied!

  (Client) Access Share Folder With UNC Path

\\<servername>\ShareFolder

\\server\ShareFolder
Copied!

  (Client) Map the Share Folder to a specific Drive Letter

net use Z: \\server\ShareFolder /persistent:yes
Copied!