first commit

This commit is contained in:
Iwan Clement
2020-11-03 18:55:20 +01:00
commit 1808f43f53
12 changed files with 354 additions and 0 deletions

54
Exercise Files/01_04/01_04.ps1 Executable file
View File

@@ -0,0 +1,54 @@
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