55 lines
1.4 KiB
PowerShell
Executable File
55 lines
1.4 KiB
PowerShell
Executable File
Install-Module xSmbShare
|
|
|
|
Install-Module cNtfsAccessControl
|
|
|
|
Configuration SMBPull
|
|
{
|
|
Import-DscResource -ModuleName PSDesiredStateConfiguration
|
|
Import-DscResource -ModuleName xSmbShare
|
|
Import-DscResource -ModuleName cNtfsAccessControl
|
|
|
|
Node localhost
|
|
{
|
|
|
|
File CreateFolder
|
|
{
|
|
DestinationPath = 'C:\DSCSMB'
|
|
Type = 'Directory'
|
|
Ensure = 'Present'
|
|
}
|
|
|
|
xSMBShare CreateShare
|
|
{
|
|
Name = 'DscSmbPull'
|
|
Path = 'C:\DSCSMB'
|
|
FullAccess = 'landonhotel\administrator'
|
|
ReadAccess = 'landonhotel\srv02$'
|
|
FolderEnumerationMode = 'AccessBased'
|
|
Ensure = 'Present'
|
|
DependsOn = '[File]CreateFolder'
|
|
}
|
|
|
|
cNtfsPermissionEntry PermissionSet1
|
|
{
|
|
Ensure = 'Present'
|
|
Path = 'C:\DSCSMB'
|
|
Principal = 'landonhotel\srv02$'
|
|
AccessControlInformation = @(
|
|
cNtfsAccessControlInformation
|
|
{
|
|
AccessControlType = 'Allow'
|
|
FileSystemRights = 'ReadAndExecute'
|
|
Inheritance = 'ThisFolderSubfoldersAndFiles'
|
|
NoPropagateInherit = $false
|
|
}
|
|
)
|
|
DependsOn = '[File]CreateFolder'
|
|
}
|
|
}
|
|
}
|
|
|
|
SmbPull
|
|
|
|
Start-DscConfiguration -Path SmbPull -Wait -Verbose
|
|
|