-
Notifications
You must be signed in to change notification settings - Fork 2
/
02-M365ConfigWithCert.ps1
122 lines (108 loc) · 4.74 KB
/
02-M365ConfigWithCert.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
param (
[Parameter()]
[System.String]
$OrgName,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$CertificateId
)
Configuration M365TenantConfig
{
param (
[parameter(Mandatory = $true)]
[System.String]
$OrgName,
[Parameter(Mandatory = $true)]
[System.String]
$TenantId,
[Parameter(Mandatory = $true)]
[System.String]
$ApplicationId,
[Parameter(Mandatory = $true)]
[System.String]
$CertificateId
)
Import-DscResource -ModuleName 'Microsoft365DSC'
Node localhost
{
ODSettings 'OneDriveSettings'
{
Ensure = 'Present'
IsSingleInstance = 'Yes'
BlockMacSync = $true
DisableReportProblemDialog = $true
ExcludedFileExtensions = @("ps1")
NotificationsInOneDriveForBusinessEnabled = $true
NotifyOwnersWhenInvitationsAccepted = $true
OneDriveForGuestsEnabled = $false
OrphanedPersonalSitesRetentionPeriod = 60
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateId
TenantId = $TenantId
}
SPOAccessControlSettings 'ConfigureAccessControlSettings'
{
Ensure = 'Present'
IsSingleInstance = 'Yes'
CommentsOnSitePagesDisabled = $true
DisallowInfectedFileDownload = $false
DisplayStartASiteOption = $false
ExternalServicesEnabled = $false
SocialBarOnSitePagesDisabled = $true
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateId
TenantId = $TenantId
}
SPOSharingSettings 'ConfigureSharingSettings'
{
Ensure = 'Present'
IsSingleInstance = 'Yes'
SharingCapability = 'ExistingExternalUserSharingOnly'
EnableGuestSignInAcceleration = $false
SharingDomainRestrictionMode = 'BlockList'
SharingBlockedDomainList = @('homecloudlab.com','contoso.com')
DefaultSharingLinkType = 'Internal'
FileAnonymousLinkType = 'View'
FolderAnonymousLinkType = 'View'
DefaultLinkPermission = 'View'
ShowPeoplePickerSuggestionsForGuestUsers = $false
PreventExternalUsersFromResharing = $true
NotifyOwnersWhenItemsReshared = $true
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateId
TenantId = $TenantId
}
SPOSite 'M365DemoSite'
{
Ensure = 'Present'
Title = 'M365DSC - DevOps'
Url = 'https://x282t.sharepoint.com/sites/DevOps'
Template = 'STS#3'
TimeZoneId = 13
LocaleId = 1033
Owner = "MOD1@$OrgName"
AnonymousLinkExpirationInDays = 15
CommentsOnSitePagesDisabled = $true
DisableFlows = $true
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateId
TenantId = $TenantId
}
}
}
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'localhost'
PsDscAllowPlainTextPassword = $false
}
)
}
# Generate MOF file
M365TenantConfig -ConfigurationData $ConfigurationData -OrgName $OrgName -TenantId $TenantId -ApplicationId $ApplicationId -CertificateId $CertificateId