Skip to content

Commit 5107eed

Browse files
committed
feat: add current configuration status
1 parent 296ad99 commit 5107eed

File tree

1,954 files changed

+50470
-62851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,954 files changed

+50470
-62851
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$output = 'C:\Example\MOF'
2+
3+
Configuration Example
4+
{
5+
Import-DscResource -ModuleName 7ZipArchiveDsc
6+
Node localhost
7+
{
8+
x7ZipArchive sample1 {
9+
Path = 'C:\sample.zip'
10+
Destination = 'C:\Destination'
11+
Validate = $true
12+
Checksum = 'Size'
13+
Clean = $true
14+
}
15+
}
16+
}
17+
18+
Example -OutputPath $output
19+
Start-DscConfiguration -Path $output -Verbose -wait
20+
21+
Remove-DscConfigurationDocument -Stage Previous, Pending, Current -Force
22+
Remove-Item $output -Recurse -Force
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
configuration Sample_ADAccessControl
2+
{
3+
Import-DscResource -ModuleName AccessControlDsc
4+
node localhost
5+
{
6+
ActiveDirectoryAccessEntry EastOU
7+
{
8+
DistinguishedName = 'OU=east,DC=contoso,DC=com'
9+
AccessControlList = @(
10+
ActiveDirectoryAccessControlList
11+
{
12+
Principal = 'contoso\Tier3'
13+
ForcePrincipal = $false
14+
AccessControlEntry = @(
15+
ActiveDirectoryAccessRule
16+
{
17+
AccessControlType = 'Allow'
18+
ActiveDirectoryRights = 'GenericAll'
19+
InheritanceType = 'Descendents'
20+
Ensure = 'Present'
21+
}
22+
)
23+
}
24+
)
25+
}
26+
ActiveDirectoryAccessEntry HelpdeskOU
27+
{
28+
DistinguishedName = 'OU=dsc,DC=contoso,DC=com'
29+
AccessControlList = @(
30+
ActiveDirectoryAccessControlList
31+
{
32+
Principal = 'contoso\helpdesk'
33+
ForcePrincipal = $true
34+
AccessControlEntry = @(
35+
ActiveDirectoryAccessRule
36+
{
37+
AccessControlType = 'Allow'
38+
ActiveDirectoryRights = 'Delete'
39+
InheritanceType = 'Descendents'
40+
InheritedObjectType = 'organizational-unit'
41+
Ensure = 'Present'
42+
}
43+
)
44+
}
45+
ActiveDirectoryAccessControlList
46+
{
47+
Principal = 'contoso\testgroup'
48+
ForcePrincipal = $true
49+
AccessControlEntry = @(
50+
ActiveDirectoryAccessRule
51+
{
52+
AccessControlType = 'Allow'
53+
ActiveDirectoryRights = 'CreateChild', 'DeleteChild'
54+
InheritanceType = 'all'
55+
ObjectType = 'computer'
56+
Ensure = 'Present'
57+
}
58+
)
59+
}
60+
)
61+
}
62+
}
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
configuration Sample_ADAccessControl
2+
{
3+
Import-DscResource -ModuleName AccessControlDsc
4+
node localhost
5+
{
6+
ActiveDirectoryAuditRuleEntry WestOU
7+
{
8+
DistinguishedName = 'OU=West,DC=contoso,DC=com'
9+
AccessControlList = @(
10+
ActiveDirectorySystemAccessControlList
11+
{
12+
Principal = 'Everyone'
13+
ForcePrincipal = $false
14+
AccessControlEntry = @(
15+
ActiveDirectoryAuditRule
16+
{
17+
AuditFlags = 'Success'
18+
ActiveDirectoryRights = 'GenericAll'
19+
InheritanceType = 'Descendents'
20+
Ensure = 'Present'
21+
}
22+
)
23+
}
24+
)
25+
}
26+
ActiveDirectoryAuditRuleEntry DscOU
27+
{
28+
DistinguishedName = 'Ou=Dsc,DC=contoso,DC=com'
29+
AccessControlList = @(
30+
ActiveDirectorySystemAccessControlList
31+
{
32+
Principal = 'Everyone'
33+
ForcePrincipal = $true
34+
AccessControlEntry = @(
35+
ActiveDirectoryAuditRule
36+
{
37+
AuditFlags = 'Failure'
38+
ActiveDirectoryRights = 'Delete'
39+
InheritanceType = 'Descendents'
40+
InheritedObjectType = 'organizational-unit'
41+
Ensure = 'Present'
42+
}
43+
)
44+
}
45+
)
46+
}
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
configuration Sample_FileAuditEntry
2+
{
3+
Import-DscResource -ModuleName AccessControlDsc
4+
5+
node localhost
6+
{
7+
FileSystemAuditRuleEntry auditFolder
8+
{
9+
Path = 'C:\auditFolder\auditChildFolder'
10+
Force = $true
11+
AuditRuleList = @(
12+
FileSystemAuditRuleList
13+
{
14+
Principal = 'users'
15+
ForcePrincipal = $true
16+
AuditRuleEntry = @(
17+
FileSystemAuditRule
18+
{
19+
AuditFlags = 'Success'
20+
FileSystemRights = 'Write'
21+
Inheritance = 'This folder and files'
22+
Ensure = 'Present'
23+
}
24+
)
25+
}
26+
)
27+
}
28+
29+
FileSystemAuditRuleEntry SqlInstallFolderAuditing
30+
{
31+
Path = 'C:\Program Files\SqlServerInstallation'
32+
Force = $false
33+
AuditRuleList = @(
34+
FileSystemAuditRuleList
35+
{
36+
Principal = 'Everyone'
37+
ForcePrincipal = $false
38+
AuditRuleEntry = @(
39+
FileSystemAuditRule
40+
{
41+
AuditFlags = 'Success'
42+
FileSystemRights = 'Traverse','ExecuteFile','ListDirectory','ReadData','ReadExtendedAttributes','ReadAttributes','CreateFiles','WriteData','CreateDirectories','AppendData','WriteAttributes','WriteExtendedAttributes','Delete','ReadPermissions'
43+
Inheritance = 'This folder subfolders and files'
44+
Ensure = 'Present'
45+
}
46+
)
47+
}
48+
49+
FileSystemAuditRuleList
50+
{
51+
Principal = 'Everyone'
52+
ForcePrincipal = $false
53+
AuditRuleEntry = @(
54+
FileSystemAuditRule
55+
{
56+
AuditFlags = 'Failure'
57+
FileSystemRights = 'Traverse','ExecuteFile','ListDirectory','ReadData','ReadExtendedAttributes','ReadAttributes','CreateFiles','WriteData','CreateDirectories','AppendData','WriteAttributes','WriteExtendedAttributes','Delete','ReadPermissions'
58+
Inheritance = 'This folder subfolders and files'
59+
Ensure = 'Present'
60+
}
61+
)
62+
}
63+
)
64+
}
65+
}
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
configuration Sample_NTFSAccessControl
2+
{
3+
Import-DscResource -ModuleName AccessControlDsc
4+
node localhost
5+
{
6+
NTFSAccessEntry Test
7+
{
8+
Path = 'c:\test'
9+
AccessControlList = @(
10+
NTFSAccessControlList
11+
{
12+
Principal = 'Everyone'
13+
ForcePrincipal = $true
14+
AccessControlEntry = @(
15+
NTFSAccessControlEntry
16+
{
17+
AccessControlType = 'Allow'
18+
FileSystemRights = 'FullControl'
19+
Inheritance = 'This folder and files'
20+
Ensure = 'Present'
21+
}
22+
)
23+
}
24+
NTFSAccessControlList
25+
{
26+
Principal = 'Users'
27+
ForcePrincipal = $false
28+
AccessControlEntry = @(
29+
NTFSAccessControlEntry
30+
{
31+
AccessControlType = 'Allow'
32+
FileSystemRights = 'FullControl'
33+
Inheritance = 'This folder and files'
34+
Ensure = 'Present'
35+
}
36+
)
37+
}
38+
)
39+
}
40+
NTFSAccessEntry Test2
41+
{
42+
Path = 'c:\test2'
43+
AccessControlList = @(
44+
NTFSAccessControlList
45+
{
46+
Principal = 'Everyone'
47+
ForcePrincipal = $true
48+
AccessControlEntry = @(
49+
NTFSAccessControlEntry
50+
{
51+
AccessControlType = 'Allow'
52+
FileSystemRights = 'FullControl'
53+
Inheritance = 'This folder and files'
54+
Ensure = 'Present'
55+
}
56+
)
57+
}
58+
NTFSAccessControlList
59+
{
60+
Principal = 'Users'
61+
ForcePrincipal = $false
62+
AccessControlEntry = @(
63+
NTFSAccessControlEntry
64+
{
65+
AccessControlType = 'Allow'
66+
FileSystemRights = 'FullControl'
67+
Inheritance = 'This folder and files'
68+
Ensure = 'Present'
69+
}
70+
)
71+
}
72+
)
73+
}
74+
}
75+
}
76+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Configuration TestAceResource
2+
{
3+
Import-DscResource -Module AccessControlDsc
4+
5+
Node 'localhost'
6+
{
7+
RegistryAccessEntry TestKeyAccess
8+
{
9+
Path = 'HKLM:\SOFTWARE\Dsc_Test'
10+
AccessControlList = @(
11+
AccessControlList
12+
{
13+
Principal = 'Everyone'
14+
ForcePrincipal = $True
15+
AccessControlEntry = @(
16+
AccessControlEntry
17+
{
18+
AccessControlType = 'Allow'
19+
Rights = 'FullControl'
20+
Inheritance = 'This Key and Subkeys'
21+
Ensure = 'Present'
22+
}
23+
)
24+
}
25+
AccessControlList
26+
{
27+
Principal = 'Users'
28+
ForcePrincipal = $True
29+
AccessControlEntry = @(
30+
AccessControlEntry
31+
{
32+
AccessControlType = 'Allow'
33+
Rights = 'ReadKey'
34+
Inheritance = 'This Key Only'
35+
Ensure = 'Present'
36+
}
37+
)
38+
}
39+
)
40+
}
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<#PSScriptInfo
22
.VERSION 1.0.0
33
.GUID 3dc7df43-9264-411d-9596-36e780725b4e
4-
.AUTHOR DSC Community
5-
.COMPANYNAME DSC Community
6-
.COPYRIGHT DSC Community contributors. All rights reserved.
4+
.AUTHOR Microsoft Corporation
5+
.COMPANYNAME Microsoft Corporation
6+
.COPYRIGHT
77
.TAGS DSCConfiguration
8-
.LICENSEURI https://github.com/dsccommunity/ActiveDirectoryCSDsc/blob/main/LICENSE
9-
.PROJECTURI https://github.com/dsccommunity/ActiveDirectoryCSDsc
8+
.LICENSEURI https://github.com/PowerShell/ActiveDirectoryCSDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PowerShell/ActiveDirectoryCSDsc
1010
.ICONURI
1111
.EXTERNALMODULEDEPENDENCIES
1212
.REQUIREDSCRIPTS
@@ -22,7 +22,7 @@
2222
This example will add the Active Directory Certificate Services Certificate Authority
2323
feature to a server and configure it as a certificate authority enterprise root CA.
2424
#>
25-
Configuration AdcsCertificationAuthority_InstallCertificationAthority_Config"
25+
Configuration AdcsCertificationAuthority_InstallCertificationAthority_Config
2626
{
2727
param
2828
(
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<#PSScriptInfo
22
.VERSION 1.0.0
33
.GUID d0e64a0f-c86a-4b7f-b1db-aee24df4b63f
4-
.AUTHOR DSC Community
5-
.COMPANYNAME DSC Community
6-
.COPYRIGHT DSC Community contributors. All rights reserved.
4+
.AUTHOR Microsoft Corporation
5+
.COMPANYNAME Microsoft Corporation
6+
.COPYRIGHT
77
.TAGS DSCConfiguration
8-
.LICENSEURI https://github.com/dsccommunity/ActiveDirectoryCSDsc/blob/main/LICENSE
9-
.PROJECTURI https://github.com/dsccommunity/ActiveDirectoryCSDsc
8+
.LICENSEURI https://github.com/PowerShell/ActiveDirectoryCSDsc/blob/master/LICENSE
9+
.PROJECTURI https://github.com/PowerShell/ActiveDirectoryCSDsc
1010
.ICONURI
1111
.EXTERNALMODULEDEPENDENCIES
1212
.REQUIREDSCRIPTS
@@ -27,7 +27,7 @@
2727
name suffix to 'DC=CONTOSO,DC=COM'. If an existing CA root certificate exists
2828
in the Active Directory then it will be overwritten.
2929
#>
30-
Configuration AdcsCertificationAuthority_RetireCertificationAthority_Config"
30+
Configuration AdcsCertificationAuthority_RetireCertificationAthority_Config
3131
{
3232
param
3333
(

0 commit comments

Comments
 (0)