Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# 共有用のフォルダー作成
PS C:\Users\Administrator> mkdir E:\ShareAll
Directory: E:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/8/2022 4:17 PM ShareAll
# 共有の設定
# -Name [任意の共有名]
# -Path [共有フォルダーのパス]
# -FullAccess [フルコントロールを付与するユーザー/グループ]
PS C:\Users\Administrator> New-SmbShare -Name "ShareAll" -Path "E:\ShareAll" -FullAccess "Everyone"
Name ScopeName Path Description
---- --------- ---- -----------
ShareAll * E:\ShareAll
# NTFS アクセス権付与
PS C:\Users\Administrator> icacls "E:\ShareAll" /grant "Everyone:(OI)(CI)(F)"
processed file: E:\ShareAll
Successfully processed 1 files; Failed processing 0 files
# 確認
PS C:\Users\Administrator> Get-SmbShare -Name "ShareAll" | Format-List -Property *
PresetPathAcl : System.Security.AccessControl.DirectorySecurity
ShareState : Online
AvailabilityType : NonClustered
ShareType : FileSystemDirectory
FolderEnumerationMode : Unrestricted
CachingMode : Manual
LeasingMode : Full
SmbInstance : Default
CATimeout : 0
CompressData : False
ConcurrentUserLimit : 0
ContinuouslyAvailable : False
CurrentUsers : 0
Description :
EncryptData : False
IdentityRemoting : False
Infrastructure : False
Name : ShareAll
Path : E:\ShareAll
Scoped : False
ScopeName : *
SecurityDescriptor : O:SYG:SYD:(A;;FA;;;WD)
ShadowCopy : False
Special : False
Temporary : False
Volume : \\?\Volume{0eed06e1-49f4-48fe-818a-91dacb6497f3}\
PSComputerName :
CimClass : ROOT/Microsoft/Windows/SMB:MSFT_SmbShare
CimInstanceProperties : {AvailabilityType, CachingMode, CATimeout, CompressData...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
|