diff --git a/.github/workflows/Global - Integration - AAD.yml b/.github/workflows/Global - Integration - AAD.yml index 67e0d5cff9..4bea55cdfc 100644 --- a/.github/workflows/Global - Integration - AAD.yml +++ b/.github/workflows/Global - Integration - AAD.yml @@ -15,21 +15,18 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - name: Install Microsoft365DSC + - name: Copy Microsoft365DSC shell: powershell run: | - winrm quickconfig -force $source = "./Modules/Microsoft365DSC/" $destination = "C:\Program Files\WindowsPowerShell\Modules" Copy-Item -Path $source -Recurse -Destination $destination -Container -Force - Update-M365DSCDependencies - name: Configure Environment shell: powershell run: | Set-ExecutionPolicy Unrestricted -Force Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules" -Recurse | Unblock-File Set-M365DSCTelemetryOption -Enabled $false - Set-Item -Path WSMan:\localhost\MaxEnvelopeSizekb -Value 99999 - name: Generate {Create} Integration Tests from Examples shell: powershell run: | @@ -46,62 +43,6 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Create} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.AAD.Create.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - name: Validating {Create} Integration Tests - shell: powershell - run: | - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - - try - { - # Commenting out since this is very finnicky right now and its preventing other tests from running. - # The Get-DSCConfiguration cmdlet isn't providing much value added when failing and doesn't provide - # info about what parsing issues occured. - #$Result = Get-DSCConfiguration -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - name: Generate {Update} Integration Tests from Examples shell: powershell run: | @@ -118,67 +59,11 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Update} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.AAD.Update.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - name: Validating {Update} Integration Tests - shell: powershell - run: | - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - - try - { - # Commenting out since this is very finnicky right now and its preventing other tests from running. - # The Get-DSCConfiguration cmdlet isn't providing much value added when failing and doesn't provide - # info about what parsing issues occured. - #$Result = Get-DSCConfiguration -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - name: Generate {Remove} Integration Tests from Examples shell: powershell run: | - Import-Module './Tests/Integration/M365DSCTestEngine.psm1' - New-M365DSCIntegrationTest -Workload AAD -Step '3-Remove' + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload AAD -Step '3-Remove' - name: Commit {Remove} Integration Tests shell: powershell run: | @@ -190,56 +75,3 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Remove} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.AAD.Remove.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - name: Validating {Remove} Integration Tests - shell: powershell - run: | - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - - try - { - #$Result = Get-DSCConfiguration -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } diff --git a/.github/workflows/Global - Integration - EXO.yml b/.github/workflows/Global - Integration - EXO.yml index 76b0ce03bc..14321abf28 100644 --- a/.github/workflows/Global - Integration - EXO.yml +++ b/.github/workflows/Global - Integration - EXO.yml @@ -46,48 +46,6 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Create} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Create.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - name: Generate {Update} Integration Tests from Examples shell: powershell run: | @@ -104,48 +62,6 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Update} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Update.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - name: Generate {Remove} Integration Tests from Examples shell: powershell run: | @@ -162,46 +78,3 @@ jobs: git push $SHA = git rev-parse HEAD echo "commitid=$SHA" >> $env:GITHUB_OUTPUT - - name: Run {Remove} Integration Tests - shell: powershell - env: - INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} - INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} - run: | - $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force - $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) - try - { - & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Remove.Tests.ps1 -Credential $Credential - } - catch - { - throw $_ - } - - try - { - $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop - } - catch - { - throw $_ - } - - Write-Host "" - - if ($Result.InDesiredState -eq $false) - { - Write-Host -Message "Resources below are not in the Desired State:" - foreach ($Resource in $Result.ResourcesNotInDesiredState) - { - Write-Host $Resource.InstanceName - } - - throw "Could not validate that the Tenant is in the Desired State" - } - else - { - Write-Host "All resources in the Tenant are in the Desired State" - } - diff --git a/.github/workflows/Scheduled - Generate Permission List.yml b/.github/workflows/Scheduled - Generate Permission List.yml new file mode 100644 index 0000000000..e9695f17ed --- /dev/null +++ b/.github/workflows/Scheduled - Generate Permission List.yml @@ -0,0 +1,49 @@ +name: Generate Permissions List +on: + push: + branches: + - Master + - Dev + schedule: + - cron: "0 0 * * *" + +jobs: + # This workflow contains a single job called "build" + GeneratePermissionsList: + # The type of runner that the job will run on + runs-on: windows-latest + + permissions: write-all + + # Only when run from the main repo + if: github.repository == 'microsoft/Microsoft365DSC' + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Dependencies + shell: powershell + run: | + Import-Module './Modules/Microsoft365DSC/Microsoft365DSC.psd1' -Force; + Import-Module './Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1' -Force; + Update-M365DSCModule + - name: Get Permissions List + shell: powershell + run: | + Import-Module './Tests/TestHarness.psm1' -Force; + $permissions = Get-M365DSCAllGraphPermissionsList + $permissions -join ',' | Out-File '.\Tests\QA\Graph.PermissionList.txt' + - name: Commit Permissions List + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/QA/* + git pull + git commit -m "Updated Graph Permissions List" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f62077cf2..455cd4d420 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Change log for Microsoft365DSC +# 1.24.717.1 + +* AADConditionalAccessPolicy + * Made failures write to the error output instead of just verbose. +* EXOHostedOutboundSpamFilterPolicy + * Changed the RecipientLimitInternalPerHour, RecipientLimitPerDay, and + RecipientLimitExternalPerHour parameters to UInt32. +* EXOMessageClassification + * Fix issue while creating policy for first time + FIXES [#4877](https://github.com/microsoft/Microsoft365DSC/issues/4877) +* IntuneDeviceConfigurationEmailProfilePolicyWindows10 + * Fix export by fixing some typos and from where values are extracted + FIXES [#3960](https://github.com/microsoft/Microsoft365DSC/issues/3960) +* IntuneDiskEncryptionWindows10 + * Initial Release + FIXES [#4050](https://github.com/microsoft/Microsoft365DSC/issues/4050) +* IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 + * Initial release. + FIXES [#2659](https://github.com/microsoft/Microsoft365DSC/issues/2659) +* SPOSharingSettings + * Improved performance by using -Filter on Get-PnPTenantSite calls. +* M365DSCDRGUtil + * Fixes an issue with nested and duplicate settings in the settings catalog + * Add support for converting Intune assignments directly from Graph. + FIXES [#4875](https://github.com/microsoft/Microsoft365DSC/issues/4875) +* M365DSCResourceGenerator + * Update Intune resource generation. +* M365DSCReport + * Changes behaviour to not throw on empty configuration during report generation. + FIXES [#4559](https://github.com/microsoft/Microsoft365DSC/issues/4559) + FIXES [#4505](https://github.com/microsoft/Microsoft365DSC/issues/4505) + * Fixes an issue where the comparison treats empty arrays as an empty string. + FIXES [#4796](https://github.com/microsoft/Microsoft365DSC/issues/4796) +* Telemetry + * Added info about operation total execution time. + # 1.24.710.3 * MISC diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAdministrativeUnit/MSFT_AADAdministrativeUnit.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAdministrativeUnit/MSFT_AADAdministrativeUnit.psm1 index aec6e79b42..413dc6b7b7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAdministrativeUnit/MSFT_AADAdministrativeUnit.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAdministrativeUnit/MSFT_AADAdministrativeUnit.psm1 @@ -120,7 +120,7 @@ function Get-TargetResource if ($null -eq $getValue -and -not [string]::IsNullOrEmpty($DisplayName)) { - Write-Verbose -Message "Could not find an Azure AD Administrative Unit with Id {$Id}" + Write-Verbose -Message "Could not find an Azure AD Administrative Unit by Id, trying by DisplayName {$DisplayName}" if (-Not [string]::IsNullOrEmpty($DisplayName)) { if ($null -ne $Script:exportedInstances -and $Script:ExportMode) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationFlowPolicy/MSFT_AADAuthenticationFlowPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationFlowPolicy/MSFT_AADAuthenticationFlowPolicy.schema.mof index cffeaae1e1..5d4a38b79d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationFlowPolicy/MSFT_AADAuthenticationFlowPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationFlowPolicy/MSFT_AADAuthenticationFlowPolicy.schema.mof @@ -5,7 +5,7 @@ class MSFT_AADAuthenticationFlowPolicy : OMI_BaseResource [Write, Description("Unique identifier of the Authentication Flow Policy.")] String Id; [Write, Description("Display name of the Authentication Flow Policy.")] String DisplayName; [Write, Description("Description of the Authentication Flow Policy.")] String Description; - [Write, Description("Indicates whether self-service sign-up flow is enabled or disabled. The default value is false. This property isn't a key. Required.")] String SelfServiceSignUpEnabled; + [Write, Description("Indicates whether self-service sign-up flow is enabled or disabled. The default value is false. This property isn't a key. Required.")] Boolean SelfServiceSignUpEnabled; [Write, Description("Credentials of the Azure Active Directory Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 index d7d6ba740b..c64c6aba13 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 @@ -1666,7 +1666,7 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential - Write-Verbose -Message "Set-Targetresource: Failed change policy $DisplayName" + Write-Error -Message "Set-Targetresource: Failed changing policy $DisplayName" } } elseif ($Ensure -eq 'Present' -and $currentPolicy.Ensure -eq 'Absent') @@ -1689,7 +1689,7 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential - Write-Verbose -Message 'Set-Targetresource: Failed creating new policy' + Write-Error -Message 'Set-Targetresource: Failed creating new policy' } } else @@ -1699,7 +1699,7 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential - Write-Verbose -Message 'Set-Targetresource: Failed creating new policy. At least a user rule, application rule and grant or session control is required' + Write-Error -Message 'Set-Targetresource: Failed creating new policy. At least a user rule, application rule and grant or session control is required' } } elseif ($Ensure -eq 'Absent' -and $currentPolicy.Ensure -eq 'Present') @@ -1717,7 +1717,7 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential - Write-Verbose -Message "Set-Targetresource: Failed deleting policy $DisplayName" + Write-Error -Message "Set-Targetresource: Failed deleting policy $DisplayName" } } Write-Verbose -Message "Set-Targetresource: Finished processing Policy $Displayname" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalogResource/MSFT_AADEntitlementManagementAccessPackageCatalogResource.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalogResource/MSFT_AADEntitlementManagementAccessPackageCatalogResource.psm1 index 5b570d0d55..06bdda2938 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalogResource/MSFT_AADEntitlementManagementAccessPackageCatalogResource.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalogResource/MSFT_AADEntitlementManagementAccessPackageCatalogResource.psm1 @@ -183,7 +183,7 @@ function Get-TargetResource Description = $getValue.description DisplayName = $getValue.displayName IsPendingOnboarding = $getValue.isPendingOnboarding #Read-Only - OriginId = $getValue.originId + OriginId = $OriginId OriginSystem = $getValue.originSystem ResourceType = $getValue.resourceType Url = $getValue.url @@ -336,9 +336,20 @@ function Set-TargetResource $PSBoundParameters.Remove('isPendingOnboarding') | Out-Null $PSBoundParameters.Remove('AccessTokens') | Out-Null + $resource = ([Hashtable]$PSBoundParameters).clone() + $ObjectGuid = [System.Guid]::empty + if ($OriginSystem -eq 'AADGroup' -and ` + -not [System.Guid]::TryParse($OriginId, [System.Management.Automation.PSReference]$ObjectGuid)) + { + Write-Verbose -Message "The Group reference was provided by name {$OriginId}. Retrieving associated id." + $groupInfo = Get-MgGroup -Filter "DisplayName eq '$OriginId'" + if ($null -ne $groupInfo) + { + $resource.OriginId = $groupInfo.Id + } + } if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') { - $resource = ([Hashtable]$PSBoundParameters).clone() $ObjectGuid = [System.Guid]::empty if (-not [System.Guid]::TryParse($CatalogId, [System.Management.Automation.PSReference]$ObjectGuid)) { @@ -717,7 +728,6 @@ function Export-TargetResource [array]$resources = Get-MgBetaEntitlementManagementAccessPackageCatalogAccessPackageResource -AccessPackageCatalogId $catalogId -ErrorAction Stop $j = 1 - $dscContent = '' if ($resources.Length -eq 0) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 index 6ea3b6dda9..f8f39c8e1a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedContentFilterRule/MSFT_EXOHostedContentFilterRule.psm1 @@ -86,7 +86,7 @@ function Get-TargetResource $AccessTokens ) - Write-Verbose -Message "Getting configuration of HostedContentFilterRule for $Identity" + Write-Verbose -Message "Getting configuration of HostedContentFilterRule for [$Identity]" #Ensure the proper dependencies are installed in the current environment. Confirm-M365DSCDependencies @@ -122,10 +122,19 @@ function Get-TargetResource } catch { - $Message = 'Error calling {Get-HostedContentFilterRule}' - New-M365DSCLogEntry -Message $Message ` - -Exception $_ ` - -Source $MyInvocation.MyCommand.ModuleName + try + { + Write-Verbose -Message "Couldn't find rule by ID, trying by name." + $rules = Get-HostedContentFilterRule + $HostedContentFilterRule = $rules | Where-Object -FilterScript {$_.Name -eq $Identity -and $_.HostedContentFilterPolicy -eq $HostedContentFilterPolicy} + } + catch + { + $Message = 'Error calling {Get-HostedContentFilterRule}' + New-M365DSCLogEntry -Message $Message ` + -Exception $_ ` + -Source $MyInvocation.MyCommand.ModuleName + } } if (-not $HostedContentFilterRule) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 index 149c30cc33..a214bd520e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.psm1 @@ -29,15 +29,15 @@ function Get-TargetResource $NotifyOutboundSpam = $true, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitInternalPerHour, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitPerDay, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitExternalPerHour, [Parameter()] @@ -196,15 +196,15 @@ function Set-TargetResource $NotifyOutboundSpam = $true, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitInternalPerHour, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitPerDay, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitExternalPerHour, [Parameter()] @@ -337,15 +337,15 @@ function Test-TargetResource $NotifyOutboundSpam = $true, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitInternalPerHour, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitPerDay, [Parameter()] - [System.String] + [System.UInt32] $RecipientLimitExternalPerHour, [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.schema.mof index 359b208c15..0911e34063 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/MSFT_EXOHostedOutboundSpamFilterPolicy.schema.mof @@ -7,9 +7,9 @@ class MSFT_EXOHostedOutboundSpamFilterPolicy : OMI_BaseResource [Write, Description("The BccSuspiciousOutboundMail parameter enables or disables adding recipients to the Bcc field of outgoing spam messages. Valid input for this parameter is $true or $false. The default value is $false. You specify the additional recipients using the BccSuspiciousOutboundAdditionalRecipients parameter.")] Boolean BccSuspiciousOutboundMail; [Write, Description("The NotifyOutboundSpam parameter enables or disables sending notification messages to administrators when an outgoing message is determined to be spam. Valid input for this parameter is $true or $false. The default value is $false. You specify the administrators to notify by using the NotifyOutboundSpamRecipients parameter.")] Boolean NotifyOutboundSpam; [Write, Description("The NotifyOutboundSpamRecipients parameter specifies the administrators to notify when an outgoing message is determined to be spam. Valid input for this parameter is an email address. Separate multiple email addresses with commas.")] String NotifyOutboundSpamRecipients[]; - [Write, Description("The RecipientLimitInternalPerHour parameter specifies the maximum number of internal recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] String RecipientLimitInternalPerHour; - [Write, Description("The RecipientLimitPerDay parameter specifies the maximum number of recipients that a user can send to within a day. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] String RecipientLimitPerDay; - [Write, Description("The RecipientLimitExternalPerHour parameter specifies the maximum number of external recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] String RecipientLimitExternalPerHour; + [Write, Description("The RecipientLimitInternalPerHour parameter specifies the maximum number of internal recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] UInt32 RecipientLimitInternalPerHour; + [Write, Description("The RecipientLimitPerDay parameter specifies the maximum number of recipients that a user can send to within a day. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] UInt32 RecipientLimitPerDay; + [Write, Description("The RecipientLimitExternalPerHour parameter specifies the maximum number of external recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used.")] UInt32 RecipientLimitExternalPerHour; [Write, Description("The ActionWhenThresholdReached parameter specifies the action to take when any of the limits specified in the policy are reached. Valid values are: Alert, BlockUser, BlockUserForToday. BlockUserForToday is the default value.")] String ActionWhenThresholdReached; [Write, Description("The AutoForwardingMode specifies how the policy controls automatic email forwarding to outbound recipients. Valid values are: Automatic, On, Off.")] String AutoForwardingMode; [Write, Description("Specify if this policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMessageClassification/MSFT_EXOMessageClassification.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMessageClassification/MSFT_EXOMessageClassification.psm1 index 73eb17e9c8..26afd542c2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMessageClassification/MSFT_EXOMessageClassification.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOMessageClassification/MSFT_EXOMessageClassification.psm1 @@ -258,7 +258,7 @@ function Set-TargetResource $ConnectionMode = New-M365DSCConnection -Workload 'ExchangeOnline' ` -InboundParameters $PSBoundParameters - $MessageClassification = Get-MessageClassification -Identity $Identity + $MessageClassification = Get-MessageClassification -Identity $Identity -ErrorAction SilentlyContinue $MessageClassificationParams = [System.Collections.Hashtable]($PSBoundParameters) $MessageClassificationParams.Remove('Ensure') | Out-Null $MessageClassificationParams.Remove('Credential') | Out-Null diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10.psm1 index 42e74512bb..f80396316e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10/MSFT_IntuneDeviceConfigurationEmailProfilePolicyWindows10.psm1 @@ -187,21 +187,21 @@ function Get-TargetResource } $enumUserDomainNameSource = $null - if ($null -ne $getValue.UserDomainNameSource) + if ($null -ne $getValue.AdditionalProperties.userDomainNameSource) { - $enumUserDomainNameSource = $getValue.UserDomainNameSource.ToString() + $enumUserDomainNameSource = $getValue.AdditionalProperties.userDomainNameSource.ToString() } $enumUsernameAADSource = $null - if ($null -ne $getValue.UsernameAADSource) + if ($null -ne $getValue.AdditionalProperties.usernameAADSource) { - $enumUsernameAADSource = $getValue.UsernameAADSource.ToString() + $enumUsernameAADSource = $getValue.AdditionalProperties.usernameAADSource.ToString() } $enumUsernameSource = $null - if ($null -ne $getValue.UsernameSource) + if ($null -ne $getValue.AdditionalProperties.usernameSource) { - $enumUsernameSource = $getValue.UsernameSource.ToString() + $enumUsernameSource = $getValue.AdditionalProperties.usernameSource.ToString() } #endregion @@ -216,7 +216,7 @@ function Get-TargetResource SyncCalendar = $getValue.AdditionalProperties.syncCalendar SyncContacts = $getValue.AdditionalProperties.syncContacts SyncTasks = $getValue.AdditionalProperties.syncTasks - CustomDomainName = $getValue.CustomDomainName + CustomDomainName = $getValue.AdditionalProperties.customDomainName UserDomainNameSource = $enumUserDomainNameSource UsernameAADSource = $enumUsernameAADSource UsernameSource = $enumUsernameSource diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.psm1 new file mode 100644 index 0000000000..36c41b8e6a --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.psm1 @@ -0,0 +1,1417 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RequireDeviceEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EncryptionMethodWithXts_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsOsDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsFdvDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsRdvDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $IdentificationField_Name, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $IdentificationField, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $SecIdentificationField, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowWarningForOtherDiskEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowStandardUserEncryption, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $ConfigureRecoveryPasswordRotation, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $OSEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureAdvancedStartup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMStartupKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMPINKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureNonTPMStartupKeyUsage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigurePINUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $MinimumPINLength_Name, + + [Parameter()] + [ValidateRange(4, 20)] + [System.Int32] + $MinPINLength, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnhancedPIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $DisallowStandardUsersCanChangePIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePreBootPinExceptionOnDECapableDevice_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePrebootInputProtectorsOnSlates_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSAllowDRA_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $OSActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $PrebootRecoveryInfo_Name, + + [Parameter()] + [ValidateSet('0', '1', '2', '3')] + [System.String] + $PrebootRecoveryInfoDropDown_Name, + + [Parameter()] + [ValidateLength(0, 500)] + [System.String] + $RecoveryUrl_Input, + + [Parameter()] + [ValidateLength(0, 900)] + [System.String] + $RecoveryMessage_Input, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $FDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVAllowDRA_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $FDVActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVConfigureBDE, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVAllowBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $RDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDisableBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVCrossOrg, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + try + { + $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` + -InboundParameters $PSBoundParameters + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $nullResult = $PSBoundParameters + $nullResult.Ensure = 'Absent' + + $templateReferenceId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + $getValue = $null + #region resource generator code + $getValue = Get-MgBetaDeviceManagementConfigurationPolicy -DeviceManagementConfigurationPolicyId $Id -ErrorAction SilentlyContinue + + if ($null -eq $getValue) + { + Write-Verbose -Message "Could not find an Intune Disk Encryption for Windows10 with Id {$Id}" + + if (-not [System.String]::IsNullOrEmpty($DisplayName)) + { + $getValue = Get-MgBetaDeviceManagementConfigurationPolicy ` + -Filter "Name eq '$DisplayName' and templateReference/TemplateId eq '$templateReferenceId'" ` + -ErrorAction SilentlyContinue + } + } + #endregion + if ($null -eq $getValue) + { + Write-Verbose -Message "Could not find an Intune Disk Encryption for Windows10 with Name {$DisplayName}." + return $nullResult + } + $Id = $getValue.Id + Write-Verbose -Message "An Intune Disk Encryption for Windows10 with Id {$Id} and Name {$DisplayName} was found" + + # Retrieve policy specific settings + [array]$settings = Get-MgBetaDeviceManagementConfigurationPolicySetting ` + -DeviceManagementConfigurationPolicyId $Id ` + -ExpandProperty 'settingDefinitions' ` + -ErrorAction Stop + + $policySettings = @{} + $policySettings = Export-IntuneSettingCatalogPolicySettings -Settings $settings -ReturnHashtable $policySettings + + $results = @{ + #region resource generator code + Description = $getValue.Description + DisplayName = $getValue.Name + RoleScopeTagIds = $getValue.RoleScopeTagIds + Id = $getValue.Id + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + ApplicationSecret = $ApplicationSecret + CertificateThumbprint = $CertificateThumbprint + ManagedIdentity = $ManagedIdentity.IsPresent + #endregion + } + $results += $policySettings + + $assignmentsValues = Get-MgBetaDeviceManagementConfigurationPolicyAssignment -DeviceManagementConfigurationPolicyId $Id + $assignmentResult = @() + if ($assignmentsValues.Count -gt 0) + { + $assignmentResult += ConvertFrom-IntunePolicyAssignment -Assignments $assignmentsValues -IncludeDeviceFilter $true + } + $results.Add('Assignments', $assignmentResult) + + return [System.Collections.Hashtable] $results + } + catch + { + New-M365DSCLogEntry -Message 'Error retrieving data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + return $nullResult + } +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RequireDeviceEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EncryptionMethodWithXts_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsOsDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsFdvDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsRdvDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $IdentificationField_Name, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $IdentificationField, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $SecIdentificationField, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowWarningForOtherDiskEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowStandardUserEncryption, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $ConfigureRecoveryPasswordRotation, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $OSEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureAdvancedStartup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMStartupKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMPINKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureNonTPMStartupKeyUsage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigurePINUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $MinimumPINLength_Name, + + [Parameter()] + [ValidateRange(4, 20)] + [System.Int32] + $MinPINLength, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnhancedPIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $DisallowStandardUsersCanChangePIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePreBootPinExceptionOnDECapableDevice_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePrebootInputProtectorsOnSlates_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSAllowDRA_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $OSActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $PrebootRecoveryInfo_Name, + + [Parameter()] + [ValidateSet('0', '1', '2', '3')] + [System.String] + $PrebootRecoveryInfoDropDown_Name, + + [Parameter()] + [ValidateLength(0, 500)] + [System.String] + $RecoveryUrl_Input, + + [Parameter()] + [ValidateLength(0, 900)] + [System.String] + $RecoveryMessage_Input, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $FDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVAllowDRA_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $FDVActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVConfigureBDE, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVAllowBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $RDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDisableBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVCrossOrg, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $currentInstance = Get-TargetResource @PSBoundParameters + + $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters + + $templateReferenceId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + $platforms = 'windows10' + $technologies = 'mdm' + + if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') + { + Write-Verbose -Message "Creating an Intune Disk Encryption for Windows10 with Name {$DisplayName}" + $BoundParameters.Remove("Assignments") | Out-Null + + $settings = Get-IntuneSettingCatalogPolicySetting ` + -DSCParams ([System.Collections.Hashtable]$BoundParameters) ` + -TemplateId $templateReferenceId + + $createParameters = @{ + Name = $DisplayName + Description = $Description + TemplateReference = @{ templateId = $templateReferenceId } + Platforms = $platforms + Technologies = $technologies + Settings = $settings + } + + #region resource generator code + $policy = New-MgBetaDeviceManagementConfigurationPolicy -BodyParameter $createParameters + + if ($policy.Id) + { + $assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments + Update-DeviceConfigurationPolicyAssignment ` + -DeviceConfigurationPolicyId $policy.Id ` + -Targets $assignmentsHash ` + -Repository 'deviceManagement/configurationPolicies' + } + #endregion + } + elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + { + Write-Verbose -Message "Updating the Intune Disk Encryption for Windows10 with Id {$($currentInstance.Id)}" + $BoundParameters.Remove("Assignments") | Out-Null + + $settings = Get-IntuneSettingCatalogPolicySetting ` + -DSCParams ([System.Collections.Hashtable]$BoundParameters) ` + -TemplateId $templateReferenceId + + Update-IntuneDeviceConfigurationPolicy ` + -DeviceConfigurationPolicyId $currentInstance.Id ` + -Name $DisplayName ` + -Description $Description ` + -TemplateReferenceId $templateReferenceId ` + -Platforms $platforms ` + -Technologies $technologies ` + -Settings $settings + + #region resource generator code + $assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments + Update-DeviceConfigurationPolicyAssignment ` + -DeviceConfigurationPolicyId $currentInstance.Id ` + -Targets $assignmentsHash ` + -Repository 'deviceManagement/configurationPolicies' + #endregion + } + elseif ($Ensure -eq 'Absent' -and $currentInstance.Ensure -eq 'Present') + { + Write-Verbose -Message "Removing the Intune Disk Encryption for Windows10 with Id {$($currentInstance.Id)}" + #region resource generator code + Remove-MgBetaDeviceManagementConfigurationPolicy -DeviceManagementConfigurationPolicyId $currentInstance.Id + #endregion + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RequireDeviceEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EncryptionMethodWithXts_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsOsDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsFdvDropDown_Name, + + [Parameter()] + [ValidateSet('3', '4', '6', '7')] + [System.String] + $EncryptionMethodWithXtsRdvDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $IdentificationField_Name, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $IdentificationField, + + [Parameter()] + [ValidateLength(0, 260)] + [System.String] + $SecIdentificationField, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowWarningForOtherDiskEncryption, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $AllowStandardUserEncryption, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $ConfigureRecoveryPasswordRotation, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $OSEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureAdvancedStartup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMStartupKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMPINKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigureTPMUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $ConfigureNonTPMStartupKeyUsage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $ConfigurePINUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $MinimumPINLength_Name, + + [Parameter()] + [ValidateRange(4, 20)] + [System.Int32] + $MinPINLength, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnhancedPIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $DisallowStandardUsersCanChangePIN_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePreBootPinExceptionOnDECapableDevice_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $EnablePrebootInputProtectorsOnSlates_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $OSAllowDRA_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $OSRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $OSActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $PrebootRecoveryInfo_Name, + + [Parameter()] + [ValidateSet('0', '1', '2', '3')] + [System.String] + $PrebootRecoveryInfoDropDown_Name, + + [Parameter()] + [ValidateLength(0, 500)] + [System.String] + $RecoveryUrl_Input, + + [Parameter()] + [ValidateLength(0, 900)] + [System.String] + $RecoveryMessage_Input, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $FDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRecoveryUsage_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVHideRecoveryPage_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryPasswordUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVRequireActiveDirectoryBackup_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVAllowDRA_Name, + + [Parameter()] + [ValidateSet('1', '2')] + [System.String] + $FDVActiveDirectoryBackupDropDown_Name, + + [Parameter()] + [ValidateSet('2', '1', '0')] + [System.String] + $FDVRecoveryKeyUsageDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $FDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVConfigureBDE, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVAllowBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVEncryptionType_Name, + + [Parameter()] + [ValidateSet('0', '1', '2')] + [System.String] + $RDVEncryptionTypeDropDown_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDisableBDE_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVDenyWriteAccess_Name, + + [Parameter()] + [ValidateSet('0', '1')] + [System.String] + $RDVCrossOrg, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + Write-Verbose -Message "Testing configuration of the Intune Disk Encryption for Windows10 with Id {$Id} and Name {$DisplayName}" + + $CurrentValues = Get-TargetResource @PSBoundParameters + [Hashtable]$ValuesToCheck = @{} + $MyInvocation.MyCommand.Parameters.GetEnumerator() | ForEach-Object { + if ($_.Key -notlike '*Variable' -or $_.Key -notin @('Verbose', 'Debug', 'ErrorAction', 'WarningAction', 'InformationAction')) + { + if ($null -ne $CurrentValues[$_.Key] -or $null -ne $PSBoundParameters[$_.Key]) + { + $ValuesToCheck.Add($_.Key, $null) + if (-not $PSBoundParameters.ContainsKey($_.Key)) + { + $PSBoundParameters.Add($_.Key, $null) + } + } + } + } + + if ($CurrentValues.Ensure -ne $Ensure) + { + Write-Verbose -Message "Test-TargetResource returned $false" + return $false + } + $testResult = $true + + #Compare Cim instances + foreach ($key in $PSBoundParameters.Keys) + { + $source = $PSBoundParameters.$key + $target = $CurrentValues.$key + if ($null -ne $source -and $source.GetType().Name -like '*CimInstance*') + { + $testResult = Compare-M365DSCComplexObject ` + -Source ($source) ` + -Target ($target) + + if (-not $testResult) + { + break + } + + $ValuesToCheck.Remove($key) | Out-Null + } + } + + $ValuesToCheck.Remove('Id') | Out-Null + $ValuesToCheck = Remove-M365DSCAuthenticationParameter -BoundParameters $ValuesToCheck + + Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)" + Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)" + + if ($testResult) + { + $testResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` + -Source $($MyInvocation.MyCommand.Source) ` + -DesiredValues $PSBoundParameters ` + -ValuesToCheck $ValuesToCheck.Keys + } + + Write-Verbose -Message "Test-TargetResource returned $testResult" + + return $testResult +} + +function Export-TargetResource +{ + [CmdletBinding()] + [OutputType([System.String])] + param + ( + [Parameter()] + [System.String] + $Filter, + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` + -InboundParameters $PSBoundParameters + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + try + { + #region resource generator code + $policyTemplateID = "46ddfc50-d10f-4867-b852-9434254b3bff_1" + [array]$getValue = Get-MgBetaDeviceManagementConfigurationPolicy ` + -Filter $Filter ` + -All ` + -ErrorAction Stop | Where-Object ` + -FilterScript { + $_.TemplateReference.TemplateId -eq $policyTemplateID + } + #endregion + + $i = 1 + $dscContent = '' + if ($getValue.Length -eq 0) + { + Write-Host $Global:M365DSCEmojiGreenCheckMark + } + else + { + Write-Host "`r`n" -NoNewline + } + foreach ($config in $getValue) + { + $displayedKey = $config.Id + if (-not [String]::IsNullOrEmpty($config.displayName)) + { + $displayedKey = $config.displayName + } + elseif (-not [string]::IsNullOrEmpty($config.name)) + { + $displayedKey = $config.name + } + Write-Host " |---[$i/$($getValue.Count)] $displayedKey" -NoNewline + $params = @{ + Id = $config.Id + DisplayName = $config.Name + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + ApplicationSecret = $ApplicationSecret + CertificateThumbprint = $CertificateThumbprint + ManagedIdentity = $ManagedIdentity.IsPresent + AccessTokens = $AccessTokens + } + + $Results = Get-TargetResource @Params + $Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode ` + -Results $Results + + if ($Results.Assignments) + { + $complexTypeStringResult = Get-M365DSCDRGComplexTypeToString -ComplexObject $Results.Assignments -CIMInstanceName DeviceManagementConfigurationPolicyAssignments + if ($complexTypeStringResult) + { + $Results.Assignments = $complexTypeStringResult + } + else + { + $Results.Remove('Assignments') | Out-Null + } + } + + $currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName ` + -ConnectionMode $ConnectionMode ` + -ModulePath $PSScriptRoot ` + -Results $Results ` + -Credential $Credential + + if ($Results.Assignments) + { + $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "Assignments" -IsCIMArray:$true + } + + $dscContent += $currentDSCBlock + Save-M365DSCPartialExport -Content $currentDSCBlock ` + -FileName $Global:PartialExportFileName + $i++ + Write-Host $Global:M365DSCEmojiGreenCheckMark + } + return $dscContent + } + catch + { + Write-Host $Global:M365DSCEmojiRedX + + New-M365DSCLogEntry -Message 'Error during Export:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + return '' + } +} + +Export-ModuleMember -Function *-TargetResource diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.schema.mof new file mode 100644 index 0000000000..8c0a4d02db --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/MSFT_IntuneDiskEncryptionWindows10.schema.mof @@ -0,0 +1,83 @@ +[ClassVersion("1.0.0.0")] +class MSFT_DeviceManagementConfigurationPolicyAssignments +{ + [Write, Description("The type of the target assignment."), ValueMap{"#microsoft.graph.groupAssignmentTarget","#microsoft.graph.allLicensedUsersAssignmentTarget","#microsoft.graph.allDevicesAssignmentTarget","#microsoft.graph.exclusionGroupAssignmentTarget","#microsoft.graph.configurationManagerCollectionAssignmentTarget"}, Values{"#microsoft.graph.groupAssignmentTarget","#microsoft.graph.allLicensedUsersAssignmentTarget","#microsoft.graph.allDevicesAssignmentTarget","#microsoft.graph.exclusionGroupAssignmentTarget","#microsoft.graph.configurationManagerCollectionAssignmentTarget"}] String dataType; + [Write, Description("The type of filter of the target assignment i.e. Exclude or Include. Possible values are:none, include, exclude."), ValueMap{"none","include","exclude"}, Values{"none","include","exclude"}] String deviceAndAppManagementAssignmentFilterType; + [Write, Description("The Id of the filter for the target assignment.")] String deviceAndAppManagementAssignmentFilterId; + [Write, Description("The group Id that is the target of the assignment.")] String groupId; + [Write, Description("The group Display Name that is the target of the assignment.")] String groupDisplayName; + [Write, Description("The collection Id that is the target of the assignment.(ConfigMgr)")] String collectionId; +}; + +[ClassVersion("1.0.0.0"), FriendlyName("IntuneDiskEncryptionWindows10")] +class MSFT_IntuneDiskEncryptionWindows10 : OMI_BaseResource +{ + [Write, Description("Policy description")] String Description; + [Key, Description("Policy name")] String DisplayName; + [Write, Description("List of Scope Tags for this Entity instance.")] String RoleScopeTagIds[]; + [Write, Description("The unique identifier for an entity. Read-only.")] String Id; + [Write, Description("Require Device Encryption (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RequireDeviceEncryption; + [Write, Description("Choose drive encryption method and cipher strength (Windows 10 [Version 1511] and later) (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String EncryptionMethodWithXts_Name; + [Write, Description("Select the encryption method for operating system drives: (3: AES-CBC 128-bit, 4: AES-CBC 256-bit, 6: XTS-AES 128-bit (default), 7: XTS-AES 256-bit)"), ValueMap{"3", "4", "6", "7"}, Values{"3", "4", "6", "7"}] String EncryptionMethodWithXtsOsDropDown_Name; + [Write, Description("Select the encryption method for fixed data drives: (3: AES-CBC 128-bit, 4: AES-CBC 256-bit, 6: XTS-AES 128-bit (default), 7: XTS-AES 256-bit)"), ValueMap{"3", "4", "6", "7"}, Values{"3", "4", "6", "7"}] String EncryptionMethodWithXtsFdvDropDown_Name; + [Write, Description("Select the encryption method for removable data drives: (3: AES-CBC 128-bit (default), 4: AES-CBC 256-bit, 6: XTS-AES 128-bit, 7: XTS-AES 256-bit)"), ValueMap{"3", "4", "6", "7"}, Values{"3", "4", "6", "7"}] String EncryptionMethodWithXtsRdvDropDown_Name; + [Write, Description("Provide the unique identifiers for your organization (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String IdentificationField_Name; + [Write, Description("BitLocker identification field: (Device)")] String IdentificationField; + [Write, Description("Allowed BitLocker identification field: (Device)")] String SecIdentificationField; + [Write, Description("Allow Warning For Other Disk Encryption (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String AllowWarningForOtherDiskEncryption; + [Write, Description("Allow Standard User Encryption (0: This is the default, when the policy is not set. If current logged on user is a standard user, 'RequireDeviceEncryption' policy will not try to enable encryption on any drive., 1: 'RequireDeviceEncryption' policy will try to enable encryption on all fixed drives even if a current logged in user is standard user.)"), ValueMap{"0", "1"}, Values{"0", "1"}] String AllowStandardUserEncryption; + [Write, Description("Configure Recovery Password Rotation (0: Refresh off (default), 1: Refresh on for Azure AD-joined devices, 2: Refresh on for both Azure AD-joined and hybrid-joined devices)"), ValueMap{"0", "1", "2"}, Values{"0", "1", "2"}] String ConfigureRecoveryPasswordRotation; + [Write, Description("Enforce drive encryption type on operating system drives (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSEncryptionType_Name; + [Write, Description("Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption)"), ValueMap{"0", "1", "2"}, Values{"0", "1", "2"}] String OSEncryptionTypeDropDown_Name; + [Write, Description("Require additional authentication at startup (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String ConfigureAdvancedStartup_Name; + [Write, Description("Configure TPM startup key: (2: Allow startup key with TPM, 1: Require startup key with TPM, 0: Do not allow startup key with TPM)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String ConfigureTPMStartupKeyUsageDropDown_Name; + [Write, Description("Configure TPM startup key and PIN: (2: Allow startup key and PIN with TPM, 1: Require startup key and PIN with TPM, 0: Do not allow startup key and PIN with TPM)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String ConfigureTPMPINKeyUsageDropDown_Name; + [Write, Description("Configure TPM startup: (2: Allow TPM, 1: Require TPM, 0: Do not allow TPM)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String ConfigureTPMUsageDropDown_Name; + [Write, Description("Allow BitLocker without a compatible TPM (requires a password or a startup key on a USB flash drive) (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String ConfigureNonTPMStartupKeyUsage_Name; + [Write, Description("Configure TPM startup PIN: (2: Allow startup PIN with TPM, 1: Require startup PIN with TPM, 0: Do not allow startup PIN with TPM)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String ConfigurePINUsageDropDown_Name; + [Write, Description("Configure minimum PIN length for startup (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String MinimumPINLength_Name; + [Write, Description("Minimum characters:")] SInt32 MinPINLength; + [Write, Description("Allow enhanced PINs for startup (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String EnhancedPIN_Name; + [Write, Description("Disallow standard users from changing the PIN or password (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String DisallowStandardUsersCanChangePIN_Name; + [Write, Description("Allow devices compliant with InstantGo or HSTI to opt out of pre-boot PIN. (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String EnablePreBootPinExceptionOnDECapableDevice_Name; + [Write, Description("Enable use of BitLocker authentication requiring preboot keyboard input on slates (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String EnablePrebootInputProtectorsOnSlates_Name; + [Write, Description("Choose how BitLocker-protected operating system drives can be recovered (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSRecoveryUsage_Name; + [Write, Description("Do not enable BitLocker until recovery information is stored to AD DS for operating system drives (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSRequireActiveDirectoryBackup_Name; + [Write, Description("Save BitLocker recovery information to AD DS for operating system drives (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSActiveDirectoryBackup_Name; + [Write, Description("Configure user storage of BitLocker recovery information: (2: Allow 48-digit recovery password, 1: Require 48-digit recovery password, 0: Do not allow 48-digit recovery password)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String OSRecoveryPasswordUsageDropDown_Name; + [Write, Description("Omit recovery options from the BitLocker setup wizard (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSHideRecoveryPage_Name; + [Write, Description("Allow data recovery agent (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String OSAllowDRA_Name; + [Write, Description("Configure OS recovery key usage: (2: Allow 256-bit recovery key, 1: Require 256-bit recovery key, 0: Do not allow 256-bit recovery key)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String OSRecoveryKeyUsageDropDown_Name; + [Write, Description("Configure storage of BitLocker recovery information to AD DS: (1: Store recovery passwords and key packages, 2: Store recovery passwords only)"), ValueMap{"1", "2"}, Values{"1", "2"}] String OSActiveDirectoryBackupDropDown_Name; + [Write, Description("Configure pre-boot recovery message and URL (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String PrebootRecoveryInfo_Name; + [Write, Description("Select an option for the pre-boot recovery message: (0: , 1: Use default recovery message and URL, 2: Use custom recovery message, 3: Use custom recovery URL)"), ValueMap{"0", "1", "2", "3"}, Values{"0", "1", "2", "3"}] String PrebootRecoveryInfoDropDown_Name; + [Write, Description("Custom recovery URL option:")] String RecoveryUrl_Input; + [Write, Description("Custom recovery message option:")] String RecoveryMessage_Input; + [Write, Description("Enforce drive encryption type on fixed data drives (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVEncryptionType_Name; + [Write, Description("Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption)"), ValueMap{"0", "1", "2"}, Values{"0", "1", "2"}] String FDVEncryptionTypeDropDown_Name; + [Write, Description("Choose how BitLocker-protected fixed drives can be recovered (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVRecoveryUsage_Name; + [Write, Description("Save BitLocker recovery information to AD DS for fixed data drives (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVActiveDirectoryBackup_Name; + [Write, Description("Omit recovery options from the BitLocker setup wizard (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVHideRecoveryPage_Name; + [Write, Description("Configure user storage of BitLocker recovery information: (2: Allow 48-digit recovery password, 1: Require 48-digit recovery password, 0: Do not allow 48-digit recovery password)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String FDVRecoveryPasswordUsageDropDown_Name; + [Write, Description("Do not enable BitLocker until recovery information is stored to AD DS for fixed data drives (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVRequireActiveDirectoryBackup_Name; + [Write, Description("Allow data recovery agent (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVAllowDRA_Name; + [Write, Description("Configure storage of BitLocker recovery information to AD DS: (1: Backup recovery passwords and key packages, 2: Backup recovery passwords only)"), ValueMap{"1", "2"}, Values{"1", "2"}] String FDVActiveDirectoryBackupDropDown_Name; + [Write, Description("Select the fixed drive recovery key usage: (2: Allow 256-bit recovery key, 1: Require 256-bit recovery key, 0: Do not allow 256-bit recovery key)"), ValueMap{"2", "1", "0"}, Values{"2", "1", "0"}] String FDVRecoveryKeyUsageDropDown_Name; + [Write, Description("Deny write access to fixed drives not protected by BitLocker (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String FDVDenyWriteAccess_Name; + [Write, Description("Control use of BitLocker on removable drives (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVConfigureBDE; + [Write, Description("Allow users to apply BitLocker protection on removable data drives (Device) (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVAllowBDE_Name; + [Write, Description("Enforce drive encryption type on removable data drives (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVEncryptionType_Name; + [Write, Description("Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption)"), ValueMap{"0", "1", "2"}, Values{"0", "1", "2"}] String RDVEncryptionTypeDropDown_Name; + [Write, Description("Allow users to suspend and decrypt BitLocker protection on removable data drives (Device) (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVDisableBDE_Name; + [Write, Description("Deny write access to removable drives not protected by BitLocker (0: Disabled, 1: Enabled)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVDenyWriteAccess_Name; + [Write, Description("Do not allow write access to devices configured in another organization (0: False, 1: True)"), ValueMap{"0", "1"}, Values{"0", "1"}] String RDVCrossOrg; + [Write, Description("Represents the assignment to the Intune policy."), EmbeddedInstance("MSFT_DeviceManagementConfigurationPolicyAssignments")] String Assignments[]; + [Write, Description("Present ensures the policy exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; + [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; + [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; + [Write, Description("Secret of the Azure Active Directory tenant used for authentication."), EmbeddedInstance("MSFT_Credential")] String ApplicationSecret; + [Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint; + [Write, Description("Managed ID being used for authentication.")] Boolean ManagedIdentity; + [Write, Description("Access token used for authentication.")] String AccessTokens[]; +}; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/readme.md b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/readme.md new file mode 100644 index 0000000000..6200b8a4ef --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/readme.md @@ -0,0 +1,6 @@ + +# IntuneDiskEncryptionWindows10 + +## Description + +Intune Disk Encryption for Windows10 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/settings.json b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/settings.json new file mode 100644 index 0000000000..861f452495 --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDiskEncryptionWindows10/settings.json @@ -0,0 +1,32 @@ +{ + "resourceName":"IntuneDiskEncryptionWindows10", + "description":"This resource configures an Intune Disk Encryption for Windows10.", + "permissions":{ + "graph":{ + "delegated":{ + "read":[ + { + "name":"DeviceManagementConfiguration.Read.All" + } + ], + "update":[ + { + "name":"DeviceManagementConfiguration.ReadWrite.All" + } + ] + }, + "application":{ + "read":[ + { + "name":"DeviceManagementConfiguration.Read.All" + } + ], + "update":[ + { + "name":"DeviceManagementConfiguration.ReadWrite.All" + } + ] + } + } + } +} diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.psm1 new file mode 100644 index 0000000000..6948b0b3ce --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.psm1 @@ -0,0 +1,619 @@ +function Get-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance] + $ExpeditedUpdateSettings, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + try + { + $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` + -InboundParameters $PSBoundParameters + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + $nullResult = $PSBoundParameters + $nullResult.Ensure = 'Absent' + + $getValue = $null + #region resource generator code + $getValue = Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -WindowsQualityUpdateProfileId $Id -ErrorAction SilentlyContinue + + if ($null -eq $getValue) + { + Write-Verbose -Message "Could not find an Intune Windows Update For Business Quality Update Profile for Windows10 with Id {$Id}" + + if (-not [System.String]::IsNullOrEmpty($DisplayName)) + { + $getValue = Get-MgBetaDeviceManagementWindowsQualityUpdateProfile ` + -All ` + -ErrorAction SilentlyContinue | Where-Object -FilterScript { + $_.DisplayName -eq $DisplayName + } + } + } + #endregion + if ($null -eq $getValue) + { + Write-Verbose -Message "Could not find an Intune Windows Update For Business Quality Update Profile for Windows10 with DisplayName {$DisplayName}." + return $nullResult + } + $Id = $getValue.Id + Write-Verbose -Message "An Intune Windows Update For Business Quality Update Profile for Windows10 with Id {$Id} and DisplayName {$DisplayName} was found" + + #region resource generator code + $complexExpeditedUpdateSettings = @{} + $complexExpeditedUpdateSettings.Add('DaysUntilForcedReboot', $getValue.ExpeditedUpdateSettings.daysUntilForcedReboot) + $complexExpeditedUpdateSettings.Add('QualityUpdateRelease', $getValue.ExpeditedUpdateSettings.qualityUpdateRelease) + if ($complexExpeditedUpdateSettings.values.Where({$null -ne $_}).Count -eq 0) + { + $complexExpeditedUpdateSettings = $null + } + #endregion + + $results = @{ + #region resource generator code + Description = $getValue.Description + DisplayName = $getValue.DisplayName + ExpeditedUpdateSettings = $complexExpeditedUpdateSettings + RoleScopeTagIds = $getValue.RoleScopeTagIds + Id = $getValue.Id + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + ApplicationSecret = $ApplicationSecret + CertificateThumbprint = $CertificateThumbprint + ManagedIdentity = $ManagedIdentity.IsPresent + #endregion + } + + $assignmentsValues = Get-MgBetaDeviceManagementWindowsQualityUpdateProfileAssignment -WindowsQualityUpdateProfileId $Id + $assignmentResult = @() + if ($assignmentsValues.Count -gt 0) + { + $assignmentResult += ConvertFrom-IntunePolicyAssignment -Assignments $assignmentsValues -IncludeDeviceFilter $true + } + $results.Add('Assignments', $assignmentResult) + + return [System.Collections.Hashtable] $results + } + catch + { + New-M365DSCLogEntry -Message 'Error retrieving data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + return $nullResult + } +} + +function Set-TargetResource +{ + [CmdletBinding()] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance] + $ExpeditedUpdateSettings, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + if ($ExpeditedUpdateSettings.DaysUntilForcedReboot -lt 0 -or $ExpeditedUpdateSettings.DaysUntilForcedReboot -gt 2) + { + throw "DaysUntilForcedReboot must be between 0 and 2." + } + + $currentInstance = Get-TargetResource @PSBoundParameters + + $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters + + if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') + { + Write-Verbose -Message "Creating an Intune Windows Update For Business Quality Update Profile for Windows10 with DisplayName {$DisplayName}" + $BoundParameters.Remove("Assignments") | Out-Null + + $createParameters = ([Hashtable]$BoundParameters).clone() + $createParameters = Rename-M365DSCCimInstanceParameter -Properties $createParameters + $createParameters.Remove('Id') | Out-Null + + $keys = (([Hashtable]$createParameters).clone()).Keys + foreach ($key in $keys) + { + if ($null -ne $createParameters.$key -and $createParameters.$key.GetType().Name -like '*cimInstance*') + { + $createParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $createParameters.$key + } + } + + #region resource generator code + $policy = New-MgBetaDeviceManagementWindowsQualityUpdateProfile -BodyParameter $createParameters + if ($policy.Id) + { + $assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:$true -Assignments $Assignments + Update-DeviceConfigurationPolicyAssignment ` + -DeviceConfigurationPolicyId $policy.Id ` + -Targets $assignmentsHash ` + -Repository 'deviceManagement/windowsQualityUpdateProfiles' + } + #endregion + } + elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + { + Write-Verbose -Message "Updating the Intune Windows Update For Business Quality Update Profile for Windows10 with Id {$($currentInstance.Id)}" + $BoundParameters.Remove("Assignments") | Out-Null + + $updateParameters = ([Hashtable]$BoundParameters).clone() + $updateParameters = Rename-M365DSCCimInstanceParameter -Properties $updateParameters + $updateParameters.Remove('Id') | Out-Null + + $keys = (([Hashtable]$updateParameters).clone()).Keys + foreach ($key in $keys) + { + if ($null -ne $updateParameters.$key -and $updateParameters.$key.GetType().Name -like '*cimInstance*') + { + $updateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $updateParameters.$key + } + } + + #region resource generator code + Update-MgBetaDeviceManagementWindowsQualityUpdateProfile ` + -WindowsQualityUpdateProfileId $currentInstance.Id ` + -BodyParameter $updateParameters + + $assignmentsHash = ConvertTo-IntunePolicyAssignment -Assignments $Assignments -IncludeDeviceFilter:$true + Update-DeviceConfigurationPolicyAssignment ` + -DeviceConfigurationPolicyId $currentInstance.Id ` + -Targets $assignmentsHash ` + -Repository 'deviceManagement/windowsQualityUpdateProfiles' + #endregion + } + elseif ($Ensure -eq 'Absent' -and $currentInstance.Ensure -eq 'Present') + { + Write-Verbose -Message "Removing the Intune Windows Update For Business Quality Update Profile for Windows10 with Id {$($currentInstance.Id)}" + #region resource generator code + Remove-MgBetaDeviceManagementWindowsQualityUpdateProfile -WindowsQualityUpdateProfileId $currentInstance.Id + #endregion + } +} + +function Test-TargetResource +{ + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + #region resource generator code + [Parameter()] + [System.String] + $Description, + + [Parameter(Mandatory = $true)] + [System.String] + $DisplayName, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance] + $ExpeditedUpdateSettings, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Assignments, + #endregion + + [Parameter()] + [System.String] + [ValidateSet('Absent', 'Present')] + $Ensure = 'Present', + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + if ($ExpeditedUpdateSettings.DaysUntilForcedReboot -lt 0 -or $ExpeditedUpdateSettings.DaysUntilForcedReboot -gt 2) + { + throw "DaysUntilForcedReboot must be between 0 and 2." + } + + Write-Verbose -Message "Testing configuration of the Intune Windows Update For Business Quality Update Profile for Windows10 with Id {$Id} and DisplayName {$DisplayName}" + + $CurrentValues = Get-TargetResource @PSBoundParameters + $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() + + if ($CurrentValues.Ensure -ne $Ensure) + { + Write-Verbose -Message "Test-TargetResource returned $false" + return $false + } + $testResult = $true + + #Compare Cim instances + foreach ($key in $PSBoundParameters.Keys) + { + $source = $PSBoundParameters.$key + $target = $CurrentValues.$key + if ($null -ne $source -and $source.GetType().Name -like '*CimInstance*') + { + $testResult = Compare-M365DSCComplexObject ` + -Source ($source) ` + -Target ($target) + + if (-not $testResult) + { + break + } + + $ValuesToCheck.Remove($key) | Out-Null + } + } + + $ValuesToCheck.Remove('Id') | Out-Null + $ValuesToCheck = Remove-M365DSCAuthenticationParameter -BoundParameters $ValuesToCheck + + Write-Verbose -Message "Current Values: $(Convert-M365DscHashtableToString -Hashtable $CurrentValues)" + Write-Verbose -Message "Target Values: $(Convert-M365DscHashtableToString -Hashtable $ValuesToCheck)" + + if ($testResult) + { + $testResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` + -Source $($MyInvocation.MyCommand.Source) ` + -DesiredValues $PSBoundParameters ` + -ValuesToCheck $ValuesToCheck.Keys + } + + Write-Verbose -Message "Test-TargetResource returned $testResult" + + return $testResult +} + +function Export-TargetResource +{ + [CmdletBinding()] + [OutputType([System.String])] + param + ( + [Parameter()] + [System.String] + $Filter, + + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential, + + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ApplicationSecret, + + [Parameter()] + [System.String] + $CertificateThumbprint, + + [Parameter()] + [Switch] + $ManagedIdentity, + + [Parameter()] + [System.String[]] + $AccessTokens + ) + + $ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' ` + -InboundParameters $PSBoundParameters + + #Ensure the proper dependencies are installed in the current environment. + Confirm-M365DSCDependencies + + #region Telemetry + $ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '') + $CommandName = $MyInvocation.MyCommand + $data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName ` + -CommandName $CommandName ` + -Parameters $PSBoundParameters + Add-M365DSCTelemetryEvent -Data $data + #endregion + + try + { + #region resource generator code + # Filter not supported on this resource + # [array]$getValue = Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -Filter $Filter -All -ErrorAction Stop + if (-not [string]::IsNullOrEmpty($Filter)) + { + Write-Warning -Message "Microsoft Graph filter is not supported on this resource. Only best-effort filtering using startswith, endswith and contains is supported." + $complexFunctions = Get-ComplexFunctionsFromFilterQuery -FilterQuery $Filter + $Filter = Remove-ComplexFunctionsFromFilterQuery -FilterQuery $Filter + } + [array]$getValue = Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -All -ErrorAction Stop + $getValue = Find-GraphDataUsingComplexFunctions -ComplexFunctions $complexFunctions -Policies $getValue + #endregion + + $i = 1 + $dscContent = '' + if ($getValue.Length -eq 0) + { + Write-Host $Global:M365DSCEmojiGreenCheckMark + } + else + { + Write-Host "`r`n" -NoNewline + } + foreach ($config in $getValue) + { + $displayedKey = $config.Id + if (-not [String]::IsNullOrEmpty($config.displayName)) + { + $displayedKey = $config.displayName + } + Write-Host " |---[$i/$($getValue.Count)] $displayedKey" -NoNewline + $params = @{ + Id = $config.Id + DisplayName = $config.DisplayName + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + ApplicationSecret = $ApplicationSecret + CertificateThumbprint = $CertificateThumbprint + ManagedIdentity = $ManagedIdentity.IsPresent + AccessTokens = $AccessTokens + } + + $Results = Get-TargetResource @Params + $Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode ` + -Results $Results + if ($null -ne $Results.ExpeditedUpdateSettings) + { + $complexTypeStringResult = Get-M365DSCDRGComplexTypeToString ` + -ComplexObject $Results.ExpeditedUpdateSettings ` + -CIMInstanceName 'MicrosoftGraphexpeditedWindowsQualityUpdateSettings' + if (-not [String]::IsNullOrWhiteSpace($complexTypeStringResult)) + { + $Results.ExpeditedUpdateSettings = $complexTypeStringResult + } + else + { + $Results.Remove('ExpeditedUpdateSettings') | Out-Null + } + } + + if ($Results.Assignments) + { + $complexTypeStringResult = Get-M365DSCDRGComplexTypeToString -ComplexObject $Results.Assignments -CIMInstanceName DeviceManagementConfigurationPolicyAssignments + if ($complexTypeStringResult) + { + $Results.Assignments = $complexTypeStringResult + } + else + { + $Results.Remove('Assignments') | Out-Null + } + } + + $currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName ` + -ConnectionMode $ConnectionMode ` + -ModulePath $PSScriptRoot ` + -Results $Results ` + -Credential $Credential + if ($Results.ExpeditedUpdateSettings) + { + $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "ExpeditedUpdateSettings" -IsCIMArray:$False + } + + if ($Results.Assignments) + { + $currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName "Assignments" -IsCIMArray:$true + } + + $dscContent += $currentDSCBlock + Save-M365DSCPartialExport -Content $currentDSCBlock ` + -FileName $Global:PartialExportFileName + $i++ + Write-Host $Global:M365DSCEmojiGreenCheckMark + } + return $dscContent + } + catch + { + Write-Host $Global:M365DSCEmojiRedX + + New-M365DSCLogEntry -Message 'Error during Export:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + return '' + } +} + +Export-ModuleMember -Function *-TargetResource diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.schema.mof new file mode 100644 index 0000000000..599830987a --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.schema.mof @@ -0,0 +1,36 @@ +[ClassVersion("1.0.0.0")] +class MSFT_DeviceManagementConfigurationPolicyAssignments +{ + [Write, Description("The type of the target assignment."), ValueMap{"#microsoft.graph.groupAssignmentTarget","#microsoft.graph.allLicensedUsersAssignmentTarget","#microsoft.graph.allDevicesAssignmentTarget","#microsoft.graph.exclusionGroupAssignmentTarget","#microsoft.graph.configurationManagerCollectionAssignmentTarget"}, Values{"#microsoft.graph.groupAssignmentTarget","#microsoft.graph.allLicensedUsersAssignmentTarget","#microsoft.graph.allDevicesAssignmentTarget","#microsoft.graph.exclusionGroupAssignmentTarget","#microsoft.graph.configurationManagerCollectionAssignmentTarget"}] String dataType; + [Write, Description("The type of filter of the target assignment i.e. Exclude or Include. Possible values are:none, include, exclude."), ValueMap{"none","include","exclude"}, Values{"none","include","exclude"}] String deviceAndAppManagementAssignmentFilterType; + [Write, Description("The Id of the filter for the target assignment.")] String deviceAndAppManagementAssignmentFilterId; + [Write, Description("The group Id that is the target of the assignment.")] String groupId; + [Write, Description("The group Display Name that is the target of the assignment.")] String groupDisplayName; + [Write, Description("The collection Id that is the target of the assignment.(ConfigMgr)")] String collectionId; +}; + +[ClassVersion("1.0.0")] +class MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings +{ + [Write, Description("The number of days after installation that forced reboot will happen. Must be in range from 0 to 2.")] UInt32 DaysUntilForcedReboot; + [Write, Description("The release date to identify a quality update. Format is yyyy-MM-ddT00:00:00Z.")] String QualityUpdateRelease; +}; + +[ClassVersion("1.0.0.0"), FriendlyName("IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10")] +class MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 : OMI_BaseResource +{ + [Key, Description("The display name for the profile.")] String DisplayName; + [Write, Description("The description of the profile.")] String Description; + [Write, Description("Expedited update settings."), EmbeddedInstance("MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings")] String ExpeditedUpdateSettings; + [Write, Description("List of Scope Tags for this Quality Update entity.")] String RoleScopeTagIds[]; + [Write, Description("The unique identifier for an entity. Read-only.")] String Id; + [Write, Description("Represents the assignment to the Intune policy."), EmbeddedInstance("MSFT_DeviceManagementConfigurationPolicyAssignments")] String Assignments[]; + [Write, Description("Present ensures the policy exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; + [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; + [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; + [Write, Description("Secret of the Azure Active Directory tenant used for authentication."), EmbeddedInstance("MSFT_Credential")] String ApplicationSecret; + [Write, Description("Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.")] String CertificateThumbprint; + [Write, Description("Managed ID being used for authentication.")] Boolean ManagedIdentity; + [Write, Description("Access token used for authentication.")] String AccessTokens[]; +}; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/readme.md b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/readme.md new file mode 100644 index 0000000000..507894c9ef --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/readme.md @@ -0,0 +1,6 @@ + +# IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 + +## Description + +Intune Windows Update For Business Quality Update Profile for Windows10 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/settings.json b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/settings.json new file mode 100644 index 0000000000..26b6907b55 --- /dev/null +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/settings.json @@ -0,0 +1,32 @@ +{ + "resourceName":"IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10", + "description":"This resource configures an Intune Windows Update For Business Quality Update Profile for Windows10.", + "permissions":{ + "graph":{ + "delegated":{ + "read":[ + { + "name":"DeviceManagementConfiguration.Read.All" + } + ], + "update":[ + { + "name":"DeviceManagementConfiguration.ReadWrite.All" + } + ] + }, + "application":{ + "read":[ + { + "name":"DeviceManagementConfiguration.Read.All" + } + ], + "update":[ + { + "name":"DeviceManagementConfiguration.ReadWrite.All" + } + ] + } + } + } +} diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index 5aaa8340ba..f412d6b79f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -173,7 +173,7 @@ function Get-TargetResource try { $SPOSharingSettings = Get-PnPTenant -ErrorAction Stop - $MySite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.' -and $_.Template -notmatch '^RedirectSite#' } + $MySite = Get-PnPTenantSite -Filter "Url -like '-my.sharepoint.' -and Template -notlike '^RedirectSite#'" if ($null -ne $MySite) { @@ -532,7 +532,7 @@ function Set-TargetResource Set-PnPTenant @CurrentParameters | Out-Null if ($SetMySharingCapability) { - $mysite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.com/' -and $_.Template -notmatch '^RedirectSite#' } + $mysite = Get-PnPTenantSite -Filter "Url -like '-my.sharepoint.' -and Template -notlike '^RedirectSite#'" Set-PnPTenantSite -Identity $mysite.Url -SharingCapability $MySiteSharingCapability } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADActivityBasedTimeoutPolicy/1-AADActivityBasedTimeoutPolicy-Example.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADActivityBasedTimeoutPolicy/1-AADActivityBasedTimeoutPolicy-Example.ps1 index 1d915a10b4..5bcfbc9182 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADActivityBasedTimeoutPolicy/1-AADActivityBasedTimeoutPolicy-Example.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADActivityBasedTimeoutPolicy/1-AADActivityBasedTimeoutPolicy-Example.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example DisplayName = "displayName-value"; Ensure = "Present"; Id = "000000-0000-0000-0000-000000000000"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/1-Create.ps1 index c8cd6045bb..a9e23649f8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' @@ -29,12 +35,14 @@ Configuration Example RoleName = 'User Administrator' RoleMemberInfo = MSFT_MicrosoftGraphMember { - Identity = "admin@$Domain" + Identity = "admin@$TenantId" Type = "User" } } ) - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-Update.ps1 index c9f01960e9..f6e5d23508 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/2-Update.ps1 @@ -5,22 +5,28 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' Description = 'Test Description Updated' # Updated Property - Visibility = 'HiddenMembership' # Updated Property + Visibility = 'Public' MembershipRule = "(user.country -eq `"US`")" # Updated Property MembershipRuleProcessingState = 'On' MembershipType = 'Dynamic' @@ -30,12 +36,14 @@ Configuration Example RoleName = 'User Administrator' RoleMemberInfo = MSFT_MicrosoftGraphMember { - Identity = "AdeleV@$Domain" # Updated Property + Identity = "AdeleV@$TenantId" # Updated Property Type = "User" } } ) - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/3-Remove.ps1 index ae31a25232..5333b1ca40 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAdministrativeUnit/3-Remove.ps1 @@ -5,22 +5,30 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/1-Create.ps1 index 50de632034..35dc94c12f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/1-Create.ps1 @@ -6,13 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADApplication 'AADApp1' @@ -21,12 +27,12 @@ Configuration Example AvailableToOtherTenants = $false Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -51,7 +57,9 @@ Configuration Example } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/2-Update.ps1 index b61f02d26f..0c6b3e5881 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/2-Update.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADApplication 'AADApp1' @@ -21,12 +28,12 @@ Configuration Example AvailableToOtherTenants = $true # Updated Property Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -51,7 +58,9 @@ Configuration Example } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/3-Remove.ps1 index 104eed381a..d74e883bc6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADApplication/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADApplication/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/1-Create.ps1 index e2eddf1bfa..0027794f7b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example { AADAttributeSet "AADAttributeSetTest" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/2-Update.ps1 index 52b8df2775..63cad5eca2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAttributeSet/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example { AADAttributeSet "AADAttributeSetTest" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/1-Create.ps1 index 33c0004a94..7abe999a3d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test"; DisplayName = "My Context"; Ensure = "Present"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/2-Update.ps1 index 902a3e01e3..83a52bbbb7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Present"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/3-Remove.ps1 index b562f75732..e0cdad4aa2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationContextClassReference/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Absent"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationFlowPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationFlowPolicy/2-Update.ps1 index 6e8e006574..59700ac6de 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationFlowPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationFlowPolicy/2-Update.ps1 @@ -5,8 +5,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [System.Management.Automation.PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,7 +24,9 @@ Configuration Example { { AADAuthenticationFlowPolicy "AADAuthenticationFlowPolicy" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Authentication flows policy allows modification of settings related to authentication flows in AAD tenant, such as self-service sign up configuration."; DisplayName = "Authentication flows policy"; Id = "authenticationFlowsPolicy"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicy/2-Update.ps1 index 3ad69bbb1d..533b73f0bb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -35,7 +42,9 @@ Configuration Example State = 'default' } }; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/2-Update.ps1 index cd3382cfa8..55b70dc485 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/3-Remove.ps1 index 9e646afa6e..0b95b98d20 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/3-Remove.ps1 @@ -9,11 +9,18 @@ Configuration Example Node localhost { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" { @@ -27,7 +34,9 @@ Configuration Example ); IsSoftwareOathEnabled = $True; # Updated Property State = "enabled"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 index 889bee8111..1237994612 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +25,9 @@ Configuration Example AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" { AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 index cce861359c..d6696fb373 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/3-Remove.ps1 index 373788d186..f11914f361 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/3-Remove.ps1 @@ -9,17 +9,26 @@ Configuration Example Node localhost { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" { Ensure = "Absent"; Id = "Fido2"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 index 7111b8b114..437304c66e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/3-Remove.ps1 index 14b220283c..1f4ccb0a59 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Sms"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 index 808ff41034..3c9f260c3a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/3-Remove.ps1 index 055f75fc9e..8b1b8a49d5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "SoftwareOath"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/2-Update.ps1 index da062cb512..d78048db51 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DefaultLength = 9; # Updated Property DefaultLifetimeInMinutes = 60; Ensure = "Present"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/3-Remove.ps1 index 151a54bf4b..c7d0c273a8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "TemporaryAccessPass"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/3-Remove.ps1 index 859ee2321e..bb46883b2e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +24,9 @@ Configuration Example { AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Voice"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/2-Update.ps1 index 47ee911aea..9d6e307835 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -38,7 +45,9 @@ Configuration Example X509CertificateField = 'SubjectKeyIdentifier' } ); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/3-Remove.ps1 index ce1b97d528..03b284b3cf 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/3-Remove.ps1 @@ -17,7 +17,9 @@ Configuration Example { AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "X509Certificate"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/1-Create.ps1 index 41957eb493..642111df1d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +28,9 @@ Configuration Example Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/2-Update.ps1 index a7e0364755..855d6456fe 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +28,9 @@ Configuration Example Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/3-Remove.ps1 index 48c8e61ab4..8e85d6869b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationStrengthPolicy/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { DisplayName = "Example"; Ensure = "Absent"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthorizationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthorizationPolicy/2-Update.ps1 index 05d87f1232..b4c2d8453c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthorizationPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthorizationPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +39,9 @@ Configuration Example GuestUserRole = 'Guest' PermissionGrantPolicyIdsAssignedToDefaultUserRole = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 index cdd98d0524..620033193f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 index b484a00998..6fe1f8f115 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 index b1e7893a92..c00e9443c0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { DisplayName = 'Example CAP' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/2-Update.ps1 index 3123883dd3..78728b47a2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" { AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "MyXTAPPolicy"; Ensure = "Present"; IsSingleInstance = "Yes"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/2-Update.ps1 index 15e50852b7..89c3b6b506 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -96,7 +104,9 @@ Configuration Example ) } } - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; InboundTrust = MSFT_AADCrossTenantAccessPolicyInboundTrust { IsCompliantDeviceAccepted = $False diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/1-Create.ps1 index 20018ebc40..3927db26d6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -41,7 +49,9 @@ Configuration Example ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/2-Update.ps1 index d3064c63ae..5a55a7a169 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -41,7 +49,9 @@ Configuration Example ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/3-Remove.ps1 index 4598bcd52a..14fdfe863e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationPartner/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,9 @@ Configuration Example { AADCrossTenantAccessPolicyConfigurationPartner "AADCrossTenantAccessPolicyConfigurationPartner" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; PartnerTenantId = "12345-12345-12345-12345-12345"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/1-Create.ps1 index 778b2ae509..fe39b962e4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/2-Update.ps1 index 668580ab74..cb29006fa5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 index 3a8a14b1b3..89c3ef84c0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'Integration Package' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/1-Create.ps1 index 6df36bd26b..15a5b73efa 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -39,7 +47,9 @@ Configuration Example IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/2-Update.ps1 index 00c8f28c52..851d67e077 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -39,7 +47,9 @@ Configuration Example IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/3-Remove.ps1 index 747e49d08e..62b450b6b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageAssignmentPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = "External tenant"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/1-Create.ps1 index 1acbe3c12f..6fc2c28b2a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example IsExternallyVisible = $True Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/2-Update.ps1 index 30621cfbe4..c1a0688bbc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example IsExternallyVisible = $False # Updated Property Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/3-Remove.ps1 index 2507ef22a3..7f61ec18d3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalog/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'My Catalog' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/1-Create.ps1 index acfae36718..6d8b38dec1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/1-Create.ps1 @@ -6,27 +6,47 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { + AADGroup 'DependantGroup' + { + DisplayName = "MyGroup" + Description = "Microsoft DSC Group" + SecurityEnabled = $True + MailEnabled = $True + GroupTypes = @("Unified") + MailNickname = "MyGroup" + Visibility = "Private" + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $true - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "MyGroup"; + OriginSystem = "AADGroup"; + OriginId = 'MyGroup' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/2-Update.ps1 index 7cbaf4e00b..2621343088 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/2-Update.ps1 @@ -6,27 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $false # Updated Property - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "DSCGroup"; + OriginSystem = "AADGroup"; + OriginId = '849b3661-61a8-44a8-92e7-fcc91d296235' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/3-Remove.ps1 index ff7e3443b3..84e938ce40 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackageCatalogResource/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Communication site' + DisplayName = 'DSCGroup' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/1-Create.ps1 index 1d4fcd1896..5c4bd6ea36 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/1-Create.ps1 @@ -6,20 +6,27 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "this is the tenant partner"; DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -27,10 +34,12 @@ Configuration Example odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/2-Update.ps1 index 5044b39b3a..401a3757e8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/2-Update.ps1 @@ -6,20 +6,27 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "This is the tenant partner - Updated"; # Updated Property DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -27,10 +34,12 @@ Configuration Example odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/3-Remove.ps1 index cf45043c10..addb134743 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementConnectedOrganization/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = "Test Tenant - DSC"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/1-Create.ps1 index 62fb587326..f12f38c5d4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/1-Create.ps1 @@ -6,21 +6,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementRoleAssignment "AADEntitlementManagementRoleAssignment-Create" { AppScopeId = "/"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; - Principal = "John.Smith@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Catalog creator"; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/3-Remove.ps1 index c6fa5e0a91..4dab0177a9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementRoleAssignment/3-Remove.ps1 @@ -6,21 +6,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementRoleAssignment "AADEntitlementManagementRoleAssignment-Remove" { AppScopeId = "/"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; - Principal = "John.Smith@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Catalog creator"; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADExternalIdentityPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADExternalIdentityPolicy/2-Update.ps1 index d722519c05..a43b2b19b0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADExternalIdentityPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADExternalIdentityPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example { AllowDeletedIdentitiesDataRemoval = $False; AllowExternalIdentitiesToLeave = $True; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint IsSingleInstance = "Yes"; } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 index 41f8825460..243f549348 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 @@ -6,12 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { @@ -24,9 +31,11 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 index 7862017a86..827370cdcc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 @@ -6,12 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADGroup 'MyGroups' @@ -23,9 +30,11 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/3-Remove.ps1 index b51e513cf6..172dd9b7bb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example MailEnabled = $True DisplayName = "DSCGroup" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/2-Update.ps1 index de3aaa81b0..0603551a46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,11 +25,13 @@ Configuration Example AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/3-Remove.ps1 index 29cf864c51..9e61e3593b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupLifecyclePolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,11 +25,13 @@ Configuration Example AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/2-Update.ps1 index 2a901421fe..0b54e68c7a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example CustomBlockedWordsList = @("CEO", "President") PrefixSuffixNamingRequirement = "[Title]Test[Company][GroupName][Office]Redmond" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/3-Remove.ps1 index e07d6dbeeb..f2c687123a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsNamingPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/2-Update.ps1 index e0cdef430d..605e63942b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,9 @@ Configuration Example GuestUsageGuidelinesUrl = "https://contoso.com/guestusage" UsageGuidelinesUrl = "https://contoso.com/usage" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/3-Remove.ps1 index 6fc6a4be3b..bfe2f1b754 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroupsSettings/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/1-Create.ps1 index 2cfe4b2336..92dbfc2b4f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/2-Update.ps1 index 9f1b9edb57..0e487acdf6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/3-Remove.ps1 index 7020b1c2ae..9b96e7ecd8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADNamedLocationPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = "Company Network" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/1-Create.ps1 index d5b7ab71ed..dc49235c47 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/2-Update.ps1 index e7db69e5e9..c13bdd1da3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/3-Remove.ps1 index fec85868f1..ab15d63ae4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleDefinition/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read" DisplayName = "DSCRole1" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/1-Create.ps1 index 439d0b39b9..cbf4513a6b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/1-Create.ps1 @@ -14,17 +14,18 @@ Configuration Example Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/2-Update.ps1 index fbfb5574ca..5ae77143e8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/2-Update.ps1 @@ -14,17 +14,18 @@ Configuration Example Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminUpdate"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:45:44Z' # Updated Property diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/3-Remove.ps1 index 6fff4548fc..0e561e0f05 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleEligibilityScheduleRequest/3-Remove.ps1 @@ -19,11 +19,13 @@ Configuration Example AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Absent"; IsValidationOnly = $True; # Updated Property - Principal = "John.Smith@$OrganizationName"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADRoleSetting/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADRoleSetting/2-Update.ps1 index 2c6292e400..1e9654b1e7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADRoleSetting/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADRoleSetting/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -55,7 +63,9 @@ Configuration Example ExpireEligibleAssignment = "P365D"; PermanentActiveAssignmentisExpirationRequired = $False; PermanentEligibleAssignmentisExpirationRequired = $False; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = 'Present' } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADSecurityDefaults/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADSecurityDefaults/2-Update.ps1 index 8ed7979197..533abf2cc2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADSecurityDefaults/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADSecurityDefaults/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,9 @@ Configuration Example { AADSecurityDefaults 'Defaults' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Security defaults is a set of basic identity security mechanisms recommended by Microsoft. When enabled, these recommendations will be automatically enforced in your organization. Administrators and users will be better protected from common identity related attacks."; DisplayName = "Security Defaults"; IsEnabled = $False; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/1-Create.ps1 index 5d148bc5bb..0ed32092b6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/1-Create.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADServicePrincipal 'AADServicePrincipal' @@ -22,13 +29,15 @@ Configuration Example AlternativeNames = "AlternativeName1","AlternativeName2" AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/2-Update.ps1 index d50d7f231c..5a420757d0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/2-Update.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADServicePrincipal 'AADServicePrincipal' @@ -22,13 +29,15 @@ Configuration Example AlternativeNames = "AlternativeName1","AlternativeName3" # Updated Property AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/3-Remove.ps1 index 50f0db3935..db2855bc8d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADServicePrincipal/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example AppId = "AppDisplayName" DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/1-Create.ps1 index 3c4f482979..492fa74ec8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/2-Update.ps1 index 3807438f25..746b6fc3a9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/3-Remove.ps1 index fb8d39bbab..8bd1281080 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADSocialIdentityProvider/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Absent"; IdentityProviderType = "Google"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADTenantDetails/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADTenantDetails/2-Update.ps1 index 09a729a235..6a2feef2d6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADTenantDetails/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADTenantDetails/2-Update.ps1 @@ -5,10 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { param( - [System.Management.Automation.PSCredential] - $credsCredential - ) + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + [Parameter()] + [System.String] + $CertificateThumbprint + ) Import-DscResource -ModuleName Microsoft365DSC Node Localhost @@ -18,7 +26,9 @@ Configuration Example { IsSingleInstance = 'Yes' TechnicalNotificationMails = "example@contoso.com" MarketingNotificationEmails = "example@contoso.com" - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/1-Create.ps1 index 886fe687b7..017f0495ef 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/2-Update.ps1 index 729710ea27..97b05430e2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $true # Updated Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/3-Remove.ps1 index 6cc645eca1..dfdde0c981 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADTokenLifetimePolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = "PolicyDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADUser/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADUser/1-Create.ps1 index 73cdcbb24b..702b86bc25 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADUser/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADUser/1-Create.ps1 @@ -6,18 +6,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -26,7 +33,9 @@ Configuration Example Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADUser/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADUser/2-Update.ps1 index 238b7e0925..35726df3ad 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADUser/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADUser/2-Update.ps1 @@ -6,18 +6,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -26,7 +33,9 @@ Configuration Example Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADUser/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADUser/3-Remove.ps1 index 72667e151b..eeccbfd03d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADUser/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADUser/3-Remove.ps1 @@ -6,21 +6,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" DisplayName = "John J. Smith" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 index 7c28c8da3a..35653217e9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 index 189b0d02d1..70ce45e32c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,11 +24,13 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 index e255383bdd..4cd7e144ad 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,10 +24,12 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 index 51c7077886..573f1f6785 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 index 662f870958..89cebb2840 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 index 662f870958..89cebb2840 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 index 976c4867af..de2adf3521 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 index 894b0a6913..cbefaeb8cd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 index abac6145f0..245a3fe08e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { Name = "All Fabrikam ABP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 index 60b64c8834..dbd3e6b734 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 index 7c3a151850..a3bf7b3bed 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 index f8e758938b..0c9526fbfe 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Name = "HR Users" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 index bf00f6d7e7..a65fc01916 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 index 7c335a878f..b5fa497a46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 index 7c335a878f..b5fa497a46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 index 03b2094ac1..7719b443ad 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -20,9 +27,11 @@ Configuration Example Identity = "Test Rule" AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 index 622f37e92b..7ee7f30cb8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -21,9 +28,11 @@ Configuration Example Comments = "This is an updated comment." # Updated Property AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 index 24f0dc0aa5..0c9c4c4795 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example Identity = "Test Rule" AntiPhishPolicy = "Our Rule" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 index b7008e86fb..ab7fd4cecc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' @@ -21,10 +27,12 @@ Configuration Example Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 index f961e93505..e212e2d241 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' @@ -21,10 +27,12 @@ Configuration Example Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 index cc0936181d..55004b3528 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Identity = "Integration Policy" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 index 1f4d1330c5..8252000617 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example IsSingleInstance = "Yes" EnableATPForSPOTeamsODB = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 index 27c4ae4442..3178e32045 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 index c68b7a41be..1c8b81e131 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 index c68b7a41be..1c8b81e131 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 index 1d2cade88f..812f938c3f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 @@ -1,21 +1,30 @@ Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "AdeleV@$Domain" + UserName = "AdeleV@$TenantId" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 index f1e7abdcd2..2222ba8114 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 @@ -1,21 +1,30 @@ Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "AdeleV@$Domain" + UserName = "AdeleV@$TenantId" AuthenticationPolicyName = "Test Policy" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 index 388e65eab4..ad10a13dd2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +31,9 @@ Configuration Example TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'o365dsc.onmicrosoft.com' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 index 957581c0cc..6af6d9ca06 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +31,9 @@ Configuration Example TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'contoso.onmicrosoft.com' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 index 7783b26831..9e586b46df 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example { Identity = 'Contoso.com' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 index 7c5ab235ba..bd592349c6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 @@ -5,22 +5,31 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "adelev@$Domain" + OrgWideAccount = "adelev@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 index fb9414d92c..7ad404c82d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 @@ -5,22 +5,31 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "alexW@$Domain" # Updated Property + OrgWideAccount = "alexW@$TenantId" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 index 395c40d257..89068812fb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 @@ -5,22 +5,31 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "alexW@$Domain" # Updated Property + OrgWideAccount = "alexW@$TenantId" # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 index 349cd529f1..7f603155c2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 index 6bf76b701e..0573b5887e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 @@ -5,16 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCASMailboxSettings 'AdeleVCasMailboxSettings' @@ -26,7 +31,7 @@ Configuration Example ActiveSyncMailboxPolicy = 'Default' ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True - Identity = "admin@$Domain" + Identity = "admin@$TenantId" ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' @@ -47,7 +52,9 @@ Configuration Example ShowGalAsDefaultView = $True UniversalOutlookEnabled = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 index 9588fd7db3..ca2f8b3bd5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 @@ -5,15 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCalendarProcessing "CalendarProcessing" @@ -31,7 +38,6 @@ Configuration Example BookingWindowInDays = 180; BookInPolicy = @(); ConflictPercentageAllowed = 0; - Credential = $credsCredential; DeleteAttachments = $True; DeleteComments = $True; DeleteNonCalendarItems = $True; @@ -42,7 +48,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "admin@$Domain"; + Identity = "admin@$TenantId"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -53,10 +59,13 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("AlexW@$Domain"); + RequestInPolicy = @("AlexW@$TenantId"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 index 5eb5199ae4..f761117475 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 index 023a903f60..0491b8d755 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 index 42f5cf21c7..43c4f6ca3f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example Action = "AllowAccess" Identity = "Always Allow Remote PowerShell" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 index c13499914c..706cbc5855 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example IsDefault = $True; Locale = "en-US"; Name = "Canada Social Insurance Number"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 index e17823fec1..a3e4563a8d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Identity = 'US Mailboxes' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 index ce9a53e436..85487e8131 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -24,17 +30,19 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 index 06744f178c..8a76180f50 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -24,17 +30,19 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 index 5160570364..102f4f7e71 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 @@ -5,24 +5,32 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXODistributionGroup 'DemoDG' { DisplayName = "My Demo DG"; Ensure = "Absent"; Identity = "DemoDG"; Name = "DemoDG"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 index 5f427b2eaa..4dc6fae31f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 @@ -6,25 +6,34 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $True BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 index 519d24fe0a..d7ef4fafe5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 @@ -6,25 +6,34 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $False # Updated Property BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 index c37c0a7f6f..fb2afa7d60 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 @@ -6,20 +6,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { - Identity = $Domain + Identity = $TenantId Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEOPProtectionPolicyRule/1-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEOPProtectionPolicyRule/1-Update.ps1 index ab7d90c422..8bddae81bb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEOPProtectionPolicyRule/1-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEOPProtectionPolicyRule/1-Update.ps1 @@ -6,26 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEOPProtectionPolicyRule "EXOEOPProtectionPolicyRule-Strict Preset Security Policy" { - ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; - CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; Ensure = "Present"; ExceptIfRecipientDomainIs = @("sandrodev.onmicrosoft.com"); Identity = "Strict Preset Security Policy"; Name = "Strict Preset Security Policy"; Priority = 0; State = "Enabled"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 index 5f61c9a780..9f6aa65248 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 @@ -6,24 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "" Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 index 3b02fb5f8a..650fce5eb2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 @@ -6,24 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "Department -eq 'Sales'" # Updated Property Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 index b6d8b3907a..abf1735a37 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 @@ -6,20 +6,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOExternalInOutlook/1-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOExternalInOutlook/1-Update.ps1 index e8ea48e063..2a8675d8b8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOExternalInOutlook/1-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOExternalInOutlook/1-Update.ps1 @@ -6,10 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -20,7 +29,9 @@ Configuration Example AllowList = @("mobile01@contoso.onmicrosoft.com","*contoso.onmicrosoft.com","contoso.com"); Enabled = $False; Ensure = "Present"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 index 8434d79874..dda1f0448f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -23,7 +31,9 @@ Configuration Example ConditionalStateOrProvince = "Washington" IncludedRecipients = 'AllRecipients' Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 index 4e0ecce8c3..e7a91b3473 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -22,7 +30,9 @@ Configuration Example ConditionalDepartment = "Finances" # Updated Property ConditionalStateOrProvince = "Washington" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 index 9ea08ce6cf..84338f97bb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -19,7 +27,9 @@ Configuration Example { Name = "Contoso Human Resources in Washington" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 index ee0f24fd92..2e9d7b9104 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 @@ -5,16 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOGroupSettings 'TestGroup' @@ -26,7 +32,6 @@ Configuration Example AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; ConnectorsEnabled = $False; # Updated Property - Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -35,9 +40,12 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@$Domain"; + PrimarySmtpAddress = "TestGroup@$TenantId"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 index dbad190990..f70bf4847c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example IPBlockList = @() MakeDefault = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 index 28551c5cb8..e132b067fd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -56,7 +64,9 @@ Configuration Example TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 index 836aef841f..8fe8c4a1f2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -56,7 +64,9 @@ Configuration Example TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 index 3a7d7dd917..6f79c66fd0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Identity = "Integration CFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 index af70c51640..1a7fdefd4e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' @@ -21,11 +27,13 @@ Configuration Example Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $True - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 index b109c3907f..6fd3bb4513 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 @@ -5,15 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' @@ -21,11 +28,13 @@ Configuration Example Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 index 46aa815857..31ab9d7765 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -20,7 +28,9 @@ Configuration Example Identity = "Integration CFR" HostedContentFilterPolicy = "Integration CFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 index ea0c0cf6a3..8be7f94672 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 @@ -6,10 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -24,11 +33,13 @@ Configuration Example BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 0 - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 0 + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 index d5d9157e3e..c061821ca1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 @@ -6,10 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -24,11 +33,13 @@ Configuration Example BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 1 # Updated Property - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 1 # Updated Property + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 index 891b4a4be9..dbd4fc4985 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 @@ -6,10 +6,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -18,7 +27,9 @@ Configuration Example { Identity = "Integration SFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 index d9db058889..51fc37700d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 @@ -5,15 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' @@ -21,11 +28,13 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 index 15fa53328c..4d3f4ccfc7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 @@ -5,15 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' @@ -21,11 +28,13 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $False # Updated Property - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 index 261f1ffc0e..f41c0dad6c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 @@ -5,15 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 index 977cbf1eef..dd36d5a272 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -32,7 +40,9 @@ Configuration Example SimplifiedClientAccessEncryptOnlyDisabled = $True TransportDecryptionSetting = 'Mandatory' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 index e8524e45e6..1b5130ebca 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -27,7 +35,9 @@ Configuration Example SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 index 07c3c4cabd..4eeecde129 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -27,7 +35,9 @@ Configuration Example SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 index 9b30be3986..1bbebc4716 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -19,7 +27,9 @@ Configuration Example { Identity = "Integration Inbound Connector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 index 141cb1aa07..9253fea87c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -22,7 +30,9 @@ Configuration Example TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 index 0fc17035db..58cde88c62 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -22,7 +30,9 @@ Configuration Example TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 index e5c9f58607..64e271f17d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 @@ -5,12 +5,20 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -19,7 +27,9 @@ Configuration Example { Identity = "MainCloudConnector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 index b69332c585..ba195a7b50 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 @@ -6,23 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 index 1161e39a67..b34922c48e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 @@ -6,23 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $False # Updated Property - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 index fdc5d0c87e..e07203cda9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 @@ -6,21 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 index 6a804d5c63..a4814162aa 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 @@ -6,19 +6,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -28,11 +34,14 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 index d6dae3e389..e5d852bc38 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 @@ -6,19 +6,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -28,11 +34,14 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $false # Updated Property CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 index 9c00cbf291..8ec1c31117 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 @@ -6,28 +6,37 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Absent' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $false # Updated Property CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 index b58921fed5..9111f3ae5c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' @@ -20,11 +27,13 @@ Configuration Example IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 index 95cafdbc6c..77b38d9db2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 @@ -6,13 +6,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' @@ -20,11 +27,13 @@ Configuration Example IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $False # Updated Property - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 index 3a010d19d9..ec8fa0c4ab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 @@ -6,20 +6,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { IsSingleInstance = 'Yes' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 index 6dfcc36565..ca203716f0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 @@ -6,13 +6,21 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" @@ -20,7 +28,6 @@ Configuration Example AutoDeclineFutureRequestsWhenOOF = $False; AutoReplyState = "Disabled"; CreateOOFEvent = $False; - Credential = $Credscredential; DeclineAllEventsForScheduledOOF = $False; DeclineEventsForScheduledOOF = $False; DeclineMeetingMessage = ""; @@ -28,10 +35,13 @@ Configuration Example Ensure = "Present"; ExternalAudience = "All"; ExternalMessage = (New-Guid).ToString(); # Updated Property - Identity = "AdeleV@$Domain"; + Identity = "AdeleV@$TenantId"; InternalMessage = ""; OOFEventSubject = ""; StartTime = "1/22/2024 3:00:00 PM"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 index d634a068e6..43ccc54f26 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 @@ -5,27 +5,35 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxCalendarFolder "JohnCalendarFolder" { - Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "AlexW@$Domain" + ":\Calendar"; + Identity = "AlexW@$TenantId" + ":\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 index 61c3877d25..69b74017d1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 @@ -6,24 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxPermission "TestPermission" { AccessRights = @("FullAccess","ReadPermission"); - Credential = $credsCredential; Deny = $True; # Updated Property Ensure = "Present"; - Identity = "AlexW@$Domain"; + Identity = "AlexW@$TenantId"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 index 280e394098..4c6ddacc42 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,9 @@ Configuration Example ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 index 7d1ec97214..403e70bd4e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example TimeZone = 'Eastern Standard Time' Locale = 'en-US' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 index 283795ee7b..4cf53b6976 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +34,9 @@ Configuration Example QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 index 862d17b0bb..b89c6153d9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +34,9 @@ Configuration Example QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 index 22d47da26d..4513816e47 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Identity = "IntegrationMFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 index 91edbc4237..d3f49c9f89 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example Enabled = $True RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 index e36ce09244..cf6956c8f7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example Enabled = $False # Updated Property RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 index f6f2a1a2a4..21dd6ff35f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Identity = "Contoso Recipients" MalwareFilterPolicy = "IntegrationMFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 index 5be4191d19..397e0afdae 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "" - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 index d6094d3dca..a5ba2b2cbb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "Updated Description" # Updated Property - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 index 65e2e25345..fdc5733f21 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Description = "Updated Description" # Updated Property Parent = "contoso.onmicrosoft.com\MyProfileInformation" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 index 38bf4d1041..595be2b648 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AdeleV@$Domain"; + User = "AdeleV@$TenantId"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 index 9737099842..e5db422476 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AlexW@$Domain"; # Updated Property + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 index e1990e8efd..ed39214a56 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 @@ -6,22 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Absent"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AlexW@$Domain"; # Updated Property + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleEntry/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleEntry/2-Update.ps1 index 35001eaa4d..7ce9834aaf 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleEntry/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleEntry/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,9 @@ Configuration Example { EXOManagementRoleEntry "UpdateRoleEntry" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Identity = "Information Rights Management\Get-BookingMailbox" Parameters = @("ANR","RecipientTypeDetails", "ResultSize") } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 index 98b2b94373..928a2c3182 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +33,9 @@ Configuration Example SenderDescription = "Shown to senders" RetainClassificationEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 index 9054444658..a703d03058 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +33,9 @@ Configuration Example SenderDescription = "Shown to senders" RetainClassificationEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 index f02998c20b..06f81cc5d4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +28,9 @@ Configuration Example Name = "Contoso Message Classification" DisplayName = "Contoso Message Classification" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 index ae57ee981f..21345ea669 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +79,9 @@ Configuration Example UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 index 1c21d6c9cc..bf4975a901 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +79,9 @@ Configuration Example UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 index c2fe96cf2f..2ce1f7df10 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Name = "Default" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 index 67044383ae..f43fbc75b7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +34,9 @@ Configuration Example PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 index bb802a8b64..aa21a126d8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +34,9 @@ Configuration Example PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 index 25ed2cde98..6d145dcf03 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { Identity = "Contoso Marketing" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 index 01477e3204..1f38f1cf71 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example DiffRetentionPeriod = "30" IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 index 9957b25583..b348a917bd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example DiffRetentionPeriod = "60" # Updated Property IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 index d8927dce08..4ccf776009 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +31,9 @@ Configuration Example DiffRetentionPeriod = "30" IsDefault = $true Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 index 98ed5fd428..0265f9ecb7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +33,9 @@ Configuration Example OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DependsOn = "[EXOOutboundConnector]OutboundDependency" } EXOOutboundConnector 'OutboundDependency' @@ -45,7 +54,9 @@ Configuration Example TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 index da8b029d11..ae98967657 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,7 +33,9 @@ Configuration Example OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 index ca38670405..a563275b98 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' { Identity = 'Contoso' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 index 522bc5728d..9e3efddb88 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -77,7 +85,9 @@ Configuration Example AutoExpandingArchive = $null ConnectorsEnabledForSharepoint = $True ReadTrackingEnabled = $False - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 index 0692bc9687..eb785fc035 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +38,9 @@ Configuration Example TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 index 36971ac851..d932c5add7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +38,9 @@ Configuration Example TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 index 8a554c5e2a..f228c8a367 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "Contoso" Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 index 503f87c410..b6858bf0d4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +38,9 @@ Configuration Example TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 index a9841310b1..8615711515 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { Identity = "Contoso Outbound Connector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 index 1a725a4c29..ded9e80b7c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -90,7 +98,9 @@ Configuration Example WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 index b6fe6ee87d..da5504540d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -90,7 +98,9 @@ Configuration Example WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 index c443618a36..bcf39e06ca 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Integration" - Ensure = "Absent" - Credential = $Credscredential + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 index f90d243abe..0fd1c4d508 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example AcceptSecurityIdentifierInformation = $true Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 index bf09619125..507ca3e22a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example AcceptSecurityIdentifierInformation = $False # Updated Property Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 index 2cb2adb985..cbe2540c49 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "HRApp" ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 index 7a7f729945..1fbd49354c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example IsSingleInstance = 'Yes' #GatewayIPAddresses = '123.0.0.1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 index 48d306104b..f21314507f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 @@ -5,16 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -22,10 +28,12 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 index b84d5cc320..77b66903df 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 @@ -5,16 +5,22 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -22,10 +28,12 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 16; # Updated Property City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 index 51ad933226..e0bebcd71f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 @@ -5,25 +5,33 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' { AudioDeviceName = "MyAudioDevice"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Absent' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 index 1c948d9891..c9a91ead2b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy." Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 index 1d23f23daf..93082f33a6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 index aae3186d10..02e6b6be47 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 index 3acd8f9215..7789a50846 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 @@ -6,23 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 index 6c5a45c055..f7af4ec63d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 @@ -6,23 +6,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $True; # Updated Property - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 index bc6b68e50e..618b4765b6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 @@ -6,21 +6,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/1-Create.ps1 index 6b6c1e6190..2cbd1875a1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/1-Create.ps1 @@ -6,25 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXORecipientPermission 'AddSendAs' { - Identity = "AlexW@$Domain" - Trustee = "admin@$Domain" + Identity = "AlexW@$TenantId" + Trustee = "admin@$TenantId" AccessRights = 'SendAs' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/3-Remove.ps1 index f263aba8e4..aa641ed3d6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORecipientPermission/3-Remove.ps1 @@ -6,25 +6,33 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXORecipientPermission 'AddSendAs' { Identity = 'AdeleV@$Domain' - Trustee = "admin@$Domain" + Trustee = "admin@$TenantId" Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 index 885d097448..0dd12c6582 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 index 109dc72855..177d22a79e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 index 2ec3881cd3..f93b8948a6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { Identity = "Integration" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 index 1698bb7de0..cff345b769 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,9 @@ Configuration Example ReportNotJunkToCustomizedAddress = $False ReportPhishToCustomizedAddress = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 index e1af0e2270..6d481f56c3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Comments = "This is my default rule" SentTo = "submission@contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 index fe354bf120..6ae6532390 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +28,9 @@ Configuration Example IsSingleInstance = 'Yes' ResourcePropertySchema = @('Room/TV', 'Equipment/Laptop') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 index e4ac25a96a..5a3f329211 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 index b9166d8e45..1d31511746 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 index f00c24b593..731d592310 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example IsDefault = $False # Updated Property Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 index 294bbdbcd6..ceafa9e939 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 index e8546060e8..33c9e16eec 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 index b897864cc5..c0469a418f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +28,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 index d670be256a..4fc1c58b57 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -21,9 +27,11 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 index 2caf85bed1..890d96c026 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -21,9 +27,11 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $False # Updated Property Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 index fb3378fa92..4ba99a10e3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -21,7 +27,9 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $False # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 index 255584dbd0..bb437f44bf 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' @@ -21,11 +27,13 @@ Configuration Example Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 index 6aa8a4a02b..a2042efcf4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' @@ -21,11 +27,13 @@ Configuration Example Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 index 3ba7d01996..ffe83d1011 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +30,9 @@ Configuration Example SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 index 1d27ca318e..7475a9b249 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +32,9 @@ Configuration Example EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 index ae083d94a0..8287e9535d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +32,9 @@ Configuration Example EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 index f8659eed81..528025c8da 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +26,9 @@ Configuration Example { Identity = 'Marketing Block URL' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 index f89887d86b..8054082be5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeLinksRule 'ConfigureSafeLinksRule' @@ -21,11 +27,13 @@ Configuration Example Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 index c86aa8e09a..0dcd44efe7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 @@ -5,15 +5,21 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeLinksRule 'ConfigureSafeLinksRule' @@ -21,11 +27,13 @@ Configuration Example Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 index 12fe46f671..d4df9b8b6a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +29,9 @@ Configuration Example Enabled = $False # Updated Property SafeLinksPolicy = "Marketing Block URL" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 index 83fac8d5ff..343b9c4f2c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 @@ -6,23 +6,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 index addaba121b..a3f84afc8e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 @@ -6,23 +6,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain", "IntegrationSM2@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 index 90388f70c4..ac6ca975fe 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 @@ -6,23 +6,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain", "IntegrationSM2@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") Alias = "IntegrationSM" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 index ddce10e578..d9445ad3b8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 index 5f08c125a7..49ac1ddfef 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 index 54a8e868f4..6fc0e9f414 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 index 839f40fe2e..5c1a594b46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -38,7 +46,9 @@ Configuration Example ReplyAllStormProtectionEnabled = $True; Rfc2231EncodingEnabled = $False; SmtpClientAuthenticationDisabled = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 index 3fb7c0a9fe..37775a8752 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 @@ -5,28 +5,36 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 index ebec921bdd..6446633aa2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 @@ -5,28 +5,36 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 index 5c40c4a7b7..3d4be5d308 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 @@ -5,11 +5,18 @@ It is not meant to use as a production baseline. Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +27,9 @@ Configuration Example Name = "Ethical Wall - Sales and Brokerage Departments" Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/1-Create.ps1 index 5016ae60aa..77df24981a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -39,7 +47,9 @@ Configuration Example UntrustedExecutableType = 'block' UntrustedUSBProcessType = 'block' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/2-Update.ps1 index 67a96b5a2d..b2672e9a60 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -39,7 +47,9 @@ Configuration Example UntrustedExecutableType = 'block' UntrustedUSBProcessType = 'block' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/3-Remove.ps1 index 79762a0115..7129877c13 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneASRRulesPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/1-Create.ps1 index f31995576a..0e1d844cfc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,6 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -30,6 +37,9 @@ Configuration Example PasswordAgeDays_AAD = 10; AdministratorAccountName = "Administrator"; PasswordAgeDays = 20; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/2-Update.ps1 index 15e2b607fa..08d2c88584 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,6 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -30,6 +37,9 @@ Configuration Example PasswordAgeDays_AAD = 15; # Updated Property AdministratorAccountName = "Administrator"; PasswordAgeDays = 20; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/3-Remove.ps1 index b9641cf809..b8b92fc2b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/1-Create.ps1 index d605f3441a..03ace9c122 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,6 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalUserGroupMembershipPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -34,6 +41,9 @@ Configuration Example UserSelectionType = 'users' } ); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/2-Update.ps1 index e906680eeb..38f5885a24 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,6 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @(); # Updated Property LocalUserGroupCollection = @( MSFT_IntuneAccountProtectionLocalUserGroupCollection{ @@ -29,6 +36,9 @@ Configuration Example UserSelectionType = 'users' } ); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/3-Remove.ps1 index 6e029e0525..10792722c4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionLocalUserGroupMembershipPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/1-Create.ps1 index cb6919ab1d..b7dba4f998 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example PinMinimumLength = 5 PinSpecialCharactersUsage = 'required' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/2-Update.ps1 index f87d9a4e39..0a0d2c13a6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example PinMinimumLength = 10 # Updated Property PinSpecialCharactersUsage = 'required' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/3-Remove.ps1 index 0a1cbf862a..8bf79c59a7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAccountProtectionPolicy/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/1-Create.ps1 index cd613829c1..a4daa9a4d3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,9 @@ Configuration Example excludedprocesses = @('processes.exe', 'process2.exe') templateId = '45fea5e9-280d-4da1-9792-fb5736da0ca9_1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/2-Update.ps1 index b5ed0d3091..c8517066ac 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,9 @@ Configuration Example excludedprocesses = @('processes.exe', 'process3.exe') # Updated Property templateId = '45fea5e9-280d-4da1-9792-fb5736da0ca9_1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/3-Remove.ps1 index 7a5f368d52..d6834c0760 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAntivirusPolicyWindows10SettingCatalog/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'av exclusions' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/1-Create.ps1 index 242be648ef..dd2a4f4c38 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,7 +23,6 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Assignments = @(); Description = ""; DisplayName = "Example"; @@ -28,7 +35,9 @@ Configuration Example ProfileApplicability = "default" RoleScopeTagIds = @("0"); TargetedMobileApps = @("<Mobile App Id>"); - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/2-Update.ps1 index cbd15f84df..5eafde868b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/2-Update.ps1 @@ -5,9 +5,17 @@ This example updates an App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,7 +23,6 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Assignments = @(); Description = ""; DisplayName = "Example"; @@ -33,7 +40,9 @@ Configuration Example ProfileApplicability = "default" RoleScopeTagIds = @("0"); TargetedMobileApps = @("<Mobile App Id>"); - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/3-Remove.ps1 index 5708b7ccaa..4823b2fba9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationDevicePolicy/3-Remove.ps1 @@ -5,9 +5,17 @@ This example deletes a new App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,12 +23,13 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Description = ""; DisplayName = "Example"; Ensure = "Present"; Id = "0000000-0000-0000-0000-000000000000"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/1-Create.ps1 index 7c8fee9252..ecf567a613 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,6 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; CustomSettings = @( MSFT_IntuneAppConfigurationPolicyCustomSetting { name = 'com.microsoft.intune.mam.managedbrowser.BlockListURLs' @@ -32,6 +39,9 @@ Configuration Example value = 'TestValue' }); Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/2-Update.ps1 index 507f2bf9e6..29e2368f3f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,6 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; CustomSettings = @( MSFT_IntuneAppConfigurationPolicyCustomSetting { name = 'com.microsoft.intune.mam.managedbrowser.BlockListURLs' @@ -32,6 +39,9 @@ Configuration Example value = 'TestValue2' }); Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/3-Remove.ps1 index 8aa3e4a095..8edabb57e8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppConfigurationPolicy/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,8 +25,10 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/1-Create.ps1 index 4f7c3a599e..e0d31586a6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/1-Create.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -38,8 +46,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/2-Update.ps1 index 5dc2dc577e..0049ed0dc4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/2-Update.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -38,8 +46,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/3-Remove.ps1 index 3fe178f97e..da421d7845 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyAndroid/3-Remove.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,8 +27,9 @@ Configuration Example { DisplayName = 'My DSC Android App Protection Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/1-Create.ps1 index 15053df200..ca06406fa0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -40,7 +48,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/2-Update.ps1 index 0ef59acb4d..7d75207738 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -40,7 +48,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/3-Remove.ps1 index 10acdf5fcc..c824f0d587 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAppProtectionPolicyiOS/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'My DSC iOS App Protection Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/1-Create.ps1 index 4a504be881..dd2cd24682 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/1-Create.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example SmartScreenBlockOverrideForFiles = $True SmartScreenEnableInShell = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/2-Update.ps1 index ad867e1f8e..cf7bc67969 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/2-Update.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,9 @@ Configuration Example SmartScreenBlockOverrideForFiles = $False # Updated Property SmartScreenEnableInShell = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/3-Remove.ps1 index 5626780281..9d1f24d995 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneApplicationControlPolicyWindows10/3-Remove.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example DisplayName = 'Windows 10 Desktops' Description = 'All windows 10 Desktops' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/1-Create.ps1 index a64d1cfb86..7f7d173c2f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example blockadobereaderfromcreatingchildprocesses = "block"; Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/2-Update.ps1 index f11d5e17b6..2a5f84b0d1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example blockadobereaderfromcreatingchildprocesses = "audit"; # Updated Property Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/3-Remove.ps1 index bbe506c085..52a1e66949 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'asr ConfigMgr' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/1-Create.ps1 index f516d49d5a..0b9cb7c788 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Platform = 'windows10AndLater' Rule = "(device.manufacturer -ne `"Microsoft Corporation`")" Ensure = 'Present' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/2-Update.ps1 index 7be28ee342..3fad2059c4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Platform = 'windows10AndLater' Rule = "(device.manufacturer -ne `"Apple`")" # Updated Property Ensure = 'Present' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/3-Remove.ps1 index 5612fd7a89..55cc25c980 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceAndAppManagementAssignmentFilter/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Test Device Filter' Ensure = 'Absent' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/1-Create.ps1 index 2391ba3dbb..844247dc1c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example DisplayName = 'Contoso' Description = 'Contoso Category' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/2-Update.ps1 index aa53f77ea0..82837af478 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example DisplayName = 'Contoso' Description = 'Contoso Category - Updated' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/3-Remove.ps1 index 3e865eee3d..05ff70c359 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCategory/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Contoso' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCleanupRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCleanupRule/2-Update.ps1 index 7c6d1efcab..ab047ef706 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCleanupRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCleanupRule/2-Update.ps1 @@ -5,9 +5,17 @@ This example sets the device cleanup rule. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example IsSingleInstance = 'Yes' DeviceInactivityBeforeRetirementInDays = 25 # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/1-Create.ps1 index edcbd51b34..b80c15280e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/2-Update.ps1 index f4d3747b63..d847a28b59 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/3-Remove.ps1 index 61b4cc1c6c..472667c057 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroid/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Test Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/1-Create.ps1 index 11979ab4cc..d6e684b87a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/1-Create.ps1 @@ -6,9 +6,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -34,7 +42,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/2-Update.ps1 index 2f64930499..e68a0d474b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/2-Update.ps1 @@ -6,9 +6,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -34,7 +42,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/3-Remove.ps1 index 2f64930499..e68a0d474b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidDeviceOwner/3-Remove.ps1 @@ -6,9 +6,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -34,7 +42,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/1-Create.ps1 index 721bf09c18..1dfba52a5f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -35,7 +43,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/2-Update.ps1 index 8983fda0ae..4f79454cc1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -35,7 +43,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/3-Remove.ps1 index 45ef8ccd64..2084845d6a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyAndroidWorkProfile/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Test Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/1-Create.ps1 index cc9361ae1e..98e6353fef 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -35,7 +43,9 @@ Configuration Example FirewallBlockAllIncoming = $False FirewallEnableStealthMode = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/2-Update.ps1 index 7786b78f0d..e5cea3ce3a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -35,7 +43,9 @@ Configuration Example FirewallBlockAllIncoming = $False FirewallEnableStealthMode = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/3-Remove.ps1 index bbe0504255..a1562eaa09 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyMacOS/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'MacOS DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/1-Create.ps1 index 501eaa58a8..344e052090 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -50,7 +58,9 @@ Configuration Example deviceCompliancePolicyScript = $null ValidOperatingSystemBuildRanges = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/2-Update.ps1 index abce742bfa..30d096f81b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -50,7 +58,9 @@ Configuration Example deviceCompliancePolicyScript = $null ValidOperatingSystemBuildRanges = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/3-Remove.ps1 index c6c84570a1..990b8591a9 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyWindows10/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Windows 10 DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/1-Create.ps1 index 85f3c3138a..2133fc7a5b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,8 +40,9 @@ Configuration Example DeviceThreatProtectionRequiredSecurityLevel = 'medium' ManagedEmailProfileRequired = $True Ensure = 'Present' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/2-Update.ps1 index 8333ab35fd..94d276f04a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,8 +40,9 @@ Configuration Example DeviceThreatProtectionRequiredSecurityLevel = 'medium' ManagedEmailProfileRequired = $True Ensure = 'Present' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/3-Remove.ps1 index f7be9cf102..8081fbd87c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceCompliancePolicyiOs/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,8 +25,9 @@ Configuration Example { DisplayName = 'Test iOS Device Compliance Policy' Ensure = 'Absent' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/1-Create.ps1 index 787552def1..ebfd8924b7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,6 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments { @@ -138,6 +145,9 @@ Configuration Example DisplayName = 'admin template' Ensure = 'Present' PolicyConfigurationIngestionType = 'unknown' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/2-Update.ps1 index cc9e0d0351..95516649f5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,6 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments { @@ -138,6 +145,9 @@ Configuration Example DisplayName = 'admin template' Ensure = 'Present' PolicyConfigurationIngestionType = 'builtIn' # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/3-Remove.ps1 index 1ff95ebdc0..7122d08033 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential DisplayName = 'admin template' Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/1-Create.ps1 index 2d6f33b948..d8f011747e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; OmaSettings = @( @@ -46,6 +53,9 @@ Configuration Example } ); SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/2-Update.ps1 index 17cdb1f91a..945f22f9be 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; OmaSettings = @( @@ -46,6 +53,9 @@ Configuration Example } ); SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/3-Remove.ps1 index 5107baec1a..f0a20c0853 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationCustomPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationCustomPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/1-Create.ps1 index 100f2e2314..a924a24b2d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -26,10 +34,12 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; EnableExpeditedTelemetryReporting = $True; Ensure = "Present"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/2-Update.ps1 index 22fbce100e..2d3996726b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,10 +33,12 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; EnableExpeditedTelemetryReporting = $True; Ensure = "Present"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/3-Remove.ps1 index 056a65caad..5276884dc6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/1-Create.ps1 index ac9c07730a..fd1fc21f94 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,6 @@ Configuration Example CacheServerBackgroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerForegroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerHostNames = @("domain.com"); - Credential = $Credscredential; DeliveryOptimizationMode = "httpWithPeeringPrivateGroup"; DisplayName = "delivery optimisation"; Ensure = "Present"; @@ -53,6 +60,9 @@ Configuration Example RestrictPeerSelectionBy = "subnetMask"; SupportsScopeTags = $True; VpnPeerCaching = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/2-Update.ps1 index c8c69c7148..3d9c8a6d9c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,6 @@ Configuration Example CacheServerBackgroundDownloadFallbackToHttpDelayInSeconds = 5; # Updated Property CacheServerForegroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerHostNames = @("domain.com"); - Credential = $Credscredential; DeliveryOptimizationMode = "httpWithPeeringPrivateGroup"; DisplayName = "delivery optimisation"; Ensure = "Present"; @@ -53,6 +60,9 @@ Configuration Example RestrictPeerSelectionBy = "subnetMask"; SupportsScopeTags = $True; VpnPeerCaching = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/3-Remove.ps1 index d277c6761d..7ba96d2ccc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "delivery optimisation"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/1-Create.ps1 index 4b49df8514..30695840ec 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,11 +33,13 @@ Configuration Example ); ComputerNameStaticPrefix = "WK-"; ComputerNameSuffixRandomCharCount = 12; - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Present"; OrganizationalUnit = "OU=workstation,CN=domain,CN=com"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/2-Update.ps1 index 26a5dea8fd..13cee6a023 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,11 +33,13 @@ Configuration Example ); ComputerNameStaticPrefix = "WK-"; ComputerNameSuffixRandomCharCount = 12; - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Present"; OrganizationalUnit = "OU=workstation,CN=domain,CN=com"; SupportsScopeTags = $False; # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/3-Remove.ps1 index 822310ada5..4a731c678d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationDomainJoinPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationDomainJoinPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/1-Create.ps1 index efa6cec816..573b0e5874 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "email"; DurationOfEmailToSync = "unlimited"; EmailAddressSource = "primarySmtpAddress"; @@ -34,6 +41,9 @@ Configuration Example SyncCalendar = $True; SyncContacts = $True; SyncTasks = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/2-Update.ps1 index 950e073302..61fcb29fe0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,7 +31,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "email"; DurationOfEmailToSync = "unlimited"; EmailAddressSource = "primarySmtpAddress"; @@ -34,6 +41,9 @@ Configuration Example SyncCalendar = $True; SyncContacts = $True; SyncTasks = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/3-Remove.ps1 index 139573027a..a870b91ad3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEmailProfilePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationEmailProfilePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "email"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/1-Create.ps1 index 54d23472ea..917e26ab44 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -79,7 +87,6 @@ Configuration Example StartupAuthenticationTpmKeyUsage = 'allowed' StartupAuthenticationBlockWithoutTpmChip = $False }; - Credential = $Credscredential; DefenderAdditionalGuardedFolders = @(); DefenderAdobeReaderLaunchChildProcess = "notConfigured"; DefenderAdvancedRansomewareProtectionType = "notConfigured"; @@ -241,6 +248,9 @@ Configuration Example XboxServicesLiveAuthManagerServiceStartupMode = "manual"; XboxServicesLiveGameSaveServiceStartupMode = "manual"; XboxServicesLiveNetworkingServiceStartupMode = "manual"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/2-Update.ps1 index c1974f6b26..27f4d9db02 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -79,7 +87,6 @@ Configuration Example StartupAuthenticationTpmKeyUsage = 'allowed' StartupAuthenticationBlockWithoutTpmChip = $False }; - Credential = $Credscredential; DefenderAdditionalGuardedFolders = @(); DefenderAdobeReaderLaunchChildProcess = "notConfigured"; DefenderAdvancedRansomewareProtectionType = "notConfigured"; @@ -241,6 +248,9 @@ Configuration Example XboxServicesLiveAuthManagerServiceStartupMode = "manual"; XboxServicesLiveGameSaveServiceStartupMode = "manual"; XboxServicesLiveNetworkingServiceStartupMode = "manual"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/3-Remove.ps1 index 2bd05a7edd..7910d8c682 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,8 +25,10 @@ Configuration Example IntuneDeviceConfigurationEndpointProtectionPolicyWindows10 'Example' { DisplayName = "endpoint protection legacy - dsc v2.0"; - Credential = $Credscredential; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/1-Create.ps1 index 3752103cac..d771035f63 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,6 @@ Configuration Example BootFromExternalMedia = "notConfigured"; Cameras = "enabled"; ChangeUefiSettingsPermission = "notConfiguredOnly"; - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Present"; FrontCamera = "enabled"; @@ -47,6 +54,9 @@ Configuration Example WiFi = "notConfigured"; WindowsPlatformBinaryTable = "enabled"; WirelessWideAreaNetwork = "notConfigured"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/2-Update.ps1 index 8cd74170a9..d74cbce780 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,6 @@ Configuration Example BootFromExternalMedia = "notConfigured"; Cameras = "enabled"; # Updated Property ChangeUefiSettingsPermission = "notConfiguredOnly"; - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Present"; FrontCamera = "enabled"; @@ -47,6 +54,9 @@ Configuration Example WiFi = "notConfigured"; WindowsPlatformBinaryTable = "enabled"; WirelessWideAreaNetwork = "notConfigured"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/3-Remove.ps1 index add44ac809..2393e41d5a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/1-Create.ps1 index 4c03d36315..8b7685ebab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,10 +32,12 @@ Configuration Example } ); ConfigDeviceHealthMonitoringScope = @("bootPerformance","windowsUpdates"); - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Present"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/2-Update.ps1 index bb30703c2c..56db5bb57e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,10 +32,12 @@ Configuration Example } ); ConfigDeviceHealthMonitoringScope = @("bootPerformance","windowsUpdates"); - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Present"; SupportsScopeTags = $False; # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/3-Remove.ps1 index 16c309c95b..acf7c8df82 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/1-Create.ps1 index c46b71ab56..53710e648b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "identity protection"; EnhancedAntiSpoofingForFacialFeaturesEnabled = $True; Ensure = "Present"; @@ -40,6 +47,9 @@ Configuration Example UseCertificatesForOnPremisesAuthEnabled = $True; UseSecurityKeyForSignin = $True; WindowsHelloForBusinessBlocked = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/2-Update.ps1 index 63fc645723..ce8fe9037f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "identity protection"; EnhancedAntiSpoofingForFacialFeaturesEnabled = $True; Ensure = "Present"; @@ -40,6 +47,9 @@ Configuration Example UseCertificatesForOnPremisesAuthEnabled = $True; UseSecurityKeyForSignin = $True; WindowsHelloForBusinessBlocked = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/3-Remove.ps1 index a888e787f9..426d4cc30c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationIdentityProtectionPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "identity protection"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/1-Create.ps1 index 29b160b437..72500c3878 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,6 @@ Configuration Example ); CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 1; - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Present"; IntendedPurpose = "unassigned"; @@ -32,6 +39,9 @@ Configuration Example RenewalThresholdPercentage = 50; SubjectAlternativeNameType = "emailAddress"; SubjectNameFormat = "commonName"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/2-Update.ps1 index 6c1ec6759e..012f09759f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,6 @@ Configuration Example ); CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 1; - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Present"; IntendedPurpose = "unassigned"; @@ -32,6 +39,9 @@ Configuration Example RenewalThresholdPercentage = 60; # Updated Property SubjectAlternativeNameType = "emailAddress"; SubjectNameFormat = "commonName"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/3-Remove.ps1 index 77bb7e16ae..2a932fccdc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/1-Create.ps1 index 0de1951bf4..bbe1a6a835 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "kiosk"; EdgeKioskEnablePublicBrowsing = $False; Ensure = "Present"; @@ -62,6 +69,9 @@ Configuration Example Recurrence = 'daily' DayofWeek = 'sunday' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/2-Update.ps1 index 6806ed767b..941e54fdf1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "kiosk"; EdgeKioskEnablePublicBrowsing = $False; # Updated Property Ensure = "Present"; @@ -62,6 +69,9 @@ Configuration Example Recurrence = 'daily' DayofWeek = 'sunday' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/3-Remove.ps1 index 80a6d10ec1..7302ec0274 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationKioskPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationKioskPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "kiosk"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/1-Create.ps1 index 50f6bc80dc..f788c8187f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Present"; SupportsScopeTags = $True; @@ -41,6 +48,9 @@ Configuration Example ) NeutralDomainResources = @() }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/2-Update.ps1 index caa6db6a07..11c361adeb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Present"; SupportsScopeTags = $False; # Updated Property @@ -41,6 +48,9 @@ Configuration Example ) NeutralDomainResources = @() }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/3-Remove.ps1 index 4629ee0d8e..b0d796b637 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/1-Create.ps1 index 122e22534c..7c84bdae93 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,6 @@ Configuration Example CertificateValidityPeriodValue = 1; CertificationAuthority = "CA=Name"; CertificationAuthorityName = "Test"; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -42,6 +49,9 @@ Configuration Example SubjectAlternativeNameType = "none"; SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/2-Update.ps1 index 408d3012ff..7a2e8c07d0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,6 @@ Configuration Example CertificateValidityPeriodValue = 1; CertificationAuthority = "CA=Name"; CertificationAuthorityName = "Test"; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -42,6 +49,9 @@ Configuration Example SubjectAlternativeNameType = "none"; SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/3-Remove.ps1 index 2c442218c4..08e2fb36e8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationPkcsCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "PKCS"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/1-Create.ps1 index 76b273ad8c..164362b435 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; BlockExecutionNotifications = $False; @@ -34,7 +41,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAsAccount = "user"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/2-Update.ps1 index f3708d3311..b1b9e2c421 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; BlockExecutionNotifications = $False; @@ -34,7 +41,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAsAccount = "user"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/3-Remove.ps1 index 4b210f57a4..5ca16398b7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptMacOS/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,10 +24,12 @@ Configuration Example { IntuneDeviceConfigurationPlatformScriptMacOS 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; Id = "00000000-0000-0000-0000-000000000000"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/1-Create.ps1 index b5775736dd..3aefc20441 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; EnforceSignatureCheck = $False; @@ -31,7 +38,9 @@ Configuration Example RunAs32Bit = $True; RunAsAccount = "system"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/2-Update.ps1 index 6498d54c6e..df23106133 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; EnforceSignatureCheck = $False; @@ -31,7 +38,9 @@ Configuration Example RunAs32Bit = $False; # Updated property RunAsAccount = "system"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/3-Remove.ps1 index d3933101bc..aa9af00cfc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPlatformScriptWindows/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,11 +24,12 @@ Configuration Example { IntuneDeviceConfigurationPlatformScriptWindows 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; Id = "00000000-0000-0000-0000-000000000000"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 index 046eae0b0f..6941737462 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -72,7 +80,9 @@ Configuration Example WebBrowserCookieSettings = 'allowAlways' WiFiBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 index 6ada58e52e..601c917715 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -72,7 +80,9 @@ Configuration Example WebBrowserCookieSettings = 'allowAlways' WiFiBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 index 441167a739..3f0ec44dd3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'Android device admin' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/1-Create.ps1 index b75191c8fb..49dcc36d58 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -58,7 +66,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfilePasswordRequireUnlock = 'deviceDefault' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/2-Update.ps1 index 854e05e7d9..d02e2f0311 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -58,7 +66,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfilePasswordRequireUnlock = 'deviceDefault' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/3-Remove.ps1 index 3c1e951844..8caded1819 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidDeviceOwner/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'general confi - AndroidDeviceOwner' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 index e18d649060..3ce8a77ee0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,9 @@ Configuration Example ScreenCaptureBlocked = $True StorageBlockExternalMedia = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 index 184ed1705e..f7494f93b0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,9 @@ Configuration Example ScreenCaptureBlocked = $True StorageBlockExternalMedia = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 index 5c16fc6b49..69be23ea8a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'aosp' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/1-Create.ps1 index 561b2a1196..5d837fe217 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfileRequirePassword = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/2-Update.ps1 index cf2bbd792e..c9b6d85215 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfileRequirePassword = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/3-Remove.ps1 index b019a1a657..91a5b0ed71 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyAndroidWorkProfile/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'Android Work Profile - Device Restrictions - Standard' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/1-Create.ps1 index b6234b3b22..eb2695e635 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +117,9 @@ Configuration Example UpdateDelayPolicy = @('delayOSUpdateVisibility', 'delayAppUpdateVisibility', 'delayMajorOsUpdateVisibility') WallpaperModificationBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/2-Update.ps1 index d52aa87392..60fab32746 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +117,9 @@ Configuration Example UpdateDelayPolicy = @('delayOSUpdateVisibility', 'delayAppUpdateVisibility', 'delayMajorOsUpdateVisibility') WallpaperModificationBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/3-Remove.ps1 index b2e3b21362..46daa4d5b2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyMacOS/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'MacOS device restriction' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/1-Create.ps1 index 940cc63a3f..c8e9be6cc7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -47,7 +55,6 @@ Configuration Example ConnectedDevicesServiceBlocked = $False; CopyPasteBlocked = $False; CortanaBlocked = $False; - Credential = $Credscredential; CryptographyAllowFipsAlgorithmPolicy = $False; DefenderBlockEndUserAccess = $False; DefenderBlockOnAccessProtection = $False; @@ -267,6 +274,9 @@ Configuration Example WirelessDisplayBlockProjectionToThisDevice = $False; WirelessDisplayBlockUserInputFromReceiver = $False; WirelessDisplayRequirePinForPairing = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/2-Update.ps1 index e9f0b4b8b2..e31803d2db 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -47,7 +55,6 @@ Configuration Example ConnectedDevicesServiceBlocked = $False; CopyPasteBlocked = $False; CortanaBlocked = $False; - Credential = $Credscredential; CryptographyAllowFipsAlgorithmPolicy = $False; DefenderBlockEndUserAccess = $False; DefenderBlockOnAccessProtection = $False; @@ -267,6 +274,9 @@ Configuration Example WirelessDisplayBlockProjectionToThisDevice = $False; WirelessDisplayBlockUserInputFromReceiver = $False; WirelessDisplayRequirePinForPairing = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/3-Remove.ps1 index 1d793d1f51..2e4255c5c6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "device config"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/1-Create.ps1 index 0ae05c68c6..6a418b2d10 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -124,7 +132,9 @@ Configuration Example VoiceDialingBlocked = $False WallpaperBlockModification = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/2-Update.ps1 index 4b06a5591f..e381f1a619 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -124,7 +132,9 @@ Configuration Example VoiceDialingBlocked = $False WallpaperBlockModification = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/3-Remove.ps1 index 99663148fb..a2870509c6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationPolicyiOS/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'iOS DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/1-Create.ps1 index ea3febcd48..5cfb8a300d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,6 @@ Configuration Example CertificateStore = "user"; CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 5; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -50,6 +57,9 @@ Configuration Example SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; RootCertificateId = "169bf4fc-5914-40f4-ad33-48c225396183"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/2-Update.ps1 index 93e40032e6..6118051422 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,6 @@ Configuration Example CertificateStore = "user"; CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 5; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -50,6 +57,9 @@ Configuration Example SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; RootCertificateId = "169bf4fc-5914-40f4-ad33-48c225396183"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/3-Remove.ps1 index 721d61cff3..2f11dacb38 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSCEPCertificatePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationScepCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "SCEP"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/1-Create.ps1 index 8f0c070dfb..4f1a94ea55 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,11 +36,13 @@ Configuration Example ); ConfigurationAccount = "user@domain.com"; ConfigurationAccountType = "azureADAccount"; - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Present"; LaunchUri = "https://assessment.domain.com"; LocalGuestAccountName = ""; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/2-Update.ps1 index 59132497d7..7b380c8847 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,11 +36,13 @@ Configuration Example ); ConfigurationAccount = "user@domain.com"; ConfigurationAccountType = "azureADAccount"; - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Present"; LaunchUri = "https://assessment.domain.com"; LocalGuestAccountName = ""; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/3-Remove.ps1 index 3c86881b4c..5d7b079159 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationSecureAssessmentPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/1-Create.ps1 index 61caf9f43e..dad601fefb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisableAccountManager = $False; DisableEduPolicies = $False; DisablePowerPolicies = $False; @@ -45,6 +52,9 @@ Configuration Example SetEduPolicies = "enabled"; SetPowerPolicies = "enabled"; SignInOnResume = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/2-Update.ps1 index c92efad921..0a67b952e5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisableAccountManager = $False; DisableEduPolicies = $False; DisablePowerPolicies = $False; @@ -45,6 +52,9 @@ Configuration Example SetEduPolicies = "enabled"; SetPowerPolicies = "enabled"; SignInOnResume = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/3-Remove.ps1 index bf6778fad4..7c37541796 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Shared Multi device"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/1-Create.ps1 index f074cf9c75..5ad9d1de72 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,11 +31,13 @@ Configuration Example } ); CertFileName = "RootCA.cer"; - Credential = $Credscredential; DestinationStore = "computerCertStoreRoot"; DisplayName = "Trusted Cert"; Ensure = "Present"; TrustedRootCertificate = "MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA="; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/2-Update.ps1 index 9572a0909d..e35ae2acd5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -23,11 +31,13 @@ Configuration Example } ); CertFileName = "RootNew.cer"; # Updated Property - Credential = $Credscredential; DestinationStore = "computerCertStoreRoot"; DisplayName = "Trusted Cert"; Ensure = "Present"; TrustedRootCertificate = "MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA="; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/3-Remove.ps1 index f1c6596534..0ac59c1a99 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationTrustedCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Trusted Cert"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/1-Create.ps1 index 1fa1b7d51c..f8f277b958 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,6 @@ Configuration Example AuthenticationMethod = "usernameAndPassword"; ConnectionName = "Cisco VPN"; ConnectionType = "ciscoAnyConnect"; - Credential = $Credscredential; CustomXml = ""; DisplayName = "VPN"; DnsRules = @( @@ -73,6 +80,9 @@ Configuration Example } ); TrustedNetworkDomains = @(); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/2-Update.ps1 index 69242ff63c..f6eeed0a1a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,6 @@ Configuration Example AuthenticationMethod = "usernameAndPassword"; ConnectionName = "Cisco VPN"; ConnectionType = "ciscoAnyConnect"; - Credential = $Credscredential; CustomXml = ""; DisplayName = "VPN"; DnsRules = @( @@ -73,6 +80,9 @@ Configuration Example } ); TrustedNetworkDomains = @(); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/3-Remove.ps1 index 1274c03e79..7e6bb0ea45 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationVpnPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationVpnPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "VPN"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/1-Create.ps1 index e525045cf5..daa9eae1b6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,6 @@ Configuration Example ); AzureOperationalInsightsBlockTelemetry = $True; ConnectAppBlockAutoLaunch = $True; - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Present"; MaintenanceWindowBlocked = $False; @@ -39,6 +46,9 @@ Configuration Example SupportsScopeTags = $True; WelcomeScreenBlockAutomaticWakeUp = $True; WelcomeScreenMeetingInformation = "showOrganizerAndTimeOnly"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/2-Update.ps1 index f2c95f9c48..d362300d56 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,6 @@ Configuration Example ); AzureOperationalInsightsBlockTelemetry = $False; # Updated Property ConnectAppBlockAutoLaunch = $True; - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Present"; MaintenanceWindowBlocked = $False; @@ -39,6 +46,9 @@ Configuration Example SupportsScopeTags = $True; WelcomeScreenBlockAutomaticWakeUp = $True; WelcomeScreenMeetingInformation = "showOrganizerAndTimeOnly"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/3-Remove.ps1 index 99c307e64d..e9a18c6b39 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWindowsTeamPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationWindowsTeamPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/1-Create.ps1 index fbbcf032f7..817e0b5627 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,6 @@ Configuration Example AuthenticationRetryDelayPeriodInSeconds = 5 AuthenticationType = 'machine' CacheCredentials = $True - Credential = $Credscredential DisplayName = 'Wired Network' EapolStartPeriodInSeconds = 5 EapType = 'teap' @@ -41,6 +48,9 @@ Configuration Example TrustedServerCertificateNames = @('srv.domain.com') RootCertificatesForServerValidationIds = @('a485d322-13cd-43ef-beda-733f656f48ea', '169bf4fc-5914-40f4-ad33-48c225396183') SecondaryIdentityCertificateForClientAuthenticationId = '0b9aef2f-1671-4260-8eb9-3ab3138e176a' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/2-Update.ps1 index c7aa68885a..c134ecbe5e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,6 @@ Configuration Example AuthenticationRetryDelayPeriodInSeconds = 5 AuthenticationType = 'machine' CacheCredentials = $True - Credential = $Credscredential DisplayName = 'Wired Network' EapolStartPeriodInSeconds = 5 EapType = 'teap' @@ -41,6 +48,9 @@ Configuration Example TrustedServerCertificateNames = @('srv.domain.com') RootCertificatesForServerValidationIds = @('a485d322-13cd-43ef-beda-733f656f48ea', '169bf4fc-5914-40f4-ad33-48c225396183') SecondaryIdentityCertificateForClientAuthenticationId = '0b9aef2f-1671-4260-8eb9-3ab3138e176a' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/3-Remove.ps1 index bbf5bf4d73..8e1c70d1ec 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceConfigurationWiredNetworkPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneDeviceConfigurationWiredNetworkPolicyWindows10 'Example' { - Credential = $Credscredential DisplayName = 'Wired Network' Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/1-Create.ps1 index 2c995f15f6..ec54b07d17 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example Description = 'My Restriction' Limit = 12 Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/2-Update.ps1 index a36fb9f5bc..5454d76046 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example Description = 'My Restriction' Limit = 11 # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/3-Remove.ps1 index fb00aa8e9b..2ecec7b4b7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentLimitRestriction/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'My DSC Limit' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/1-Create.ps1 index 59d2180462..0552b4e3d4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,6 @@ Configuration Example deviceAndAppManagementAssignmentFilterType = 'none' dataType = '#microsoft.graph.allDevicesAssignmentTarget' }); - Credential = $Credscredential Description = "This is the default Device Type Restriction applied with the lowest priority to all users regardless of group membership."; DeviceEnrollmentConfigurationType = "platformRestrictions"; DisplayName = "All users and all devices"; @@ -58,6 +65,9 @@ Configuration Example platformBlocked = $False personalDeviceEnrollmentBlocked = $False }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/2-Update.ps1 index 24eecb9143..321192cbc1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -28,7 +36,6 @@ Configuration Example deviceAndAppManagementAssignmentFilterType = 'none' dataType = '#microsoft.graph.allDevicesAssignmentTarget' }); - Credential = $Credscredential Description = "This is the default Device Type Restriction applied with the lowest priority to all users regardless of group membership."; DeviceEnrollmentConfigurationType = "platformRestrictions"; DisplayName = "All users and all devices"; @@ -58,6 +65,9 @@ Configuration Example platformBlocked = $False personalDeviceEnrollmentBlocked = $False }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/3-Remove.ps1 index 5727bbb579..73d3ce57ad 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentPlatformRestriction/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,7 +23,6 @@ Configuration Example { IntuneDeviceEnrollmentPlatformRestriction 'DeviceEnrollmentPlatformRestriction' { - Credential = $Credscredential DisplayName = "Removed Policy"; Ensure = "Absent"; Assignments = @(); @@ -27,7 +34,9 @@ Configuration Example PersonalDeviceEnrollmentBlocked = $False }; Priority = 1; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/1-Create.ps1 index 23ecb3cb28..b4d60261d2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example SelectedMobileAppIds = @(); ShowInstallationProgress = $True; TrackInstallProgressForAutopilotOnly = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/2-Update.ps1 index 524d3a5343..55c2412c4d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -37,7 +45,9 @@ Configuration Example SelectedMobileAppIds = @(); ShowInstallationProgress = $True; TrackInstallProgressForAutopilotOnly = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/3-Remove.ps1 index b9a40e93bd..e79cc8a38d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceEnrollmentStatusPageWindows10/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = "All users and all devices"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceManagementComplianceSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceManagementComplianceSettings/2-Update.ps1 index 8466ff6b8a..802402dbff 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceManagementComplianceSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceManagementComplianceSettings/2-Update.ps1 @@ -5,9 +5,17 @@ This example updates the Device Management Compliance Settings Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -15,10 +23,12 @@ Configuration Example { IntuneDeviceManagementComplianceSettings 'DeviceManagementComplianceSettings' { - Credential = $Credscredential DeviceComplianceCheckinThresholdDays = 22; IsSingleInstance = "Yes"; SecureByDefault = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/1-Create.ps1 index 0910babcef..bedb3af636 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,6 @@ Configuration Example } } ); - Credential = $Credscredential Description = 'Description' DetectionScriptContent = "Base64 encoded script content"; DeviceHealthScriptType = "deviceHealthScript"; @@ -45,7 +52,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAs32Bit = $True; RunAsAccount = "system"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/2-Update.ps1 index 116faa673a..a8477140d6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/2-Update.ps1 @@ -5,9 +5,17 @@ This example updates a new Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,6 @@ Configuration Example } } ); - Credential = $Credscredential Description = 'Description' DetectionScriptContent = "Base64 encoded script content 2"; # Updated property DeviceHealthScriptType = "deviceHealthScript"; @@ -45,7 +52,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAs32Bit = $True; RunAsAccount = "system"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/3-Remove.ps1 index 85b0b6a6a0..f67cc58688 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDeviceRemediation/3-Remove.ps1 @@ -5,9 +5,17 @@ This example removes a Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example Id = '00000000-0000-0000-0000-000000000000' DisplayName = 'Device remediation' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/1-Create.ps1 index a8ca59f806..6cd082f0f5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,9 @@ Configuration Example PersonalRecoveryKeyRotationInMonths = 2; RoleScopeTagIds = @("0"); SelectedRecoveryKeyTypes = @("personalRecoveryKey"); - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/2-Update.ps1 index c68a663795..a703124b75 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,9 @@ Configuration Example PersonalRecoveryKeyRotationInMonths = 3; # Updated property RoleScopeTagIds = @("0"); SelectedRecoveryKeyTypes = @("personalRecoveryKey"); - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/3-Remove.ps1 index b7196a085f..ccb9cabb51 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionMacOS/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/1-Create.ps1 new file mode 100644 index 0000000000..9427be30cb --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/1-Create.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments { + deviceAndAppManagementAssignmentFilterType = 'none' + dataType = '#microsoft.graph.allDevicesAssignmentTarget' + }) + Description = '' + IdentificationField_Name = '1' + IdentificationField = 'IdentificationField' + SecIdentificationField = 'SecIdentificationField' + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/2-Update.ps1 new file mode 100644 index 0000000000..cc3181e17d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/2-Update.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments { + deviceAndAppManagementAssignmentFilterType = 'none' + dataType = '#microsoft.graph.allDevicesAssignmentTarget' + }) + Description = '' + IdentificationField_Name = '1' + IdentificationField = 'IdentificationField' + SecIdentificationField = 'UpdatedSecIdentificationField' # Updated property + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/3-Remove.ps1 new file mode 100644 index 0000000000..4163a8ebd0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneDiskEncryptionWindows10/3-Remove.ps1 @@ -0,0 +1,35 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Description = '' + Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/1-Create.ps1 index b26ac43199..2cf142bdf2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Assignments = @() Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/2-Update.ps1 index 2a8a3a5984..21679df4b0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -20,7 +28,9 @@ Configuration Example Assignments = @() Description = 'My updated description' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/3-Remove.ps1 index 2d2315e244..f7bbf42292 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneEndpointDetectionAndResponsePolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'Edr Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/1-Create.ps1 index 8ffa5395d4..b4ef01fd90 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -171,7 +179,9 @@ Configuration Example </AppConfig> </MitigationPolicy>" Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/2-Update.ps1 index c9752c06b4..830e57af8c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -171,7 +179,9 @@ Configuration Example </AppConfig> </MitigationPolicy>" # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/3-Remove.ps1 index c9a0cb3563..e7182e5756 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneExploitProtectionPolicyWindows10SettingCatalog/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'exploit Protection policy with assignments' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/1-Create.ps1 index 2877b370fd..aeffcea6c0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/1-Create.ps1 @@ -6,16 +6,23 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -42,8 +49,9 @@ Configuration Example } ); RoleScopeTags = @("0","1"); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/2-Update.ps1 index e7c62ea87b..6301827b35 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/2-Update.ps1 @@ -6,16 +6,23 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -42,8 +49,9 @@ Configuration Example } ); RoleScopeTags = @("0","1","2"); # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/3-Remove.ps1 index 9203613c8b..a1d152f253 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntunePolicySets/3-Remove.ps1 @@ -6,20 +6,28 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; DisplayName = "Example"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/1-Create.ps1 index 90aa706053..cd8b5aa222 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,9 @@ Configuration Example RoleDefinition = '2d00d0fd-45e9-4166-904f-b76ac5eed2c7' RoleDefinitionDisplayName = 'This is my role' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/2-Update.ps1 index b0868deef1..85d8bef025 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -25,7 +33,9 @@ Configuration Example RoleDefinition = '2d00d0fd-45e9-4166-904f-b76ac5eed2c7' RoleDefinitionDisplayName = 'This is my role' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/3-Remove.ps1 index b59e29c20b..435a84c5ea 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleAssignment/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'test2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/1-Create.ps1 index 3085cacc62..428331bd93 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/1-Create.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example notallowedResourceActions = @() roleScopeTagIds = @('0', '1') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/2-Update.ps1 index c36d49b3c2..0a906add91 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/2-Update.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,9 @@ Configuration Example notallowedResourceActions = @() roleScopeTagIds = @('0', '1') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/3-Remove.ps1 index aab7c83949..148d22b8b0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneRoleDefinition/3-Remove.ps1 @@ -5,9 +5,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,9 @@ Configuration Example { DisplayName = 'This is my role' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/1-Create.ps1 index 6661304509..f091d871b0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,9 @@ Configuration Example blockexecutablefilesrunningunlesstheymeetprevalenceagetrustedlistcriterion = 'audit' Description = 'Post' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/2-Update.ps1 index e01b744a61..cfe81b8646 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -27,7 +35,9 @@ Configuration Example blockexecutablefilesrunningunlesstheymeetprevalenceagetrustedlistcriterion = 'audit' Description = 'Post' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/3-Remove.ps1 index 94991c08ba..f81cd81644 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogASRRulesPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'asr 2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/1-Create.ps1 index bca184106a..e95b1549ea 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,6 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -85,6 +92,9 @@ Configuration Example } ); Technologies = "mdm"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/2-Update.ps1 index 09e976a362..7f967169e6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,7 +24,6 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -85,6 +92,9 @@ Configuration Example } ); Technologies = "mdm"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/3-Remove.ps1 index c4289f4356..15c37f198a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneSettingCatalogCustomPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Ensure = "Absent"; Name = "Setting Catalog Raw - DSC"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 index 0877dfa3f7..68379a26ff 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,9 @@ Configuration Example Ssid = 'sf' WiFiSecurityType = 'wpaEnterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 index 60d20b13ba..61488fc4be 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -29,7 +37,9 @@ Configuration Example Ssid = 'sf' WiFiSecurityType = 'wpaEnterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 index c1d2c7bf8b..f72c764053 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'Wifi Configuration Androind Device' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/1-Create.ps1 index 7d4f7c06dc..42088afb09 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/1-Create.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,9 @@ Configuration Example ProxySettings = 'none' Ssid = 'MySSID - 3' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/2-Update.ps1 index 1c73cfae8b..19b90870a1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/2-Update.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,9 @@ Configuration Example ProxySettings = 'none' Ssid = 'MySSID - 3' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/3-Remove.ps1 index b398d434af..02cc87ad1f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner/3-Remove.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example { DisplayName = 'Wifi - androidForWork' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/1-Create.ps1 index b5277ccc35..872caf044e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/1-Create.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,9 @@ Configuration Example Ssid = 'MySSID' WiFiSecurityType = 'open' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/2-Update.ps1 index d4a11464b2..7b84ecfa53 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/2-Update.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,9 @@ Configuration Example Ssid = 'MySSID' WiFiSecurityType = 'open' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/3-Remove.ps1 index a4fae55f0f..6eb8559ae8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile/3-Remove.ps1 @@ -7,9 +7,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example { DisplayName = 'wifi - android BYOD' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/1-Create.ps1 index 6dc5eb92cf..51c5968963 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -33,7 +41,9 @@ Configuration Example Ssid = 'WiFi' WiFiSecurityType = 'wpa2Enterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/2-Update.ps1 index cf010c716e..21fee623dc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -33,7 +41,9 @@ Configuration Example Ssid = 'WiFi' WiFiSecurityType = 'wpa2Enterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/3-Remove.ps1 index 72e2d84c20..e4b71c7ebd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidForWork/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'AndroindForWork' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 index 603d28a065..7bf3b64df6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 index 9422aa2b40..52354137fb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -30,7 +38,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 index 2ed5a3d069..363fd2438a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyAndroidOpenSourceProject/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'wifi aosp' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/1-Create.ps1 index 6fec3854e9..98b8242414 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/2-Update.ps1 index ab3b58d347..94ac38ac7b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -32,7 +40,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/3-Remove.ps1 index e6056c55c1..2c328e3243 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyIOS/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'ios wifi' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/1-Create.ps1 index 037bf0fae7..9e8cfdc1b6 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,9 @@ Configuration Example Ssid = 'aaaaaaaaaaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/2-Update.ps1 index 05a5c2e3cf..bb15e2e707 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -31,7 +39,9 @@ Configuration Example Ssid = 'aaaaaaaaaaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/3-Remove.ps1 index 4034a8c8cb..4693093d04 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyMacOS/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'macos wifi' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/1-Create.ps1 index 4d23fef70a..9247c56522 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -34,7 +42,9 @@ Configuration Example Ssid = 'ssid' WifiSecurityType = 'wpa2Personal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/2-Update.ps1 index 5c6fca22a6..778e72fa36 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -34,7 +42,9 @@ Configuration Example Ssid = 'ssid' WifiSecurityType = 'wpa2Personal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/3-Remove.ps1 index e5b8d15dce..1eba552a56 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWifiConfigurationPolicyWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'win10 wifi - revised' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/1-Create.ps1 index 27d64d06bc..b9fa5ee53d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,6 @@ Configuration Example IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { Assignments = @(); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = ""; DeviceType = "windowsPc"; @@ -35,6 +42,9 @@ Configuration Example SkipKeyboardSelectionPage = $False UserType = 'standard' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/2-Update.ps1 index 4671894531..199162b0e1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -17,7 +25,6 @@ Configuration Example IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { Assignments = @(); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = ""; DeviceType = "windowsPc"; @@ -35,6 +42,9 @@ Configuration Example SkipKeyboardSelectionPage = $False UserType = 'standard' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/3-Remove.ps1 index 46253c4281..5d6f8aaa5e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { - Credential = $Credscredential; DisplayName = "hybrid"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/1-Create.ps1 index a3c50bf3d7..e0377a5d49 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = "test"; DeviceType = "windowsPc"; @@ -39,6 +46,9 @@ Configuration Example SkipKeyboardSelectionPage = $True UserType = 'administrator' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/2-Update.ps1 index a57c990e65..6d662750cf 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +30,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = "test"; DeviceType = "windowsPc"; @@ -39,6 +46,9 @@ Configuration Example SkipKeyboardSelectionPage = $True UserType = 'administrator' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/3-Remove.ps1 index 436ac5c650..e3315f9451 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsAutopilotDeploymentProfileAzureADJoined/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -16,9 +24,11 @@ Configuration Example { IntuneWindowsAutopilotDeploymentProfileAzureADJoined 'Example' { - Credential = $Credscredential; DisplayName = "AAD"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/1-Create.ps1 index dd3eb15de7..a68c6c2010 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -50,7 +58,9 @@ Configuration Example ProtectionUnderLockConfigRequired = $False RevokeOnUnenrollDisabled = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/2-Update.ps1 index 4c921dd3d9..8a4f78f2d4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -50,7 +58,9 @@ Configuration Example ProtectionUnderLockConfigRequired = $False RevokeOnUnenrollDisabled = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/3-Remove.ps1 index 3739185cd6..ef4632a3ab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'WIP' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/1-Create.ps1 index bb31ab852c..54cafb9028 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Description = 'test 2' approvalType = 'manual' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/2-Update.ps1 index efe6c0eaa5..db00ad80f8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -21,7 +29,9 @@ Configuration Example Description = 'test 3' # Updated property approvalType = 'manual' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/3-Remove.ps1 index 25a5c12adb..712321c6cf 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -19,7 +27,9 @@ Configuration Example DisplayName = 'Driver Update Example' Description = 'test 2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/1-Create.ps1 index bda5ac792b..fe1472dc9f 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,9 @@ Configuration Example OfferStartDateTimeInUTC = '2023-02-03T16:00:00.0000000+00:00' } Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/2-Update.ps1 index 80dd2d592d..639acc47c0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -24,7 +32,9 @@ Configuration Example OfferStartDateTimeInUTC = '2023-02-05T16:00:00.0000000+00:00' # Updated Property } Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/3-Remove.ps1 index 3eeeb73752..4ac9c39918 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'WUfB Feature -dsc' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/1-Create.ps1 new file mode 100644 index 0000000000..f152fb7232 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/1-Create.ps1 @@ -0,0 +1,48 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments{ + deviceAndAppManagementAssignmentFilterType = 'none' + groupDisplayName = 'Exclude' + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '258a1749-8408-4dd0-8028-fab6208a28d7' + } + ); + DisplayName = 'Windows Quality Update' + Description = '' + ExpeditedUpdateSettings = MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings{ + QualityUpdateRelease = '2024-06-11T00:00:00Z' + DaysUntilForcedReboot = 0 + } + RoleScopeTagIds = @("0") + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/2-Update.ps1 new file mode 100644 index 0000000000..77b1e4f8ff --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/2-Update.ps1 @@ -0,0 +1,48 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments{ + deviceAndAppManagementAssignmentFilterType = 'none' + groupDisplayName = 'Exclude' + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '258a1749-8408-4dd0-8028-fab6208a28d7' + } + ); + DisplayName = 'Windows Quality Update' + Description = '' + ExpeditedUpdateSettings = MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings{ + QualityUpdateRelease = '2024-06-11T00:00:00Z' + DaysUntilForcedReboot = 1 # Updated property + } + RoleScopeTagIds = @("0") + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/3-Remove.ps1 new file mode 100644 index 0000000000..ac14be6e03 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10/3-Remove.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + DisplayName = 'Windows Quality Update' + Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/1-Create.ps1 index e93eba2279..abce1a1cc3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/1-Create.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -56,7 +64,9 @@ Configuration Example UserPauseAccess = 'enabled' UserWindowsUpdateScanAccess = 'enabled' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/2-Update.ps1 index 3cb0ebeb9d..95c1903a05 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/2-Update.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -56,7 +64,9 @@ Configuration Example UserPauseAccess = 'enabled' UserWindowsUpdateScanAccess = 'enabled' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/3-Remove.ps1 index 4ebc935536..a4e5286984 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10/3-Remove.ps1 @@ -6,9 +6,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -18,7 +26,9 @@ Configuration Example { DisplayName = 'WUfB Ring' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 56af643474..ef6275d857 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2024-07-11 +# Generated on: 2024-07-17 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.24.710.3' + ModuleVersion = '1.24.717.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -142,28 +142,37 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = '* AADApplication - * Fixes an error where the duplicate error was being trapped, - which could cause extra instances to be created. -* AADGroup - * Fixes an error where the duplicate error was being trapped, - which could cause extra instances to be created. -* IntuneDeviceConfigurationPlatformScriptMacOS - * Fixes an issue where the assignments are missing if filtered by display name. + ReleaseNotes = '* EXOHostedOutboundSpamFilterPolicy + * Changed the RecipientLimitInternalPerHour, RecipientLimitPerDay, and + RecipientLimitExternalPerHour parameters to UInt32. +* EXOMessageClassification + * Fix issue while creating policy for first time + FIXES [#4877](https://github.com/microsoft/Microsoft365DSC/issues/4877) +* IntuneDeviceConfigurationEmailProfilePolicyWindows10 + * Fix export by fixing some typos and from where values are extracted + FIXES [#3960](https://github.com/microsoft/Microsoft365DSC/issues/3960) +* IntuneDiskEncryptionWindows10 + * Initial Release + FIXES [#4050](https://github.com/microsoft/Microsoft365DSC/issues/4050) +* IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 + * Initial release. + FIXES [#2659](https://github.com/microsoft/Microsoft365DSC/issues/2659) +* SPOSharingSettings + * Improved performance by using -Filter on Get-PnPTenantSite calls. * M365DSCDRGUtil - * Fixes an issue where the return value was changed to a single object - instead of an array. - FIXES [#4844](https://github.com/microsoft/Microsoft365DSC/issues/4844) - * Fixes an issue where Graph models were not treated properly as a complex object. -* TELEMETRY - * Added instance count. - * Added roles scopes info. -* DEPENDENCIES - * Updated DSCParser to version 2.0.0.7. - * Updated Microsoft.Graph to version 2.20.0 - * Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.191 -* MISC - * Fixes issue with App Secret Authentication flow.' + * Fixes an issue with nested and duplicate settings in the settings catalog + * Add support for converting Intune assignments directly from Graph. + FIXES [#4875](https://github.com/microsoft/Microsoft365DSC/issues/4875) +* M365DSCResourceGenerator + * Update Intune resource generation. +* M365DSCReport + * Changes behaviour to not throw on empty configuration during report generation. + FIXES [#4559](https://github.com/microsoft/Microsoft365DSC/issues/4559) + FIXES [#4505](https://github.com/microsoft/Microsoft365DSC/issues/4505) + * Fixes an issue where the comparison treats empty arrays as an empty string. + FIXES [#4796](https://github.com/microsoft/Microsoft365DSC/issues/4796) +* Telemetry + * Added info about operation total execution time.' # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false diff --git a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 index 73d062f5c2..8098a13922 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1 @@ -1091,9 +1091,32 @@ function ConvertFrom-IntunePolicyAssignment foreach ($assignment in $Assignments) { $hashAssignment = @{} - $dataType = $assignment.Target.AdditionalProperties."@odata.type" - $groupId = $assignment.Target.AdditionalProperties.groupId - $collectionId = $assignment.Target.AdditionalProperties.collectionId + if ($null -ne $assignment.Target.'@odata.type') + { + $dataType = $assignment.Target.'@odata.type' + } + else + { + $dataType = $assignment.Target.AdditionalProperties.'@odata.type' + } + + if ($null -ne $assignment.Target.groupId) + { + $groupId = $assignment.Target.groupId + } + else + { + $groupId = $assignment.Target.AdditionalProperties.groupId + } + + if ($null -ne $assignment.Target.collectionId) + { + $collectionId = $assignment.Target.collectionId + } + else + { + $collectionId = $assignment.Target.AdditionalProperties.collectionId + } $hashAssignment.Add('dataType',$dataType) if (-not [string]::IsNullOrEmpty($groupId)) @@ -1500,7 +1523,15 @@ function Get-IntuneSettingCatalogPolicySetting $_.Id -eq $settingInstanceTemplate.SettingDefinitionId -and ` ($_.AdditionalProperties.dependentOn.Count -eq 0 -and $_.AdditionalProperties.options.dependentOn.Count -eq 0) } - $settingName = $settingInstanceTemplate.SettingDefinitionId.split('_') | Select-Object -Last 1 + if ($null -eq $settingDefinition) + { + continue + } + if ($settingDefinition -is [System.Array]) + { + $settingDefinition = $settingDefinition[0] + } + $settingName = $settingDefinition.Name $settingType = $settingInstanceTemplate.AdditionalProperties.'@odata.type'.Replace('InstanceTemplate', 'Instance') $settingInstance.Add('@odata.type', $settingType) if (-not [string]::IsNullOrEmpty($settingInstanceTemplate.settingInstanceTemplateId)) @@ -1598,8 +1629,12 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue { $groupSettingCollectionValue = @{} $groupSettingCollectionValueChildren = @() + $groupSettingCollectionDefinitionChildren = @() - $groupSettingCollectionDefinitionChildren = $SettingTemplates.SettingDefinitions | Where-Object { + $templates = $SettingTemplates | Where-Object { + $_.settingInstanceTemplate.settingDefinitionId -eq $SettingDefinition.RootDefinitionId + } + $groupSettingCollectionDefinitionChildren += $templates.SettingDefinitions | Where-Object { ($_.AdditionalProperties.dependentOn.Count -gt 0 -and $_.AdditionalProperties.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) -or ($_.AdditionalProperties.options.dependentOn.Count -gt 0 -and $_.AdditionalProperties.options.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) } @@ -1610,6 +1645,8 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue $childSettingValueName = $childSettingType.Replace('#microsoft.graph.deviceManagementConfiguration', '').Replace('Instance', 'Value') $childSettingValueType = "#microsoft.graph.deviceManagementConfiguration$($childSettingValueName)" $childSettingValueName = $childSettingValueName.Substring(0, 1).ToLower() + $childSettingValueName.Substring(1, $childSettingValueName.length - 1 ) + $childSettingInstanceTemplate = $SettingTemplates.SettingInstanceTemplate | Where-Object { $_.SettingDefinitionId -eq $childDefinition.Id } + $childSettingValueTemplateId = $childSettingInstanceTemplate.AdditionalProperties."$($childSettingValueName)Template".settingValueTemplateId $childSettingValue = Get-IntuneSettingCatalogPolicySettingInstanceValue ` -DSCParams $DSCParams ` -SettingDefinition $childDefinition ` @@ -1617,7 +1654,8 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue -SettingName $childSettingName ` -SettingType $childDefinition.AdditionalProperties.'@odata.type' ` -SettingValueName $childSettingValueName ` - -SettingValueType $childSettingValueType + -SettingValueType $childSettingValueType ` + -SettingValueTemplateId $childSettingValueTemplateId if ($childSettingValue.Keys.Count -gt 0) { @@ -1625,6 +1663,10 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue { $childSettingValue.Add('settingDefinitionId', $childDefinition.Id) } + if (-not [string]::IsNullOrEmpty($childSettingInstanceTemplate.settingInstanceTemplateId)) + { + $childSettingValue.Add('settingInstanceTemplateReference', @{'settingInstanceTemplateId' = $childSettingInstanceTemplate.settingInstanceTemplateId }) + } $childSettingValue.Add('@odata.type', $childSettingType) $groupSettingCollectionValueChildren += $childSettingValue } @@ -1640,11 +1682,18 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue { $choiceSettingValue = @{} $choiceSettingValueChildren = @() + $choiceSettingDefinitionChildren = @() - # Choice settings almost always have children settings, so we need to fetch those - $choiceSettingDefinitionChildren = $SettingTemplates.SettingDefinitions | Where-Object { - ($_.AdditionalProperties.dependentOn.Count -gt 0 -and $_.AdditionalProperties.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) -or - ($_.AdditionalProperties.options.dependentOn.Count -gt 0 -and $_.AdditionalProperties.options.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) + # Choice settings almost always have child settings, so we need to fetch those + if ($null -ne $SettingDefinition) + { + $templates = $SettingTemplates | Where-Object { + $_.settingInstanceTemplate.settingDefinitionId -eq $SettingDefinition.RootDefinitionId + } + $choiceSettingDefinitionChildren += $templates.SettingDefinitions | Where-Object { + ($_.AdditionalProperties.dependentOn.Count -gt 0 -and $_.AdditionalProperties.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) -or + ($_.AdditionalProperties.options.dependentOn.Count -gt 0 -and $_.AdditionalProperties.options.dependentOn.parentSettingId.Contains($SettingDefinition.Id)) + } } foreach ($childDefinition in $choiceSettingDefinitionChildren) { @@ -1653,6 +1702,8 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue $childSettingValueName = $childSettingType.Replace('#microsoft.graph.deviceManagementConfiguration', '').Replace('Instance', 'Value') $childSettingValueType = "#microsoft.graph.deviceManagementConfiguration$($childSettingValueName)" $childSettingValueName = $childSettingValueName.Substring(0, 1).ToLower() + $childSettingValueName.Substring(1, $childSettingValueName.Length - 1 ) + $childSettingInstanceTemplate = $SettingTemplates.SettingInstanceTemplate | Where-Object { $_.SettingDefinitionId -eq $childDefinition.Id } + $childSettingValueTemplateId = $childSettingInstanceTemplate.AdditionalProperties."$($childSettingValueName)Template".settingValueTemplateId $childSettingValue = Get-IntuneSettingCatalogPolicySettingInstanceValue ` -DSCParams $DSCParams ` -SettingDefinition $childDefinition ` @@ -1660,7 +1711,8 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue -SettingName $childSettingName ` -SettingType $childDefinition.AdditionalProperties.'@odata.type' ` -SettingValueName $childSettingValueName ` - -SettingValueType $childSettingValueType + -SettingValueType $childSettingValueType ` + -SettingValueTemplateId $childSettingValueTemplateId if ($childSettingValue.Keys.Count -gt 0) { @@ -1668,6 +1720,10 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue { $childSettingValue.Add('settingDefinitionId', $childDefinition.Id) } + if (-not [string]::IsNullOrEmpty($childSettingInstanceTemplate.settingInstanceTemplateId)) + { + $childSettingValue.Add('settingInstanceTemplateReference', @{'settingInstanceTemplateId' = $childSettingInstanceTemplate.settingInstanceTemplateId }) + } $childSettingValue.Add('@odata.type', $childSettingType) $choiceSettingValueChildren += $childSettingValue } @@ -1680,17 +1736,19 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue $choiceSettingValue.Add('children', @()) } - $paramKey = $null - $paramKey = $DSCParams.Keys | Where-Object { $_ -eq $SettingName } - if ($null -eq $paramKey) - { - $paramKey = $SettingName - } + $valueResult = Get-IntuneSettingCatalogPolicySettingDSCValue ` + -SettingName $SettingName ` + -SettingValueType $SettingValueType ` + -SettingTemplates $SettingTemplates ` + -SettingDefinition $SettingDefinition ` + -DSCParams $DSCParams + + $value = $valueResult.Value # If there is a value in the DSC params, we add that to the choice setting - if ($null -ne $DSCParams[$paramKey]) + if ($null -ne $value) { - $value = "$($SettingDefinition.Id)_$($DSCParams[$paramKey])" + $value = $value $choiceSettingValue.Add('value', $value) $odataType = $SettingType.Replace('Definition', 'Value').Replace('Instance', 'Value') $choiceSettingValue.Add('@odata.type', $odataType) @@ -1709,64 +1767,16 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue # SimpleSettingCollections are collections of simple settings, e.g. strings or integers { $_ -eq '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance' -or $_ -eq '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionDefinition' } { - [array]$values = @() - # Go over all the values that have not yet been processed - foreach ($key in ($DSCParams.Keys | Where-Object { $_ -notin $global:excludedDscParams })) - { - $matchCombined = $false - $matchesId = $false - $name = $SettingTemplates.SettingDefinitions.Name | Where-Object -FilterScript { $_ -eq $key } - if ($name.Count -ne 1) - { - # Key might have been combined with parent setting, try to split it - if ($key -like "*_*") - { - $parentSettingName = $key.Split('_')[0] - $childSettingName = $key.Replace("$($parentSettingName)_", '') - $parentDefinition = $SettingTemplates.SettingDefinitions | Where-Object { $_.Name -eq $parentSettingName } - $childDefinition = $SettingTemplates.SettingDefinitions | Where-Object { $_.Name -eq $childSettingName -and $_.AdditionalProperties.dependentOn.parentSettingId.Contains($parentDefinition.Id) } - if ($null -ne $parentDefinition -and $null -ne $childDefinition) - { - # Parent was combined with child setting. Since there can be multiple settings with the same Name, we need to check the Id as well - if ($SettingDefinition.Id -eq $childDefinition.Id) - { - $global:excludedDscParams += $key - $matchCombined = $true - } - } - } + $valuesResult = Get-IntuneSettingCatalogPolicySettingDSCValue ` + -SettingName $SettingName ` + -SettingValueType $SettingValueType ` + -SettingTemplates $SettingTemplates ` + -SettingDefinition $SettingDefinition ` + -DSCParams $DSCParams - if (-not $matchCombined) - { - # Parent was not combined, look for the Id - $SettingTemplates.SettingDefinitions | ForEach-Object { - if ($_.Id -notin $global:excludedDefinitionIds -and $_.Name -eq $SettingName -and $_.Id -like "*$key") - { - $global:excludedDefinitionIds += $_.Id - $matchesId = $true - } - } - } - } + $values = $valuesResult.Value + $SettingValueType = $valuesResult.SettingValueType - # If there is exactly one setting with the name, the setting is combined or the id matches, we add the DSC value to the values array and update the real setting value type - if (($name.Count -eq 1 -and $SettingName -eq $key) -or $matchCombined -or $matchesId) - { - if ($SettingValueType -like "*Simple*") - { - if ($DSCParams[$key] -is [System.String[]]) - { - $SettingValueType = "#microsoft.graph.deviceManagementConfigurationStringSettingValue" - } - elseif ($DSCParams[$key] -is [System.Int32[]]) - { - $SettingValueType = "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue" - } - } - $values += $DSCParams[$key] - break - } - } $settingValueCollection = @() foreach ($v in $values) { @@ -1782,69 +1792,16 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue # For all other types, e.g. Integer, String, Boolean, etc., we add the value directly Default { - $value = $null - # Go over all the values that have not yet been processed - foreach ($key in ($DSCParams.Keys | Where-Object { $_ -notin $global:excludedDscParams })) - { - $matchCombined = $false - $matchesId = $false - $name = $SettingTemplates.SettingDefinitions.Name | Where-Object -FilterScript { $_ -eq $key } - if ($name.Count -ne 1) - { - # Key might have been combined with parent setting, try to split it - if ($key -like "*_*") - { - $parentSettingName = $key.Split('_')[0] - $childSettingName = $key.Replace("$($parentSettingName)_", '') - $parentDefinition = $SettingTemplates.SettingDefinitions | Where-Object { $_.Name -eq $parentSettingName } - $childDefinition = $SettingTemplates.SettingDefinitions | Where-Object { $_.Name -eq $childSettingName } - if ($null -ne $parentDefinition -and $null -ne $childDefinition) - { - # Parent was combined with child setting - $global:excludedDscParams += $key - $matchCombined = $true - } - } - - if (-not $matchCombined) - { - # Parent was not combined, look for the id - $SettingTemplates.SettingDefinitions | ForEach-Object { - if ($_.Id -notin $global:excludedDefinitionIds -and $_.Name -eq $SettingName -and $_.Id -like "*$key") - { - $global:excludedDefinitionIds += $_.Id - $matchesId = $true - $SettingDefinition = $_ - } - } - } - } + $valueResult = Get-IntuneSettingCatalogPolicySettingDSCValue ` + -SettingName $SettingName ` + -SettingValueType $SettingValueType ` + -SettingTemplates $SettingTemplates ` + -SettingDefinition $SettingDefinition ` + -DSCParams $DSCParams - # If there is exactly one setting with the name, the setting is combined or the id matches, we get the DSC value update the real setting value type - if (($name.Count -eq 1 -and $SettingName -eq $key) -or $matchCombined -or $matchesId) - { - if ($SettingValueType -like "*Simple*") - { - if ($DSCParams[$key] -is [System.String]) - { - $SettingValueType = "#microsoft.graph.deviceManagementConfigurationStringSettingValue" - } - elseif ($DSCParams[$key] -is [System.Int32]) - { - $SettingValueType = "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue" - } - } - if ($SettingValueType -like "*Simple*" -or $SettingValueType -in @("#microsoft.graph.deviceManagementConfigurationIntegerSettingValue", "#microsoft.graph.deviceManagementConfigurationStringSettingValue")) - { - $value = $DSCParams[$key] - } - else - { - $value = "$($SettingDefinition.Id)_$($DSCParams[$key])" - } - break - } - } + $value = $valueResult.Value + $SettingValueType = $valueResult.SettingValueType + $SettingDefinition = $valueResult.SettingDefinition if ($null -eq $value) { @@ -1869,6 +1826,134 @@ function Get-IntuneSettingCatalogPolicySettingInstanceValue return $settingValuesToReturn } +function Get-IntuneSettingCatalogPolicySettingDSCValue +{ + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $SettingName, + + [Parameter()] + [System.String] + $SettingValueType = "", + + [Parameter(Mandatory = $true)] + [System.Array] + $SettingTemplates, + + [Parameter()] + $SettingDefinition, + + [Parameter(Mandatory = $true)] + [System.Collections.Hashtable] + $DSCParams + ) + + # Go over all the values that have not yet been processed + foreach ($key in ($DSCParams.Keys | Where-Object { $_ -notin $global:excludedDscParams })) + { + $matchCombined = $false + $matchesId = $false + $settingDefinitions = $SettingTemplates.SettingDefinitions ` + | Where-Object -FilterScript { $_.Name -eq $key } + + # Edge case where the same setting is defined twice in the template, with the same name and id + if ($settingDefinitions.Count -eq 2) + { + if ($settingDefinitions[0].Id -eq $settingDefinitions[1].Id -and ` + $settingDefinitions[0].Name -eq $settingDefinitions[1].Name) + { + $settingDefinitions = $settingDefinitions[0] + } + } + $name = $settingDefinitions.Name + + if ($name.Count -ne 1) + { + # Key might have been combined with parent setting, try to split it + if ($key -like "*_*") + { + $parentSettingName = $key.Split('_')[0] + $parentDefinition = $SettingTemplates.SettingDefinitions | Where-Object -FilterScript { $_.Name -eq $parentSettingName } + $childDefinition = $SettingTemplates.SettingDefinitions | Where-Object -FilterScript { + $_.Name -eq $SettingName -and + (($_.AdditionalProperties.dependentOn.Count -gt 0 -and $_.AdditionalProperties.dependentOn.parentSettingId.Contains($parentDefinition.Id)) -or + ($_.AdditionalProperties.options.dependentOn.Count -gt 0 -and $_.AdditionalProperties.options.dependentOn.parentSettingId.Contains($parentDefinition.Id)) + ) + } + if ($null -ne $parentDefinition -and $null -ne $childDefinition -and $childDefinition.Id -eq $SettingDefinition.Id) + { + # Parent was combined with child setting. Since there can be multiple settings with the same Name, we need to check the Id as well + if ($SettingDefinition.Id -eq $childDefinition.Id) + { + $global:excludedDscParams += $key + $matchCombined = $true + } + } + } + + if (-not $matchCombined) + { + # Parent was not combined, look for the id + $SettingTemplates.SettingDefinitions | ForEach-Object { + if ($_.Id -notin $global:excludedDefinitionIds -and $_.Name -eq $SettingName -and $_.Id -like "*$key") + { + $global:excludedDefinitionIds += $_.Id + $global:excludedDscParams += $key + $matchesId = $true + $SettingDefinition = $_ + } + } + } + } + + # If there is exactly one setting with the name, the setting is combined or the id matches, we get the DSC value update the real setting value type + if (($name.Count -eq 1 -and $SettingName -eq $key) -or $matchCombined -or $matchesId) + { + $isArray = $false + if ($SettingValueType -like "*Simple*") + { + if ($DSCParams[$key] -is [System.String]) + { + $SettingValueType = "#microsoft.graph.deviceManagementConfigurationStringSettingValue" + } + elseif ($DSCParams[$key] -is [System.Int32]) + { + $SettingValueType = "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue" + } + elseif ($DSCParams[$key] -is [System.String[]]) + { + $SettingValueType = "#microsoft.graph.deviceManagementConfigurationStringSettingValue" + $isArray = $true + } + elseif ($DSCParams[$key] -is [System.Int32[]]) + { + $SettingValueType = "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue" + $isArray = $true + } + } + if ($SettingValueType -like "*Simple*" -or $SettingValueType -in @("#microsoft.graph.deviceManagementConfigurationIntegerSettingValue", "#microsoft.graph.deviceManagementConfigurationStringSettingValue")) + { + return @{ + SettingDefinition = $SettingDefinition + SettingValueType = $SettingValueType + Value = if ($isArray) { ,$DSCParams[$key] } else { $DSCParams[$key] } + } + } + else + { + return @{ + SettingDefinition = $SettingDefinition + SettingValueType = $SettingValueType + Value = "$($SettingDefinition.Id)_$($DSCParams[$key])" + } + } + break + } + } +} + function Export-IntuneSettingCatalogPolicySettings { [CmdletBinding()] diff --git a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 index a92596eb70..f732ea0367 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1 @@ -633,7 +633,7 @@ function New-M365DSCReportFromConfiguration } else { - throw "Parsed content was null." + Write-Warning -Message "Parsed content was null. No report was generated." } } @@ -794,11 +794,7 @@ function Compare-M365DSCConfigurations { if ($propertyName -notin $filteredProperties) { - $destinationPropertyName = $destinationResource.Keys | Where-Object -FilterScript { $_ -eq $propertyName } - if ([System.String]::IsNullOrEmpty($destinationPropertyName)) - { - $destinationPropertyName = $propertyName - } + $destinationPropertyName = $propertyName # Case where the property contains CIMInstances if ($null -ne $sourceResource.$propertyName.Keys -and $sourceResource.$propertyName.Keys.Contains('CIMInstance')) @@ -892,7 +888,7 @@ function Compare-M365DSCConfigurations } # Needs to be a separate nested if statement otherwise the ReferenceObject can be null and it will error out; elseif ($destinationResource.ContainsKey($destinationPropertyName) -eq $false -or (-not [System.String]::IsNullOrEmpty($propertyName) -and - (-not [System.String]::IsNullOrEmpty($sourceResource.$propertyName) -and + ($null -ne $sourceResource.$propertyName -and $null -ne (Compare-Object -ReferenceObject ($sourceResource.$propertyName)` -DifferenceObject ($destinationResource.$destinationPropertyName)))) -and -not ([System.String]::IsNullOrEmpty($destinationResource.$destinationPropertyName) -and [System.String]::IsNullOrEmpty($sourceResource.$propertyName))) @@ -952,11 +948,8 @@ function Compare-M365DSCConfigurations { if ($propertyName -notin $filteredProperties) { - $sourcePropertyName = $destinationResource.Keys | Where-Object -FilterScript { $_ -eq $propertyName } - if ([System.String]::IsNullOrEmpty($sourcePropertyName)) - { - $sourcePropertyName = $propertyName - } + $sourcePropertyName = $propertyName + # Case where the property contains CIMInstances if ($null -ne $destinationResource.$propertyName.Keys -and $destinationResource.$propertyName.Keys.Contains('CIMInstance')) { @@ -979,13 +972,15 @@ function Compare-M365DSCConfigurations foreach ($property in $instance.Keys) { if ($null -eq $sourceResourceInstance."$property" -or ` - (-not [System.String]::IsNullOrEmpty($instance."$property") -and ` + ($null -ne $instance."$property" -and ` $null -ne (Compare-Object -ReferenceObject ($instance."$property")` -DifferenceObject ($sourceResourceInstance."$property")))) { # Make sure we haven't already added this drift in the delta return object to prevent duplicates. - $existing = $delta | Where-Object -FilterScript {$_.ResourceName -eq $destinationResource.ResourceName -and ` - $_.ResourceInstanceName -eq $destinationResource.ResourceInstanceName} + $existing = $delta | Where-Object -FilterScript { + $_.ResourceName -eq $destinationResource.ResourceName -and + $_.ResourceInstanceName -eq $destinationResource.ResourceInstanceName + } $sameEntry = $null if ($null -ne $existing) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 index 6ac0e57bfb..a62b0907b7 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCTelemetryEngine.psm1 @@ -81,6 +81,12 @@ function Add-M365DSCTelemetryEvent { $Script:M365DSCCountResourceInstance++ } + if ($null -eq $Script:M365DSCOperationStartTime -or $hostId -ne $Script:M365DSCExecutionContextId) + { + $Script:M365DSCOperationStartTime = [System.DateTime]::Now + } + + $Script:M365DSCOperationTimeTaken = [System.DateTime]::Now.Subtract($Script:M365DSCOperationStartTime) if ($hostId -ne $Script:M365DSCExecutionContextId) { @@ -88,6 +94,7 @@ function Add-M365DSCTelemetryEvent } $Data.Add('ResourceInstancesCount', $Script:M365DSCCountResourceInstance) $Data.Add('M365DSCExecutionContextId', $hostId) + $Data.Add('M365DSCOperationTotalTime', $Script:M365DSCOperationTimeTaken.TotalSeconds) } catch { diff --git a/Modules/Microsoft365DSC/SchemaDefinition.json b/Modules/Microsoft365DSC/SchemaDefinition.json index cc4e3f0fe7..ee276441d1 100644 --- a/Modules/Microsoft365DSC/SchemaDefinition.json +++ b/Modules/Microsoft365DSC/SchemaDefinition.json @@ -473,7 +473,7 @@ "Option": "Write" }, { - "CIMType": "String", + "CIMType": "Boolean", "Name": "SelfServiceSignUpEnabled", "Option": "Write" }, @@ -8623,17 +8623,17 @@ "Option": "Write" }, { - "CIMType": "String", + "CIMType": "UInt32", "Name": "RecipientLimitInternalPerHour", "Option": "Write" }, { - "CIMType": "String", + "CIMType": "UInt32", "Name": "RecipientLimitPerDay", "Option": "Write" }, { - "CIMType": "String", + "CIMType": "UInt32", "Name": "RecipientLimitExternalPerHour", "Option": "Write" }, @@ -29799,6 +29799,351 @@ } ] }, + { + "ClassName": "MSFT_IntuneDiskEncryptionWindows10", + "Parameters": [ + { + "CIMType": "String", + "Name": "Description", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "DisplayName", + "Option": "Key" + }, + { + "CIMType": "String[]", + "Name": "RoleScopeTagIds", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "Id", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RequireDeviceEncryption", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EncryptionMethodWithXts_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EncryptionMethodWithXtsOsDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EncryptionMethodWithXtsFdvDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EncryptionMethodWithXtsRdvDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "IdentificationField_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "IdentificationField", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "SecIdentificationField", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "AllowWarningForOtherDiskEncryption", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "AllowStandardUserEncryption", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureRecoveryPasswordRotation", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSEncryptionType_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSEncryptionTypeDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureAdvancedStartup_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureTPMStartupKeyUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureTPMPINKeyUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureTPMUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigureNonTPMStartupKeyUsage_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ConfigurePINUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "MinimumPINLength_Name", + "Option": "Write" + }, + { + "CIMType": "SInt32", + "Name": "MinPINLength", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EnhancedPIN_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "DisallowStandardUsersCanChangePIN_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EnablePreBootPinExceptionOnDECapableDevice_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "EnablePrebootInputProtectorsOnSlates_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSRecoveryUsage_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSRequireActiveDirectoryBackup_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSActiveDirectoryBackup_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSRecoveryPasswordUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSHideRecoveryPage_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSAllowDRA_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSRecoveryKeyUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "OSActiveDirectoryBackupDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "PrebootRecoveryInfo_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "PrebootRecoveryInfoDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RecoveryUrl_Input", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RecoveryMessage_Input", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVEncryptionType_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVEncryptionTypeDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVRecoveryUsage_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVActiveDirectoryBackup_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVHideRecoveryPage_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVRecoveryPasswordUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVRequireActiveDirectoryBackup_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVAllowDRA_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVActiveDirectoryBackupDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVRecoveryKeyUsageDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "FDVDenyWriteAccess_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVConfigureBDE", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVAllowBDE_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVEncryptionType_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVEncryptionTypeDropDown_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVDisableBDE_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVDenyWriteAccess_Name", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "RDVCrossOrg", + "Option": "Write" + }, + { + "CIMType": "MSFT_DeviceManagementConfigurationPolicyAssignments[]", + "Name": "Assignments", + "Option": "Write" + }, + { + "CIMType": "string", + "Name": "Ensure", + "Option": "Write" + }, + { + "CIMType": "MSFT_Credential", + "Name": "Credential", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ApplicationId", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "TenantId", + "Option": "Write" + }, + { + "CIMType": "MSFT_Credential", + "Name": "ApplicationSecret", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "CertificateThumbprint", + "Option": "Write" + }, + { + "CIMType": "Boolean", + "Name": "ManagedIdentity", + "Option": "Write" + }, + { + "CIMType": "String[]", + "Name": "AccessTokens", + "Option": "Write" + } + ] + }, { "ClassName": "MSFT_IntuneEndpointDetectionAndResponsePolicyWindows10", "Parameters": [ @@ -32559,6 +32904,96 @@ } ] }, + { + "ClassName": "MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings", + "Parameters": [ + { + "CIMType": "UInt32", + "Name": "DaysUntilForcedReboot", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "QualityUpdateRelease", + "Option": "Write" + } + ] + }, + { + "ClassName": "MSFT_IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10", + "Parameters": [ + { + "CIMType": "String", + "Name": "DisplayName", + "Option": "Key" + }, + { + "CIMType": "String", + "Name": "Description", + "Option": "Write" + }, + { + "CIMType": "MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings", + "Name": "ExpeditedUpdateSettings", + "Option": "Write" + }, + { + "CIMType": "String[]", + "Name": "RoleScopeTagIds", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "Id", + "Option": "Write" + }, + { + "CIMType": "MSFT_DeviceManagementConfigurationPolicyAssignments[]", + "Name": "Assignments", + "Option": "Write" + }, + { + "CIMType": "string", + "Name": "Ensure", + "Option": "Write" + }, + { + "CIMType": "MSFT_Credential", + "Name": "Credential", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "ApplicationId", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "TenantId", + "Option": "Write" + }, + { + "CIMType": "MSFT_Credential", + "Name": "ApplicationSecret", + "Option": "Write" + }, + { + "CIMType": "String", + "Name": "CertificateThumbprint", + "Option": "Write" + }, + { + "CIMType": "Boolean", + "Name": "ManagedIdentity", + "Option": "Write" + }, + { + "CIMType": "String[]", + "Name": "AccessTokens", + "Option": "Write" + } + ] + }, { "ClassName": "MSFT_MicrosoftGraphWindowsUpdateInstallScheduleType", "Parameters": [ diff --git a/ResourceGenerator/M365DSCResourceGenerator.psm1 b/ResourceGenerator/M365DSCResourceGenerator.psm1 index 71a21e7ade..1cc3f8df17 100644 --- a/ResourceGenerator/M365DSCResourceGenerator.psm1 +++ b/ResourceGenerator/M365DSCResourceGenerator.psm1 @@ -731,25 +731,18 @@ function New-M365DSCResource $AssignmentsRemove += " `$BoundParameters.Remove(`"Assignments`") | Out-Null`r`n" - $AssignmentsNew += " `$assignmentsHash = @()`r`n" - $AssignmentsNew += " foreach (`$assignment in `$Assignments)`r`n" - $AssignmentsNew += " {`r`n" - $AssignmentsNew += " `$assignmentsHash += Get-M365DSCDRGComplexTypeToHashtable -ComplexObject `$assignment`r`n" - $AssignmentsNew += " }`r`n" + $AssignmentsNew += " " $AssignmentsNew += "`r`n" $AssignmentsNew += " if (`$policy.Id)`r`n" $AssignmentsNew += " {`r`n" + $AssignmentsNew += " `$assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:`$true -Assignments `$Assignments`r`n" $AssignmentsNew += " Update-DeviceConfigurationPolicyAssignment ```r`n" $AssignmentsNew += " -DeviceConfigurationPolicyId `$policy.Id ```r`n" $AssignmentsNew += " -Targets `$assignmentsHash ```r`n" $AssignmentsNew += " -Repository '$repository'`r`n" $AssignmentsNew += " }`r`n" - $AssignmentsUpdate += " `$assignmentsHash = @()`r`n" - $AssignmentsUpdate += " foreach (`$assignment in `$Assignments)`r`n" - $AssignmentsUpdate += " {`r`n" - $AssignmentsUpdate += " `$assignmentsHash += Get-M365DSCDRGComplexTypeToHashtable -ComplexObject `$assignment`r`n" - $AssignmentsUpdate += " }`r`n" + $AssignmentsUpdate += " `$assignmentsHash = ConvertTo-IntunePolicyAssignment -IncludeDeviceFilter:`$true -Assignments `$Assignments`r`n" $AssignmentsUpdate += " Update-DeviceConfigurationPolicyAssignment ```r`n" $AssignmentsUpdate += " -DeviceConfigurationPolicyId `$currentInstance.Id ```r`n" $AssignmentsUpdate += " -Targets `$assignmentsHash ```r`n" diff --git a/ResourceGenerator/Module.Template.psm1 b/ResourceGenerator/Module.Template.psm1 index 132197bba8..b389ecfab3 100644 --- a/ResourceGenerator/Module.Template.psm1 +++ b/ResourceGenerator/Module.Template.psm1 @@ -370,6 +370,10 @@ function Export-TargetResource { $displayedKey = $config.displayName } + elseif (-not [string]::IsNullOrEmpty($config.name)) + { + $displayedKey = $config.name + } Write-Host " |---[$i/$($getValue.Count)] $displayedKey" -NoNewline $params = @{ <PrimaryKey> = $config.<PrimaryKey><RequiredKey> diff --git a/Tests/Integration/M365DSCTestEngine.psm1 b/Tests/Integration/M365DSCTestEngine.psm1 index d75004b683..5fb4812a98 100644 --- a/Tests/Integration/M365DSCTestEngine.psm1 +++ b/Tests/Integration/M365DSCTestEngine.psm1 @@ -18,21 +18,37 @@ function New-M365DSCIntegrationTest param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { @@ -95,7 +111,7 @@ function New-M365DSCIntegrationTest # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 6f8c8a7041..b4182546dc 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -1,21 +1,37 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { AADAdministrativeUnit 'TestUnit' @@ -31,12 +47,14 @@ RoleName = 'User Administrator' RoleMemberInfo = MSFT_MicrosoftGraphMember { - Identity = "admin@$Domain" + Identity = "admin@$TenantId" Type = "User" } } ) - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADApplication 'AADApp1' { @@ -44,12 +62,12 @@ AvailableToOtherTenants = $false Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -74,11 +92,15 @@ } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAttributeSet 'AADAttributeSetTest' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; @@ -86,7 +108,9 @@ } AADAuthenticationContextClassReference 'AADAuthenticationContextClassReference-Test' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test"; DisplayName = "My Context"; Ensure = "Present"; @@ -99,13 +123,17 @@ Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADConditionalAccessPolicy 'ConditionalAccessPolicy' { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; @@ -147,14 +175,18 @@ ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } AADEntitlementManagementAccessPackage 'myAccessPackage' { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; @@ -186,7 +218,9 @@ IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalog 'myAccessPackageCatalog' { @@ -197,26 +231,41 @@ IsExternallyVisible = $True Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + AADGroup 'DependantGroup' + { + DisplayName = "MyGroup" + Description = "Microsoft DSC Group" + SecurityEnabled = $True + MailEnabled = $True + GroupTypes = @("Unified") + MailNickname = "MyGroup" + Visibility = "Private" + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $true - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "MyGroup"; + OriginSystem = "AADGroup"; + OriginId = 'MyGroup' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "this is the tenant partner"; DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -224,17 +273,21 @@ odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementRoleAssignment 'AADEntitlementManagementRoleAssignment-Create' { AppScopeId = "/"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; - Principal = "John.Smith@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Catalog creator"; } AADGroup 'MyGroups' @@ -246,9 +299,11 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADNamedLocationPolicy 'CompanyNetwork' { @@ -257,7 +312,9 @@ IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleDefinition 'AADRoleDefinition1' { @@ -268,16 +325,20 @@ RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleEligibilityScheduleRequest 'MyRequest' { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' @@ -295,19 +356,23 @@ AlternativeNames = "AlternativeName1","AlternativeName2" AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADSocialIdentityProvider 'AADSocialIdentityProvider-Google' { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; @@ -318,11 +383,13 @@ Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -331,7 +398,9 @@ Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -348,7 +417,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 index 15a3838ebc..656177cd9a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 @@ -1,38 +1,60 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADApplication 'AADApp1' { DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAuthenticationContextClassReference 'AADAuthenticationContextClassReference-Test' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Absent"; @@ -51,41 +73,55 @@ ); IsSoftwareOathEnabled = $True; # Updated Property State = "enabled"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { Ensure = "Absent"; Id = "Fido2"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Sms"; } AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "SoftwareOath"; } AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "TemporaryAccessPass"; } AADAuthenticationMethodPolicyVoice 'AADAuthenticationMethodPolicyVoice-Voice' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Voice"; } AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "X509Certificate"; } @@ -93,17 +129,23 @@ { DisplayName = "Example"; Ensure = "Absent"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADConditionalAccessPolicy 'ConditionalAccessPolicy' { DisplayName = 'Example CAP' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADCrossTenantAccessPolicyConfigurationPartner 'AADCrossTenantAccessPolicyConfigurationPartner' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; PartnerTenantId = "12345-12345-12345-12345-12345"; } @@ -111,31 +153,51 @@ { DisplayName = 'Integration Package' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageAssignmentPolicy 'myAssignmentPolicyWithAccessReviewsSettings' { DisplayName = "External tenant"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalog 'myAccessPackageCatalog' { DisplayName = 'My Catalog' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Communication site' + DisplayName = 'DSCGroup' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { DisplayName = "Test Tenant - DSC"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + AADEntitlementManagementRoleAssignment 'AADEntitlementManagementRoleAssignment-Remove' + { + AppScopeId = "/"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + Ensure = "Absent"; + Principal = "AdeleV@$TenantId"; + RoleDefinition = "Catalog creator"; } AADGroup 'MyGroups' { @@ -144,34 +206,44 @@ MailEnabled = $True DisplayName = "DSCGroup" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupsNamingPolicy 'GroupsNamingPolicy' { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupsSettings 'GeneralGroupsSettings' { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADNamedLocationPolicy 'CompanyNetwork' { DisplayName = "Company Network" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleDefinition 'AADRoleDefinition1' { @@ -179,16 +251,20 @@ RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read" DisplayName = "DSCRole1" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleEligibilityScheduleRequest 'MyRequest' { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Absent"; IsValidationOnly = $True; # Updated Property - Principal = "John.Smith@$OrganizationName"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' @@ -204,13 +280,17 @@ AppId = "AppDisplayName" DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADSocialIdentityProvider 'AADSocialIdentityProvider-Google' { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Absent"; IdentityProviderType = "Google"; @@ -219,14 +299,18 @@ { DisplayName = "PolicyDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" DisplayName = "John J. Smith" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -243,7 +327,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index 6954a18b3e..3c148f7c95 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -1,31 +1,61 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' + Description = 'Test Description Updated' # Updated Property + Visibility = 'Public' MembershipRule = "(user.country -eq `"US`")" # Updated Property MembershipRuleProcessingState = 'On' MembershipType = 'Dynamic' - Ensure = 'Present' - Credential = $Credscredential + ScopedRoleMembers = @( + MSFT_MicrosoftGraphScopedRoleMembership + { + RoleName = 'User Administrator' + RoleMemberInfo = MSFT_MicrosoftGraphMember + { + Identity = "AdeleV@$TenantId" # Updated Property + Type = "User" + } + } + ) + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADApplication 'AADApp1' { @@ -33,12 +63,12 @@ AvailableToOtherTenants = $true # Updated Property Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -63,11 +93,15 @@ } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAttributeSet 'AADAttributeSetTest' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; @@ -75,13 +109,26 @@ } AADAuthenticationContextClassReference 'AADAuthenticationContextClassReference-Test' { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Present"; Id = "c3"; IsAvailable = $False; # Updated Property } + AADAuthenticationFlowPolicy 'AADAuthenticationFlowPolicy' + { + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + Description = "Authentication flows policy allows modification of settings related to authentication flows in AAD tenant, such as self-service sign up configuration."; + DisplayName = "Authentication flows policy"; + Id = "authenticationFlowsPolicy"; + IsSingleInstance = "Yes"; + SelfServiceSignUpEnabled = $True; + } AADAuthenticationMethodPolicy 'AADAuthenticationMethodPolicy-Authentication Methods Policy' { DisplayName = "Authentication Methods Policy"; @@ -102,11 +149,15 @@ State = 'default' } }; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAuthenticationMethodPolicyAuthenticator 'AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ @@ -154,7 +205,9 @@ AADAuthenticationMethodPolicyEmail 'AADAuthenticationMethodPolicyEmail-Email' { AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ @@ -177,7 +230,9 @@ } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ @@ -207,7 +262,9 @@ } AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ @@ -226,7 +283,9 @@ } AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ @@ -249,7 +308,9 @@ } AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DefaultLength = 9; # Updated Property DefaultLifetimeInMinutes = 60; Ensure = "Present"; @@ -294,7 +355,9 @@ X509CertificateField = 'SubjectKeyIdentifier' } ); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ @@ -317,7 +380,9 @@ Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADAuthorizationPolicy 'AADAuthPol' { @@ -335,13 +400,17 @@ GuestUserRole = 'Guest' PermissionGrantPolicyIdsAssignedToDefaultUserRole = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADConditionalAccessPolicy 'ConditionalAccessPolicy' { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; @@ -359,7 +428,9 @@ AADCrossTenantAccessPolicy 'AADCrossTenantAccessPolicy' { AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "MyXTAPPolicy"; Ensure = "Present"; IsSingleInstance = "Yes"; @@ -446,7 +517,9 @@ ) } } - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; InboundTrust = MSFT_AADCrossTenantAccessPolicyInboundTrust { IsCompliantDeviceAccepted = $False @@ -482,14 +555,18 @@ ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } AADEntitlementManagementAccessPackage 'myAccessPackage' { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; @@ -521,7 +598,9 @@ IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalog 'myAccessPackageCatalog' { @@ -532,26 +611,27 @@ IsExternallyVisible = $False # Updated Property Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $false # Updated Property - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "DSCGroup"; + OriginSystem = "AADGroup"; + OriginId = '849b3661-61a8-44a8-92e7-fcc91d296235' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "This is the tenant partner - Updated"; # Updated Property DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -559,16 +639,20 @@ odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADExternalIdentityPolicy 'AADExternalIdentityPolicy' { AllowDeletedIdentitiesDataRemoval = $False; AllowExternalIdentitiesToLeave = $True; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint IsSingleInstance = "Yes"; } AADGroup 'MyGroups' @@ -580,18 +664,22 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupsNamingPolicy 'GroupsNamingPolicy' { @@ -599,7 +687,9 @@ CustomBlockedWordsList = @("CEO", "President") PrefixSuffixNamingRequirement = "[Title]Test[Company][GroupName][Office]Redmond" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADGroupsSettings 'GeneralGroupsSettings' { @@ -612,7 +702,9 @@ GuestUsageGuidelinesUrl = "https://contoso.com/guestusage" UsageGuidelinesUrl = "https://contoso.com/usage" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADNamedLocationPolicy 'CompanyNetwork' { @@ -621,7 +713,9 @@ IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleDefinition 'AADRoleDefinition1' { @@ -632,16 +726,20 @@ RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADRoleEligibilityScheduleRequest 'MyRequest' { Action = "AdminUpdate"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:45:44Z' # Updated Property @@ -693,12 +791,16 @@ ExpireEligibleAssignment = "P365D"; PermanentActiveAssignmentisExpirationRequired = $False; PermanentEligibleAssignmentisExpirationRequired = $False; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = 'Present' } AADSecurityDefaults 'Defaults' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Security defaults is a set of basic identity security mechanisms recommended by Microsoft. When enabled, these recommendations will be automatically enforced in your organization. Administrators and users will be better protected from common identity related attacks."; DisplayName = "Security Defaults"; IsEnabled = $False; @@ -711,19 +813,23 @@ AlternativeNames = "AlternativeName1","AlternativeName3" # Updated Property AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADSocialIdentityProvider 'AADSocialIdentityProvider-Google' { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; @@ -733,7 +839,9 @@ IsSingleInstance = 'Yes' TechnicalNotificationMails = "example@contoso.com" MarketingNotificationEmails = "example@contoso.com" - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADTokenLifetimePolicy 'SetTokenLifetimePolicy' { @@ -741,11 +849,13 @@ Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $true # Updated Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -754,7 +864,9 @@ Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -771,7 +883,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index b1b1aca5d5..4c95d77baf 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -1,30 +1,48 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' { @@ -33,7 +51,9 @@ QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { @@ -43,7 +63,9 @@ OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAddressList 'HRUsersAddressList' { @@ -53,7 +75,9 @@ ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' { @@ -78,26 +102,32 @@ EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAntiPhishRule 'ConfigureAntiPhishRule' { Identity = "Test Rule" AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' { @@ -115,14 +145,18 @@ AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "AdeleV@$Domain" + UserName = "AdeleV@$TenantId" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' { @@ -132,13 +166,17 @@ TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'o365dsc.onmicrosoft.com' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "adelev@$Domain" + OrgWideAccount = "adelev@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOClientAccessRule 'ConfigureClientAccessRule' { @@ -156,7 +194,9 @@ ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXODistributionGroup 'DemoDG' { @@ -166,38 +206,44 @@ DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $True BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "" Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOGlobalAddressList 'ConfigureGlobalAddressList' { @@ -207,7 +253,9 @@ ConditionalStateOrProvince = "Washington" IncludedRecipients = 'AllRecipients' Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { @@ -251,18 +299,22 @@ TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' { Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $True - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { @@ -274,22 +326,26 @@ BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 0 - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 0 + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' { Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOInboundConnector 'ConfigureInboundConnector' { @@ -303,7 +359,9 @@ SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' { @@ -312,21 +370,24 @@ TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -336,22 +397,27 @@ ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailTips 'OrgWideMailTips' { IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { @@ -365,7 +431,9 @@ QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { @@ -375,23 +443,29 @@ Enabled = $True RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "" - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AdeleV@$Domain"; + User = "AdeleV@$TenantId"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMessageClassification 'ConfigureMessageClassification' { @@ -404,7 +478,9 @@ SenderDescription = "Shown to senders" RetainClassificationEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' { @@ -463,7 +539,9 @@ UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { @@ -472,7 +550,9 @@ DiffRetentionPeriod = "30" IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOMEConfiguration 'ConfigureOMEConfiguration' { @@ -486,7 +566,9 @@ PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' { @@ -498,7 +580,9 @@ OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DependsOn = "[EXOOutboundConnector]OutboundDependency" } EXOOutboundConnector 'OutboundDependency' @@ -517,7 +601,9 @@ TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOrganizationRelationship 'ConfigureOrganizationRelationship' { @@ -535,7 +621,9 @@ TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { @@ -613,7 +701,9 @@ WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOPartnerApplication 'ConfigurePartnerApplication' { @@ -622,17 +712,21 @@ AcceptSecurityIdentifierInformation = $true Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOPlace 'TestPlace' { AudioDeviceName = "MyAudioDevice"; Capacity = 15; City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -645,23 +739,29 @@ Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy." Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORecipientPermission 'AddSendAs' { - Identity = "AlexW@$Domain" - Trustee = "admin@$Domain" + Identity = "AlexW@$TenantId" + Trustee = "admin@$TenantId" AccessRights = 'SendAs' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORemoteDomain '583b0b70-b45d-401f-98a6-0e7fa8434946' { @@ -686,7 +786,9 @@ TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { @@ -695,7 +797,9 @@ IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORoleGroup 'ConfigureRoleGroup' { @@ -704,27 +808,33 @@ Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' { Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' { Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' { @@ -736,27 +846,33 @@ EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeLinksRule 'ConfigureSafeLinksRule' { Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSharingPolicy 'ConfigureSharingPolicy' { @@ -765,19 +881,23 @@ Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -794,7 +914,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Remove.Tests.ps1 new file mode 100644 index 0000000000..7c897b2a25 --- /dev/null +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Remove.Tests.ps1 @@ -0,0 +1,569 @@ + param + ( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + + Configuration Master + { + param + ( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + + Import-DscResource -ModuleName Microsoft365DSC + $Domain = $TenantId + Node Localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = $TenantId + DomainType = "Authoritative" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + AntiPhishPolicy = "Our Rule" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Integration Policy" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV@$TenantId" + AuthenticationPolicyName = "Test Policy" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + Ensure = 'Absent' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$TenantId" # Updated Property + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + Identity = "Always Allow Remote PowerShell" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXODistributionGroup 'DemoDG' + { + DisplayName = "My Demo DG"; + Ensure = "Absent"; + Identity = "DemoDG"; + Name = "DemoDG"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + Identity = $TenantId + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Integration CFR" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Enabled = $False # Updated Property + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Integration Inbound Connector" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOJournalRule 'CreateJournalRule' + { + JournalEmailAddress = "AdeleV@$TenantId" + Name = "Send to Adele" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + DisplayName = 'My Test Contact' + Ensure = 'Absent' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + Name = 'My Test Contact' + OrganizationalUnit = $TenantId + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMailTips 'OrgWideMailTips' + { + IsSingleInstance = 'Yes' + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOManagementRoleAssignment 'AssignManagementRole' + { + Ensure = "Absent"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + Enabled = $True + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Absent' + Identity = "Hood@$TenantId"; + } + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + Identity = "$TenantId\IntegrationPolicy"; + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXORecipientPermission 'AddSendAs' + { + + Identity = 'AdeleV@$Domain' + Trustee = "admin@$TenantId" + Ensure = 'Absent' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXORemoteDomain '583b0b70-b45d-401f-98a6-0e7fa8434946' + { + Identity = "Integration" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + Ensure = 'Absent' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + SafeLinksPolicy = "Marketing Block URL" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Integration" + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") + Alias = "IntegrationSM" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + Enabled = $True + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + } + } + + $ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = "Localhost" + PSDSCAllowPlaintextPassword = $true + } + ) + } + + # Compile and deploy configuration + try + { + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint + Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Update.Tests.ps1 index 8b35477834..01140822ab 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Update.Tests.ps1 @@ -1,30 +1,48 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' { @@ -33,7 +51,9 @@ QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { @@ -43,7 +63,9 @@ OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAddressList 'HRUsersAddressList' { @@ -53,7 +75,9 @@ ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' { @@ -78,7 +102,9 @@ EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAntiPhishRule 'ConfigureAntiPhishRule' { @@ -86,26 +112,32 @@ Comments = "This is an updated comment." # Updated Property AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAtpPolicyForO365 'ConfigureAntiPhishPolicy' { IsSingleInstance = "Yes" EnableATPForSPOTeamsODB = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' { @@ -123,7 +155,9 @@ AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' { @@ -133,13 +167,17 @@ TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'contoso.onmicrosoft.com' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "alexW@$Domain" # Updated Property + OrgWideAccount = "alexW@$TenantId" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOCalendarProcessing 'CalendarProcessing' { @@ -156,7 +194,6 @@ BookingWindowInDays = 180; BookInPolicy = @(); ConflictPercentageAllowed = 0; - Credential = $credsCredential; DeleteAttachments = $True; DeleteComments = $True; DeleteNonCalendarItems = $True; @@ -167,7 +204,7 @@ EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "admin@$Domain"; + Identity = "admin@$TenantId"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -178,10 +215,13 @@ RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("AlexW@$Domain"); + RequestInPolicy = @("AlexW@$TenantId"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOCASMailboxPlan 'ConfigureCASMailboxPlan' { @@ -191,7 +231,9 @@ Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOCASMailboxSettings 'AdeleVCasMailboxSettings' { @@ -202,7 +244,7 @@ ActiveSyncMailboxPolicy = 'Default' ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True - Identity = "admin@$Domain" + Identity = "admin@$TenantId" ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' @@ -223,7 +265,9 @@ ShowGalAsDefaultView = $True UniversalOutlookEnabled = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOClientAccessRule 'ConfigureClientAccessRule' { @@ -241,7 +285,9 @@ ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXODataClassification 'ConfigureDataClassification' { @@ -251,7 +297,9 @@ IsDefault = $True; Locale = "en-US"; Name = "Canada Social Insurance Number"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXODistributionGroup 'DemoDG' { @@ -261,38 +309,44 @@ DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $False # Updated Property BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "Department -eq 'Sales'" # Updated Property Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOGlobalAddressList 'ConfigureGlobalAddressList' { @@ -301,7 +355,9 @@ ConditionalDepartment = "Finances" # Updated Property ConditionalStateOrProvince = "Washington" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOGroupSettings 'TestGroup' { @@ -312,7 +368,6 @@ AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; ConnectorsEnabled = $False; # Updated Property - Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -321,9 +376,12 @@ MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@$Domain"; + PrimarySmtpAddress = "TestGroup@$TenantId"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' { @@ -334,7 +392,9 @@ IPBlockList = @() MakeDefault = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { @@ -378,18 +438,22 @@ TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' { Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { @@ -401,22 +465,26 @@ BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 1 # Updated Property - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 1 # Updated Property + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' { Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $False # Updated Property - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOInboundConnector 'ConfigureInboundConnector' { @@ -430,7 +498,9 @@ SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' { @@ -439,7 +509,9 @@ TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOIRMConfiguration 'ConfigureIRMConfiguration' { @@ -458,23 +530,26 @@ SimplifiedClientAccessEncryptOnlyDisabled = $True TransportDecryptionSetting = 'Mandatory' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOJournalRule 'CreateJournalRule' { Enabled = $False # Updated Property - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailboxAutoReplyConfiguration 'EXOMailboxAutoReplyConfiguration' { AutoDeclineFutureRequestsWhenOOF = $False; AutoReplyState = "Disabled"; CreateOOFEvent = $False; - Credential = $Credscredential; DeclineAllEventsForScheduledOOF = $False; DeclineEventsForScheduledOOF = $False; DeclineMeetingMessage = ""; @@ -482,31 +557,38 @@ Ensure = "Present"; ExternalAudience = "All"; ExternalMessage = (New-Guid).ToString(); # Updated Property - Identity = "AdeleV@$Domain"; + Identity = "AdeleV@$TenantId"; InternalMessage = ""; OOFEventSubject = ""; StartTime = "1/22/2024 3:00:00 PM"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailboxCalendarFolder 'JohnCalendarFolder' { - Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "AlexW@$Domain" + ":\Calendar"; + Identity = "AlexW@$TenantId" + ":\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailboxPermission 'TestPermission' { AccessRights = @("FullAccess","ReadPermission"); - Credential = $credsCredential; Deny = $True; # Updated Property Ensure = "Present"; - Identity = "AlexW@$Domain"; + Identity = "AlexW@$TenantId"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailboxPlan 'ConfigureMailboxPlan' { @@ -519,7 +601,9 @@ ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailboxSettings 'OttawaTeamMailboxSettings' { @@ -527,12 +611,13 @@ TimeZone = 'Eastern Standard Time' Locale = 'en-US' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -542,22 +627,27 @@ ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $false # Updated Property CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMailTips 'OrgWideMailTips' { - Organization = $Domain + IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $False # Updated Property - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { @@ -571,7 +661,9 @@ QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { @@ -581,23 +673,37 @@ Enabled = $False # Updated Property RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "Updated Description" # Updated Property - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AlexW@$Domain"; # Updated Property + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } + EXOManagementRoleEntry 'UpdateRoleEntry' + { + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + Identity = "Information Rights Management\Get-BookingMailbox" + Parameters = @("ANR","RecipientTypeDetails", "ResultSize") } EXOMessageClassification 'ConfigureMessageClassification' { @@ -610,7 +716,9 @@ SenderDescription = "Shown to senders" RetainClassificationEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' { @@ -669,7 +777,9 @@ UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { @@ -678,7 +788,9 @@ DiffRetentionPeriod = "60" # Updated Property IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOMEConfiguration 'ConfigureOMEConfiguration' { @@ -692,7 +804,9 @@ PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' { @@ -704,7 +818,9 @@ OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOrganizationConfig 'EXOOrganizationConfig' { @@ -769,7 +885,9 @@ AutoExpandingArchive = $null ConnectorsEnabledForSharepoint = $True ReadTrackingEnabled = $False - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOrganizationRelationship 'ConfigureOrganizationRelationship' { @@ -787,7 +905,9 @@ TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOutboundConnector 'ConfigureOutboundConnector' { @@ -805,7 +925,9 @@ TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { @@ -883,7 +1005,9 @@ WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOPartnerApplication 'ConfigurePartnerApplication' { @@ -892,24 +1016,30 @@ AcceptSecurityIdentifierInformation = $False # Updated Property Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOPerimeterConfiguration 'ConfigurePerimeterConfiguration' { IsSingleInstance = 'Yes' #GatewayIPAddresses = '123.0.0.1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOPlace 'TestPlace' { AudioDeviceName = "MyAudioDevice"; Capacity = 16; # Updated Property City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -922,15 +1052,19 @@ Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $True; # Updated Property - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORemoteDomain '583b0b70-b45d-401f-98a6-0e7fa8434946' { @@ -955,7 +1089,9 @@ TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOReportSubmissionPolicy 'ConfigureReportSubmissionPolicy' { @@ -972,7 +1108,9 @@ ReportNotJunkToCustomizedAddress = $False ReportPhishToCustomizedAddress = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOReportSubmissionRule 'ConfigureReportSubmissionRule' { @@ -981,14 +1119,18 @@ Comments = "This is my default rule" SentTo = "submission@contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOResourceConfiguration 'ConfigureResourceConfiguration' { IsSingleInstance = 'Yes' ResourcePropertySchema = @('Room/TV', 'Equipment/Laptop') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { @@ -997,7 +1139,9 @@ IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXORoleGroup 'ConfigureRoleGroup' { @@ -1006,27 +1150,33 @@ Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' { Identity = "Marketing Block Attachments" Enable = $False # Updated Property Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' { Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' { @@ -1038,27 +1188,33 @@ EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSafeLinksRule 'ConfigureSafeLinksRule' { Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain", "IntegrationSM2@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOSharingPolicy 'ConfigureSharingPolicy' { @@ -1067,7 +1223,9 @@ Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOTransportConfig 'EXOTransportConfig ' { @@ -1093,19 +1251,23 @@ ReplyAllStormProtectionEnabled = $True; Rfc2231EncodingEnabled = $False; SmtpClientAuthenticationDisabled = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -1122,7 +1284,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.INTUNE.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.INTUNE.Create.Tests.ps1 index 71cbbb9dc0..1254e45f14 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.INTUNE.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.INTUNE.Create.Tests.ps1 @@ -1,21 +1,37 @@ param ( [Parameter()] - [System.Management.Automation.PSCredential] - $Credential + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Configuration Master { param ( - [Parameter(Mandatory = $true)] - [System.Management.Automation.PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] + $Domain = $TenantId Node Localhost { IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy 'My Account Protection LAPS Policy' @@ -23,7 +39,6 @@ DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -34,13 +49,15 @@ PasswordAgeDays_AAD = 10; AdministratorAccountName = "Administrator"; PasswordAgeDays = 20; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAccountProtectionLocalUserGroupMembershipPolicy 'My Account Protection Local User Group Membership Policy' { DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalUserGroupMembershipPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -55,6 +72,9 @@ UserSelectionType = 'users' } ); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAccountProtectionPolicy 'myAccountProtectionPolicy' { @@ -64,7 +84,9 @@ PinMinimumLength = 5 PinSpecialCharactersUsage = 'required' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAntivirusPolicyWindows10SettingCatalog 'myAVWindows10Policy' { @@ -80,11 +102,12 @@ excludedprocesses = @('processes.exe', 'process2.exe') templateId = '45fea5e9-280d-4da1-9792-fb5736da0ca9_1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAppConfigurationDevicePolicy 'IntuneAppConfigurationDevicePolicy-Example' { - Credential = $Credscredential; Assignments = @(); Description = ""; DisplayName = "Example"; @@ -97,13 +120,14 @@ ProfileApplicability = "default" RoleScopeTagIds = @("0"); TargetedMobileApps = @("<Mobile App Id>"); - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAppConfigurationPolicy 'AddAppConfigPolicy' { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; CustomSettings = @( MSFT_IntuneAppConfigurationPolicyCustomSetting { name = 'com.microsoft.intune.mam.managedbrowser.BlockListURLs' @@ -118,6 +142,9 @@ value = 'TestValue' }); Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneApplicationControlPolicyWindows10 'ConfigureApplicationControlPolicyWindows10' { @@ -127,7 +154,9 @@ SmartScreenBlockOverrideForFiles = $True SmartScreenEnableInShell = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAppProtectionPolicyAndroid 'ConfigureAppProtectionPolicyAndroid' { @@ -152,7 +181,9 @@ SaveAsBlocked = $True SimplePinBlocked = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAppProtectionPolicyiOS 'MyCustomiOSPolicy' { @@ -181,7 +212,9 @@ SaveAsBlocked = $True SimplePinBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneASRRulesPolicyWindows10 'myASRRulesPolicy' { @@ -208,7 +241,9 @@ UntrustedExecutableType = 'block' UntrustedUSBProcessType = 'block' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager 'myASRReductionRules' { @@ -216,7 +251,9 @@ blockadobereaderfromcreatingchildprocesses = "block"; Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceAndAppManagementAssignmentFilter 'AssignmentFilter' { @@ -225,14 +262,18 @@ Platform = 'windows10AndLater' Rule = "(device.manufacturer -ne `"Microsoft Corporation`")" Ensure = 'Present' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCategory 'ConfigureDeviceCategory' { DisplayName = 'Contoso' Description = 'Contoso Category' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyAndroid 'AddDeviceCompliancePolicy' { @@ -258,7 +299,9 @@ SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyAndroidDeviceOwner 'ConfigureAndroidDeviceCompliancePolicyOwner' { @@ -279,7 +322,9 @@ PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyAndroidWorkProfile 'ConfigureAndroidDeviceCompliancePolicyWorkProfile' { @@ -303,7 +348,9 @@ SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyiOs 'ConfigureDeviceCompliancePolicyiOS' { @@ -324,8 +371,9 @@ DeviceThreatProtectionRequiredSecurityLevel = 'medium' ManagedEmailProfileRequired = $True Ensure = 'Present' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyMacOS 'ConfigureDeviceCompliancePolicyMacOS' { @@ -349,7 +397,9 @@ FirewallBlockAllIncoming = $False FirewallEnableStealthMode = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceCompliancePolicyWindows10 'ConfigureDeviceCompliancePolicyWindows10' { @@ -388,11 +438,12 @@ deviceCompliancePolicyScript = $null ValidOperatingSystemBuildRanges = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments { @@ -514,6 +565,9 @@ DisplayName = 'admin template' Ensure = 'Present' PolicyConfigurationIngestionType = 'unknown' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationCustomPolicyWindows10 'Example' { @@ -523,7 +577,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; OmaSettings = @( @@ -547,6 +600,9 @@ } ); SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10 'Example' { @@ -560,10 +616,12 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; EnableExpeditedTelemetryReporting = $True; Ensure = "Present"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10 'Example' { @@ -582,7 +640,6 @@ CacheServerBackgroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerForegroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerHostNames = @("domain.com"); - Credential = $Credscredential; DeliveryOptimizationMode = "httpWithPeeringPrivateGroup"; DisplayName = "delivery optimisation"; Ensure = "Present"; @@ -604,6 +661,9 @@ RestrictPeerSelectionBy = "subnetMask"; SupportsScopeTags = $True; VpnPeerCaching = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationDomainJoinPolicyWindows10 'Example' { @@ -616,11 +676,13 @@ ); ComputerNameStaticPrefix = "WK-"; ComputerNameSuffixRandomCharCount = 12; - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Present"; OrganizationalUnit = "OU=workstation,CN=domain,CN=com"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationEmailProfilePolicyWindows10 'Example' { @@ -631,7 +693,6 @@ dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "email"; DurationOfEmailToSync = "unlimited"; EmailAddressSource = "primarySmtpAddress"; @@ -642,6 +703,9 @@ SyncCalendar = $True; SyncContacts = $True; SyncTasks = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationEndpointProtectionPolicyWindows10 'Example' { @@ -708,7 +772,6 @@ StartupAuthenticationTpmKeyUsage = 'allowed' StartupAuthenticationBlockWithoutTpmChip = $False }; - Credential = $Credscredential; DefenderAdditionalGuardedFolders = @(); DefenderAdobeReaderLaunchChildProcess = "notConfigured"; DefenderAdvancedRansomewareProtectionType = "notConfigured"; @@ -870,6 +933,9 @@ XboxServicesLiveAuthManagerServiceStartupMode = "manual"; XboxServicesLiveGameSaveServiceStartupMode = "manual"; XboxServicesLiveNetworkingServiceStartupMode = "manual"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10 'Example' { @@ -884,7 +950,6 @@ BootFromExternalMedia = "notConfigured"; Cameras = "enabled"; ChangeUefiSettingsPermission = "notConfiguredOnly"; - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Present"; FrontCamera = "enabled"; @@ -904,6 +969,9 @@ WiFi = "notConfigured"; WindowsPlatformBinaryTable = "enabled"; WirelessWideAreaNetwork = "notConfigured"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10 'Example' { @@ -915,10 +983,12 @@ } ); ConfigDeviceHealthMonitoringScope = @("bootPerformance","windowsUpdates"); - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Present"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationIdentityProtectionPolicyWindows10 'Example' { @@ -928,7 +998,6 @@ dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "identity protection"; EnhancedAntiSpoofingForFacialFeaturesEnabled = $True; Ensure = "Present"; @@ -946,6 +1015,9 @@ UseCertificatesForOnPremisesAuthEnabled = $True; UseSecurityKeyForSignin = $True; WindowsHelloForBusinessBlocked = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10 'Example' { @@ -957,7 +1029,6 @@ ); CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 1; - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Present"; IntendedPurpose = "unassigned"; @@ -965,6 +1036,9 @@ RenewalThresholdPercentage = 50; SubjectAlternativeNameType = "emailAddress"; SubjectNameFormat = "commonName"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationKioskPolicyWindows10 'Example' { @@ -974,7 +1048,6 @@ dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "kiosk"; EdgeKioskEnablePublicBrowsing = $False; Ensure = "Present"; @@ -1014,6 +1087,9 @@ Recurrence = 'daily' DayofWeek = 'sunday' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 'Example' { @@ -1023,7 +1099,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Present"; SupportsScopeTags = $True; @@ -1042,6 +1117,9 @@ ) NeutralDomainResources = @() }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPkcsCertificatePolicyWindows10 'Example' { @@ -1057,7 +1135,6 @@ CertificateValidityPeriodValue = 1; CertificationAuthority = "CA=Name"; CertificationAuthorityName = "Test"; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -1071,6 +1148,9 @@ SubjectAlternativeNameType = "none"; SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPlatformScriptMacOS 'Example' { @@ -1080,7 +1160,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; BlockExecutionNotifications = $False; @@ -1092,7 +1171,9 @@ RoleScopeTagIds = @("0"); RunAsAccount = "user"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPlatformScriptWindows 'Example' { @@ -1102,7 +1183,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; EnforceSignatureCheck = $False; @@ -1111,7 +1191,9 @@ RunAs32Bit = $True; RunAsAccount = "system"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator 'myAndroidDeviceAdmin' { @@ -1171,7 +1253,9 @@ WebBrowserCookieSettings = 'allowAlways' WiFiBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyAndroidDeviceOwner 'myAndroidDeviceOwnerPolicy' { @@ -1217,7 +1301,9 @@ WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfilePasswordRequireUnlock = 'deviceDefault' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyAndroidOpenSourceProject 'myAndroidOpenSourceProjectPolicy' { @@ -1234,7 +1320,9 @@ ScreenCaptureBlocked = $True StorageBlockExternalMedia = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyAndroidWorkProfile '97ed22e9-1429-40dc-ab3c-0055e538383b' { @@ -1260,7 +1348,9 @@ WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfileRequirePassword = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyiOS 'ConfigureDeviceConfigurationPolicyiOS' { @@ -1373,7 +1463,9 @@ VoiceDialingBlocked = $False WallpaperBlockModification = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyMacOS 'myMacOSDevicePolicy' { @@ -1470,7 +1562,9 @@ UpdateDelayPolicy = @('delayOSUpdateVisibility', 'delayAppUpdateVisibility', 'delayMajorOsUpdateVisibility') WallpaperModificationBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationPolicyWindows10 'Example' { @@ -1505,7 +1599,6 @@ ConnectedDevicesServiceBlocked = $False; CopyPasteBlocked = $False; CortanaBlocked = $False; - Credential = $Credscredential; CryptographyAllowFipsAlgorithmPolicy = $False; DefenderBlockEndUserAccess = $False; DefenderBlockOnAccessProtection = $False; @@ -1725,6 +1818,9 @@ WirelessDisplayBlockProjectionToThisDevice = $False; WirelessDisplayBlockUserInputFromReceiver = $False; WirelessDisplayRequirePinForPairing = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationScepCertificatePolicyWindows10 'Example' { @@ -1737,7 +1833,6 @@ CertificateStore = "user"; CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 5; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -1762,6 +1857,9 @@ SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; RootCertificateId = "169bf4fc-5914-40f4-ad33-48c225396183"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationSecureAssessmentPolicyWindows10 'Example' { @@ -1777,11 +1875,13 @@ ); ConfigurationAccount = "user@domain.com"; ConfigurationAccountType = "azureADAccount"; - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Present"; LaunchUri = "https://assessment.domain.com"; LocalGuestAccountName = ""; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10 'Example' { @@ -1798,7 +1898,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisableAccountManager = $False; DisableEduPolicies = $False; DisablePowerPolicies = $False; @@ -1814,6 +1913,9 @@ SetEduPolicies = "enabled"; SetPowerPolicies = "enabled"; SignInOnResume = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationTrustedCertificatePolicyWindows10 'Example' { @@ -1824,11 +1926,13 @@ } ); CertFileName = "RootCA.cer"; - Credential = $Credscredential; DestinationStore = "computerCertStoreRoot"; DisplayName = "Trusted Cert"; Ensure = "Present"; TrustedRootCertificate = "MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA="; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationVpnPolicyWindows10 'Example' { @@ -1841,7 +1945,6 @@ AuthenticationMethod = "usernameAndPassword"; ConnectionName = "Cisco VPN"; ConnectionType = "ciscoAnyConnect"; - Credential = $Credscredential; CustomXml = ""; DisplayName = "VPN"; DnsRules = @( @@ -1889,6 +1992,9 @@ } ); TrustedNetworkDomains = @(); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationWindowsTeamPolicyWindows10 'Example' { @@ -1900,7 +2006,6 @@ ); AzureOperationalInsightsBlockTelemetry = $True; ConnectAppBlockAutoLaunch = $True; - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Present"; MaintenanceWindowBlocked = $False; @@ -1915,6 +2020,9 @@ SupportsScopeTags = $True; WelcomeScreenBlockAutomaticWakeUp = $True; WelcomeScreenMeetingInformation = "showOrganizerAndTimeOnly"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceConfigurationWiredNetworkPolicyWindows10 'Example' { @@ -1931,7 +2039,6 @@ AuthenticationRetryDelayPeriodInSeconds = 5 AuthenticationType = 'machine' CacheCredentials = $True - Credential = $Credscredential DisplayName = 'Wired Network' EapolStartPeriodInSeconds = 5 EapType = 'teap' @@ -1943,6 +2050,9 @@ TrustedServerCertificateNames = @('srv.domain.com') RootCertificatesForServerValidationIds = @('a485d322-13cd-43ef-beda-733f656f48ea', '169bf4fc-5914-40f4-ad33-48c225396183') SecondaryIdentityCertificateForClientAuthenticationId = '0b9aef2f-1671-4260-8eb9-3ab3138e176a' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceEnrollmentLimitRestriction 'DeviceEnrollmentLimitRestriction' { @@ -1950,7 +2060,9 @@ Description = 'My Restriction' Limit = 12 Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceEnrollmentPlatformRestriction 'DeviceEnrollmentPlatformRestriction' { @@ -1967,7 +2079,6 @@ deviceAndAppManagementAssignmentFilterType = 'none' dataType = '#microsoft.graph.allDevicesAssignmentTarget' }); - Credential = $Credscredential Description = "This is the default Device Type Restriction applied with the lowest priority to all users regardless of group membership."; DeviceEnrollmentConfigurationType = "platformRestrictions"; DisplayName = "All users and all devices"; @@ -1997,6 +2108,9 @@ platformBlocked = $False personalDeviceEnrollmentBlocked = $False }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceEnrollmentStatusPageWindows10 '6b43c039-c1d0-4a9f-aab9-48c5531acbd6' { @@ -2022,7 +2136,9 @@ SelectedMobileAppIds = @(); ShowInstallationProgress = $True; TrackInstallProgressForAutopilotOnly = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDeviceRemediation 'ConfigureDeviceRemediation' { @@ -2043,7 +2159,6 @@ } } ); - Credential = $Credscredential Description = 'Description' DetectionScriptContent = "Base64 encoded script content"; DeviceHealthScriptType = "deviceHealthScript"; @@ -2056,7 +2171,9 @@ RoleScopeTagIds = @("0"); RunAs32Bit = $True; RunAsAccount = "system"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneDiskEncryptionMacOS 'IntuneDiskEncryptionMacOS' { @@ -2071,7 +2188,26 @@ PersonalRecoveryKeyRotationInMonths = 2; RoleScopeTagIds = @("0"); SelectedRecoveryKeyTypes = @("personalRecoveryKey"); - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments { + deviceAndAppManagementAssignmentFilterType = 'none' + dataType = '#microsoft.graph.allDevicesAssignmentTarget' + }) + Description = '' + IdentificationField_Name = '1' + IdentificationField = 'IdentificationField' + SecIdentificationField = 'SecIdentificationField' + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneEndpointDetectionAndResponsePolicyWindows10 'myEDRPolicy' { @@ -2079,7 +2215,9 @@ Assignments = @() Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneExploitProtectionPolicyWindows10SettingCatalog 'myWindows10ExploitProtectionPolicy' { @@ -2238,11 +2376,12 @@ </AppConfig> </MitigationPolicy>" Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntunePolicySets 'Example' { - Credential = $Credscredential; Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -2269,6 +2408,9 @@ } ); RoleScopeTags = @("0","1"); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneRoleAssignment 'IntuneRoleAssignment' { @@ -2282,7 +2424,9 @@ RoleDefinition = '2d00d0fd-45e9-4166-904f-b76ac5eed2c7' RoleDefinitionDisplayName = 'This is my role' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneRoleDefinition 'IntuneRoleDefinition' { @@ -2293,7 +2437,9 @@ notallowedResourceActions = @() roleScopeTagIds = @('0', '1') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneSettingCatalogASRRulesPolicyWindows10 'myASRRulesPolicy' { @@ -2308,11 +2454,12 @@ blockexecutablefilesrunningunlesstheymeetprevalenceagetrustedlistcriterion = 'audit' Description = 'Post' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -2381,6 +2528,9 @@ } ); Technologies = "mdm"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWiFiConfigurationPolicyAndroidDeviceAdministrator 'myWifiConfigAndroidDevicePolicy' { @@ -2397,7 +2547,9 @@ Ssid = 'sf' WiFiSecurityType = 'wpaEnterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner 'myWifiConfigAndroidDeviceOwnerPolicy' { @@ -2416,7 +2568,9 @@ ProxySettings = 'none' Ssid = 'MySSID - 3' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile 'myWifiConfigAndroidWorkProfilePolicy' { @@ -2434,7 +2588,9 @@ Ssid = 'MySSID' WiFiSecurityType = 'open' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyAndroidForWork 'Example' { @@ -2455,7 +2611,9 @@ Ssid = 'WiFi' WiFiSecurityType = 'wpa2Enterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyAndroidOpenSourceProject 'myWifiConfigAndroidOpensourcePolicy' { @@ -2473,7 +2631,9 @@ Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyIOS 'myWifiConfigIOSPolicy' { @@ -2493,7 +2653,9 @@ Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyMacOS 'myWifiConfigMacOSPolicy' { @@ -2512,7 +2674,9 @@ Ssid = 'aaaaaaaaaaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWifiConfigurationPolicyWindows10 'myWifiConfigWindows10Policy' { @@ -2534,12 +2698,13 @@ Ssid = 'ssid' WifiSecurityType = 'wpa2Personal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { Assignments = @(); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = ""; DeviceType = "windowsPc"; @@ -2557,6 +2722,9 @@ SkipKeyboardSelectionPage = $False UserType = 'standard' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsAutopilotDeploymentProfileAzureADJoined 'Example' { @@ -2566,7 +2734,6 @@ dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = "test"; DeviceType = "windowsPc"; @@ -2583,6 +2750,9 @@ SkipKeyboardSelectionPage = $True UserType = 'administrator' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled 'Example' { @@ -2620,7 +2790,9 @@ ProtectionUnderLockConfigRequired = $False RevokeOnUnenrollDisabled = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10 'Example' { @@ -2629,7 +2801,9 @@ Description = 'test 2' approvalType = 'manual' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10 'Example' { @@ -2641,7 +2815,31 @@ OfferStartDateTimeInUTC = '2023-02-03T16:00:00.0000000+00:00' } Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments{ + deviceAndAppManagementAssignmentFilterType = 'none' + groupDisplayName = 'Exclude' + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '258a1749-8408-4dd0-8028-fab6208a28d7' + } + ); + DisplayName = 'Windows Quality Update' + Description = '' + ExpeditedUpdateSettings = MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings{ + QualityUpdateRelease = '2024-06-11T00:00:00Z' + DaysUntilForcedReboot = 0 + } + RoleScopeTagIds = @("0") + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10 'Example' { @@ -2685,7 +2883,9 @@ UserPauseAccess = 'enabled' UserWindowsUpdateScanAccess = 'enabled' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -2702,7 +2902,7 @@ # Compile and deploy configuration try { - Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Master -ConfigurationData $ConfigurationData -ApplicationId $ApplicationId -TenantId $TenantId -CertificateThumbprint $CertificateThumbprint Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop } catch diff --git a/Tests/QA/Graph.PermissionList.txt b/Tests/QA/Graph.PermissionList.txt new file mode 100644 index 0000000000..c93a18fc24 Binary files /dev/null and b/Tests/QA/Graph.PermissionList.txt differ diff --git a/Tests/QA/Microsoft365DSC.Examples.Tests.ps1 b/Tests/QA/Microsoft365DSC.Examples.Tests.ps1 index 41f93e594f..4b1344bdd0 100644 --- a/Tests/QA/Microsoft365DSC.Examples.Tests.ps1 +++ b/Tests/QA/Microsoft365DSC.Examples.Tests.ps1 @@ -153,6 +153,10 @@ Describe -Name 'Successfully compile examples' { #> $exampleParameters.Add($parameterName, ('1' -as $parameterType)) } + elseif ($parameterName -eq 'TenantId') + { + $exampleParameters.Add('TenantId', (New-Guid).ToString()) + } } } diff --git a/Tests/QA/Microsoft365DSC.SettingsJson.Tests.ps1 b/Tests/QA/Microsoft365DSC.SettingsJson.Tests.ps1 index de2e26c128..06b77a0418 100644 --- a/Tests/QA/Microsoft365DSC.SettingsJson.Tests.ps1 +++ b/Tests/QA/Microsoft365DSC.SettingsJson.Tests.ps1 @@ -17,32 +17,8 @@ Describe -Name 'Successfully import Settings.json files' { Describe -Name 'Successfully validate all used permissions in Settings.json files ' { BeforeAll { - $allModules = Get-module Microsoft.graph.* -ListAvailable - $allPermissions = @() - foreach ($module in $allModules) - { - $cmds = Get-Command -Module $module.Name - foreach ($cmd in $cmds) - { - $graphInfo = Find-MgGraphCommand -Command $cmd.Name -ErrorAction SilentlyContinue - if ($null -ne $graphInfo) - { - $permissions = $graphInfo.Permissions | Where-Object -FilterScript {$_.PermissionType -eq 'Application'} - $allPermissions += $permissions.Name - } - } - } - - $allPermissions+= @('OrgSettings-Microsoft365Install.Read.All', ` - 'OrgSettings-Forms.Read.All', ` - 'OrgSettings-Todo.Read.All', ` - 'OrgSettings-AppsAndServices.Read.All', ` - 'OrgSettings-DynamicsVoice.Read.All', ` - 'ReportSettings.Read.All', ` - 'RoleManagementPolicy.Read.Directory', ` - 'RoleEligibilitySchedule.Read.Directory', ` - 'Agreement.Read.All') - $roles = $allPermissions | Select-Object -Unique | Sort-Object -Descending:$false + $permissionsFile = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Tests\QA\Graph.PermissionList.txt' + $roles = (Get-Content $permissionsFile -Raw).Split(',') } It "Permissions used in settings.json file for '<ResourceName>' should exist" -TestCases $settingsFiles { diff --git a/Tests/TestHarness.psm1 b/Tests/TestHarness.psm1 index 646022d9af..ecc798f884 100644 --- a/Tests/TestHarness.psm1 +++ b/Tests/TestHarness.psm1 @@ -126,6 +126,51 @@ function Invoke-TestHarness return $results } +function Get-M365DSCAllGraphPermissionsList +{ + [CmdletBinding()] + [OutputType([System.String[]])] + param() + + $allModules = Get-module Microsoft.graph.* -ListAvailable + $allPermissions = @() + foreach ($module in $allModules) + { + $cmds = Get-Command -Module $module.Name + foreach ($cmd in $cmds) + { + $graphInfo = Find-MgGraphCommand -Command $cmd.Name -ErrorAction SilentlyContinue + if ($null -ne $graphInfo) + { + $permissions = $graphInfo.Permissions | Where-Object -FilterScript {$_.PermissionType -eq 'Application'} + $allPermissions += $permissions.Name + } + } + } + + $allPermissions+= @('OrgSettings-Microsoft365Install.Read.All', ` + 'OrgSettings-Forms.Read.All', ` + 'OrgSettings-Todo.Read.All', ` + 'OrgSettings-AppsAndServices.Read.All', ` + 'OrgSettings-DynamicsVoice.Read.All', ` + 'ReportSettings.Read.All', ` + 'RoleManagementPolicy.Read.Directory', ` + 'RoleEligibilitySchedule.Read.Directory', ` + 'Agreement.Read.All', ` + 'Policy.ReadWrite.ConditionalAccess', ` + 'Policy.Read.ConditionalAccess', ` + 'Policy.ReadWrite.AuthenticationMethod', ` + 'SharePointTenantSettings.Read.All', ` + 'AppCatalog.ReadWrite.All', ` + 'TeamSettings.ReadWrite.All', ` + 'Channel.Delete.All', ` + 'ChannelSettings.ReadWrite.All', ` + 'ChannelMember.ReadWrite.All', ` + 'ChannelSettings.Read.All') + $roles = $allPermissions | Select-Object -Unique | Sort-Object -Descending:$false + return $roles +} + function Invoke-QualityChecksHarness { [CmdletBinding()] diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDeviceConfigurationEmailProfilePolicyWindows10.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDeviceConfigurationEmailProfilePolicyWindows10.Tests.ps1 index 2b699602e9..390bac5e29 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDeviceConfigurationEmailProfilePolicyWindows10.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDeviceConfigurationEmailProfilePolicyWindows10.Tests.ps1 @@ -127,15 +127,14 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { emailAddressSource = "userPrincipalName" durationOfEmailToSync = "userDefined" syncCalendar = $True + customDomainName = "FakeStringValue" + userDomainNameSource = "fullDomainName" + usernameAADSource = "userPrincipalName" + usernameSource = "userPrincipalName" } - CustomDomainName = "FakeStringValue" Description = "FakeStringValue" DisplayName = "FakeStringValue" Id = "FakeStringValue" - UserDomainNameSource = "fullDomainName" - UsernameAADSource = "userPrincipalName" - UsernameSource = "userPrincipalName" - } } } @@ -189,15 +188,14 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { emailAddressSource = "userPrincipalName" durationOfEmailToSync = "userDefined" syncCalendar = $True + customDomainName = "FakeStringValue" + userDomainNameSource = "fullDomainName" + usernameAADSource = "userPrincipalName" + usernameSource = "userPrincipalName" } - CustomDomainName = "FakeStringValue" Description = "FakeStringValue" DisplayName = "FakeStringValue" Id = "FakeStringValue" - UserDomainNameSource = "fullDomainName" - UsernameAADSource = "userPrincipalName" - UsernameSource = "userPrincipalName" - } } } @@ -240,14 +238,14 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { emailSyncSchedule = "userDefined" emailAddressSource = "userPrincipalName" durationOfEmailToSync = "userDefined" + customDomainName = "FakeStringValue" + userDomainNameSource = "fullDomainName" + usernameAADSource = "userPrincipalName" + usernameSource = "userPrincipalName" } - CustomDomainName = "FakeStringValue" Description = "FakeStringValue" DisplayName = "FakeStringValue" Id = "FakeStringValue" - UserDomainNameSource = "fullDomainName" - UsernameAADSource = "userPrincipalName" - UsernameSource = "userPrincipalName" } } } @@ -287,15 +285,14 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { emailAddressSource = "userPrincipalName" durationOfEmailToSync = "userDefined" syncCalendar = $True + customDomainName = "FakeStringValue" + userDomainNameSource = "fullDomainName" + usernameAADSource = "userPrincipalName" + usernameSource = "userPrincipalName" } - CustomDomainName = "FakeStringValue" Description = "FakeStringValue" DisplayName = "FakeStringValue" Id = "FakeStringValue" - UserDomainNameSource = "fullDomainName" - UsernameAADSource = "userPrincipalName" - UsernameSource = "userPrincipalName" - } } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDiskEncryptionWindows10.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDiskEncryptionWindows10.Tests.ps1 new file mode 100644 index 0000000000..ad519f9c47 --- /dev/null +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneDiskEncryptionWindows10.Tests.ps1 @@ -0,0 +1,541 @@ +[CmdletBinding()] +param( +) +$M365DSCTestFolder = Join-Path -Path $PSScriptRoot ` + -ChildPath '..\..\Unit' ` + -Resolve +$CmdletModule = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\Stubs\Microsoft365.psm1' ` + -Resolve) +$GenericStubPath = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\Stubs\Generic.psm1' ` + -Resolve) +Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\UnitTestHelper.psm1' ` + -Resolve) + +$Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` + -DscResource "IntuneDiskEncryptionWindows10" -GenericStubModule $GenericStubPath +Describe -Name $Global:DscHelper.DescribeHeader -Fixture { + InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { + Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope + BeforeAll { + + $secpasswd = ConvertTo-SecureString (New-Guid | Out-String) -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) + + Mock -CommandName Confirm-M365DSCDependencies -MockWith { + } + + Mock -CommandName Get-PSSession -MockWith { + } + + Mock -CommandName Remove-PSSession -MockWith { + } + + Mock -CommandName New-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return @{ + Id = '619bd4a4-3b3b-4441-bd6f-3f4c0c444870' + } + } + + Mock -CommandName Remove-MgBetaDeviceManagementConfigurationPolicy -MockWith { + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + } + + Mock -CommandName Update-IntuneDeviceConfigurationPolicy -MockWith { + } + + Mock -CommandName Get-IntuneSettingCatalogPolicySetting -MockWith { + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicySetting -MockWith { + return ,@() + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicyAssignment -MockWith { + return @(@{ + Id = '12345-12345-12345-12345-12345' + Source = 'direct' + SourceId = '12345-12345-12345-12345-12345' + Target = @{ + DeviceAndAppManagementAssignmentFilterId = '12345-12345-12345-12345-12345' + DeviceAndAppManagementAssignmentFilterType = 'none' + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } + ) + } + }) + } + + Mock -CommandName Update-DeviceConfigurationPolicyAssignment -MockWith { + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credentials" + } + + # Mock Write-Host to hide output during the tests + Mock -CommandName Write-Host -MockWith { + } + $Script:exportedInstances =$null + $Script:ExportMode = $false + } + # Test contexts + Context -Name "The IntuneDiskEncryptionWindows10 should exist but it DOES NOT" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + DataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } -ClientOnly) + ) + Description = "FakeStringValue" + DisplayName = "FakeStringValue" + Id = "FakeStringValue" + IdentificationField_Name = "1" + IdentificationField = "Field" + SecIdentificationField = "SecField" + RoleScopeTagIds = @("FakeStringValue") + Ensure = "Present" + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return $null + } + } + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Absent' + } + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + It 'Should Create the group from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName New-MgBetaDeviceManagementConfigurationPolicy -Exactly 1 + } + } + + Context -Name "The IntuneDiskEncryptionWindows10 exists but it SHOULD NOT" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + DataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } -ClientOnly) + ) + Description = "FakeStringValue" + DisplayName = "FakeStringValue" + Id = "FakeStringValue" + IdentificationField_Name = "1" + IdentificationField = "Field" + SecIdentificationField = "SecField" + RoleScopeTagIds = @("FakeStringValue") + Ensure = 'Absent' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return @{ + Description = "FakeStringValue" + Id = "FakeStringValue" + Name = "FakeStringValue" + RoleScopeTagIds = @("FakeStringValue") + TemplateReference = @{ + TemplateId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + } + } + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicySetting -MockWith { + return @{ + Id = '0' + SettingDefinitions = @( + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + Name = 'IdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield' + Name = 'IdentificationField_Name' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + Name = 'SecIdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + } + ) + SettingInstance = @{ + SettingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield' + SettingInstanceTemplateReference = @{ + SettingInstanceTemplateId = '3aeb9145-2c02-4086-8886-44dbe09c2f62' + } + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance' + choiceSettingValue = @( + @{ + children = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'Field' + } + }, + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'SecField' + } + } + ) + value = 'device_vendor_msft_bitlocker_identificationfield_1' + } + ) + } + ) + } + AdditionalProperties = @{} + } + } + } + + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return true from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should Remove the group from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Remove-MgBetaDeviceManagementConfigurationPolicy -Exactly 1 + } + } + Context -Name "The IntuneDiskEncryptionWindows10 Exists and Values are already in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + DataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } -ClientOnly) + ) + Description = "FakeStringValue" + DisplayName = "FakeStringValue" + Id = "FakeStringValue" + IdentificationField_Name = "1" + IdentificationField = "Field" + SecIdentificationField = "SecField" + RoleScopeTagIds = @("FakeStringValue") + Ensure = 'Present' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return @{ + Description = "FakeStringValue" + Id = "FakeStringValue" + Name = "FakeStringValue" + RoleScopeTagIds = @("FakeStringValue") + TemplateReference = @{ + TemplateId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + } + } + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicySetting -MockWith { + return @{ + Id = '0' + SettingDefinitions = @( + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + Name = 'IdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield' + Name = 'IdentificationField_Name' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + Name = 'SecIdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + } + ) + SettingInstance = @{ + SettingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield' + SettingInstanceTemplateReference = @{ + SettingInstanceTemplateId = '3aeb9145-2c02-4086-8886-44dbe09c2f62' + } + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance' + choiceSettingValue = @( + @{ + children = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'Field' + } + }, + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'SecField' + } + } + ) + value = 'device_vendor_msft_bitlocker_identificationfield_1' + } + ) + } + ) + } + AdditionalProperties = @{} + } + } + } + + It 'Should return true from the Test method' { + Test-TargetResource @testParams | Should -Be $true + } + } + + Context -Name "The IntuneDiskEncryptionWindows10 exists and values are NOT in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + DataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } -ClientOnly) + ) + Description = "FakeStringValue" + Id = "FakeStringValue" + IdentificationField_Name = "1" + IdentificationField = "Field" + SecIdentificationField = "SecField" + DisplayName = "FakeStringValue" + RoleScopeTagIds = @("FakeStringValue") + Ensure = 'Present' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return @{ + Description = "FakeStringValue" + Id = "FakeStringValue" + Name = "FakeStringValue" + RoleScopeTagIds = @("FakeStringValue") + TemplateReference = @{ + TemplateId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + } + } + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicySetting -MockWith { + return @{ + Id = '0' + SettingDefinitions = @( + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + Name = 'IdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield' + Name = 'IdentificationField_Name' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + Name = 'SecIdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + } + ) + SettingInstance = @{ + SettingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield' + SettingInstanceTemplateReference = @{ + SettingInstanceTemplateId = '3aeb9145-2c02-4086-8886-44dbe09c2f62' + } + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance' + choiceSettingValue = @( + @{ + children = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'ChangedValue' #drift + } + }, + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'SecField' + } + } + ) + value = 'device_vendor_msft_bitlocker_identificationfield_1' + } + ) + } + ) + } + AdditionalProperties = @{} + } + } + } + + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should call the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Update-IntuneDeviceConfigurationPolicy -Exactly 1 + } + } + + Context -Name 'ReverseDSC Tests' -Fixture { + BeforeAll { + $Global:CurrentModeIsExport = $true + $Global:PartialExportFileName = "$(New-Guid).partial.ps1" + $testParams = @{ + Credential = $Credential + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicy -MockWith { + return @{ + Description = "FakeStringValue" + Id = "FakeStringValue" + Name = "FakeStringValue" + RoleScopeTagIds = @("FakeStringValue") + TemplateReference = @{ + TemplateId = '46ddfc50-d10f-4867-b852-9434254b3bff_1' + } + } + } + + Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicySetting -MockWith { + return @{ + Id = '0' + SettingDefinitions = @( + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + Name = 'IdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield' + Name = 'IdentificationField_Name' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition' + } + }, + @{ + Id = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + Name = 'SecIdentificationField' + AdditionalProperties = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition' + } + } + ) + SettingInstance = @{ + SettingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield' + SettingInstanceTemplateReference = @{ + SettingInstanceTemplateId = '3aeb9145-2c02-4086-8886-44dbe09c2f62' + } + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance' + choiceSettingValue = @( + @{ + children = @( + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_identificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'Field' + } + }, + @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance' + settingDefinitionId = 'device_vendor_msft_bitlocker_identificationfield_secidentificationfield' + simpleSettingValue = @{ + '@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingValue' + value = 'SecField' + } + } + ) + value = 'device_vendor_msft_bitlocker_identificationfield_1' + } + ) + } + ) + } + AdditionalProperties = @{} + } + } + } + It 'Should Reverse Engineer resource from the Export method' { + $result = Export-TargetResource @testParams + $result | Should -Not -BeNullOrEmpty + } + } + } +} + +Invoke-Command -ScriptBlock $Global:DscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.Tests.ps1 new file mode 100644 index 0000000000..e6538a3cc9 --- /dev/null +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.Tests.ps1 @@ -0,0 +1,286 @@ +[CmdletBinding()] +param( +) +$M365DSCTestFolder = Join-Path -Path $PSScriptRoot ` + -ChildPath '..\..\Unit' ` + -Resolve +$CmdletModule = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\Stubs\Microsoft365.psm1' ` + -Resolve) +$GenericStubPath = (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\Stubs\Generic.psm1' ` + -Resolve) +Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` + -ChildPath '\UnitTestHelper.psm1' ` + -Resolve) + +$Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` + -DscResource "IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10" -GenericStubModule $GenericStubPath +Describe -Name $Global:DscHelper.DescribeHeader -Fixture { + InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { + Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope + BeforeAll { + + $secpasswd = ConvertTo-SecureString (New-Guid | Out-String) -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) + + Mock -CommandName Confirm-M365DSCDependencies -MockWith { + } + + Mock -CommandName Get-PSSession -MockWith { + } + + Mock -CommandName Remove-PSSession -MockWith { + } + + Mock -CommandName Update-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + } + + Mock -CommandName New-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + } + + Mock -CommandName Remove-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + } + + Mock -CommandName New-M365DSCConnection -MockWith { + return "Credentials" + } + + # Mock Write-Host to hide output during the tests + Mock -CommandName Write-Host -MockWith { + } + $Script:exportedInstances =$null + $Script:ExportMode = $false + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfileAssignment -MockWith { + return @(@{ + Id = '12345-12345-12345-12345-12345' + Source = 'direct' + SourceId = '12345-12345-12345-12345-12345' + Target = @{ + DeviceAndAppManagementAssignmentFilterId = $null + DeviceAndAppManagementAssignmentFilterType = 'none' + AdditionalProperties = @( + @{ + '@odata.type' = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + } + ) + } + }) + } + + Mock -CommandName Update-DeviceConfigurationPolicyAssignment -MockWith { + } + + } + # Test contexts + Context -Name "The IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 should exist but it DOES NOT" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + deviceAndAppManagementAssignmentFilterType = 'none' + } -ClientOnly) + ) + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings -Property @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } -ClientOnly) + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + Ensure = "Present" + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + return $null + } + } + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Absent' + } + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + It 'Should Create the group from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName New-MgBetaDeviceManagementWindowsQualityUpdateProfile -Exactly 1 + } + } + + Context -Name "The IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 exists but it SHOULD NOT" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + deviceAndAppManagementAssignmentFilterType = 'none' + } -ClientOnly) + ) + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings -Property @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } -ClientOnly) + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + Ensure = 'Absent' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + return @{ + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + } + } + } + + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return true from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should Remove the group from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Remove-MgBetaDeviceManagementWindowsQualityUpdateProfile -Exactly 1 + } + } + Context -Name "The IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 Exists and Values are already in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + deviceAndAppManagementAssignmentFilterType = 'none' + } -ClientOnly) + ) + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings -Property @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } -ClientOnly) + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + Ensure = 'Present' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + return @{ + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + } + } + } + + It 'Should return true from the Test method' { + Test-TargetResource @testParams | Should -Be $true + } + } + + Context -Name "The IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 exists and values are NOT in the desired state" -Fixture { + BeforeAll { + $testParams = @{ + Assignments = [CimInstance[]]@( + (New-CimInstance -ClassName MSFT_DeviceManagementConfigurationPolicyAssignments -Property @{ + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '26d60dd1-fab6-47bf-8656-358194c1a49d' + deviceAndAppManagementAssignmentFilterType = 'none' + } -ClientOnly) + ) + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings -Property @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } -ClientOnly) + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + Ensure = 'Present' + Credential = $Credential; + } + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + return @{ + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = @{ + DaysUntilForcedReboot = 1 #drift + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + } + } + } + + It 'Should return Values from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should call the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Update-MgBetaDeviceManagementWindowsQualityUpdateProfile -Exactly 1 + } + } + + Context -Name 'ReverseDSC Tests' -Fixture { + BeforeAll { + $Global:CurrentModeIsExport = $true + $Global:PartialExportFileName = "$(New-Guid).partial.ps1" + $testParams = @{ + Credential = $Credential + } + + Mock -CommandName Get-MgBetaDeviceManagementWindowsQualityUpdateProfile -MockWith { + return @{ + Description = "Description" + DisplayName = "IntuneQualityUpdate" + ExpeditedUpdateSettings = @{ + DaysUntilForcedReboot = 0 + QualityUpdateRelease = "2024-06-11T00:00:00Z" + } + Id = "FakeStringValue" + RoleScopeTagIds = @("0") + } + } + } + + It 'Should Reverse Engineer resource from the Export method' { + $result = Export-TargetResource @testParams + $result | Should -Not -BeNullOrEmpty + } + } + } +} + +Invoke-Command -ScriptBlock $Global:DscHelper.CleanupScript -NoNewScope diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index 272d7224d3..39fc971c0f 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -84694,3 +84694,432 @@ function Set-ExternalInOutlook #endregion +#region MgBetaDeviceManagementWindowsQualityUpdateProfile +function Get-MgBetaDeviceManagementWindowsQualityUpdateProfile +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $WindowsQualityUpdateProfileId, + + [Parameter()] + [PSObject] + $InputObject, + + [Parameter()] + [System.String[]] + $ExpandProperty, + + [Parameter()] + [System.String[]] + $Property, + + [Parameter()] + [System.String] + $Filter, + + [Parameter()] + [System.String] + $Search, + + [Parameter()] + [System.Int32] + $Skip, + + [Parameter()] + [System.String[]] + $Sort, + + [Parameter()] + [System.Int32] + $Top, + + [Parameter()] + [System.String] + $ResponseHeadersVariable, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Break, + + [Parameter()] + [System.Collections.IDictionary] + $Headers, + + [Parameter()] + [PSObject[]] + $HttpPipelineAppend, + + [Parameter()] + [PSObject[]] + $HttpPipelinePrepend, + + [Parameter()] + [System.Uri] + $Proxy, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ProxyCredential, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $ProxyUseDefaultCredentials, + + [Parameter()] + [System.Int32] + $PageSize, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $All, + + [Parameter()] + [System.String] + $CountVariable + ) +} + +function New-MgBetaDeviceManagementWindowsQualityUpdateProfile +{ + [CmdletBinding()] + param + ( + [Parameter()] + [PSObject] + $BodyParameter, + + [Parameter()] + [System.String] + $ResponseHeadersVariable, + + [Parameter()] + [System.Collections.Hashtable] + $AdditionalProperties, + + [Parameter()] + [PSObject[]] + $Assignments, + + [Parameter()] + [System.DateTime] + $CreatedDateTime, + + [Parameter()] + [System.String] + $DeployableContentDisplayName, + + [Parameter()] + [System.String] + $Description, + + [Parameter()] + [System.String] + $DisplayName, + + [Parameter()] + [PSObject] + $ExpeditedUpdateSettings, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [System.DateTime] + $LastModifiedDateTime, + + [Parameter()] + [System.String] + $ReleaseDateDisplayName, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Break, + + [Parameter()] + [System.Collections.IDictionary] + $Headers, + + [Parameter()] + [PSObject[]] + $HttpPipelineAppend, + + [Parameter()] + [PSObject[]] + $HttpPipelinePrepend, + + [Parameter()] + [System.Uri] + $Proxy, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ProxyCredential, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $ProxyUseDefaultCredentials, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm + ) +} + +function Remove-MgBetaDeviceManagementWindowsQualityUpdateProfile +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $WindowsQualityUpdateProfileId, + + [Parameter()] + [PSObject] + $InputObject, + + [Parameter()] + [System.String] + $ResponseHeadersVariable, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Break, + + [Parameter()] + [System.Collections.IDictionary] + $Headers, + + [Parameter()] + [PSObject[]] + $HttpPipelineAppend, + + [Parameter()] + [PSObject[]] + $HttpPipelinePrepend, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $PassThru, + + [Parameter()] + [System.Uri] + $Proxy, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ProxyCredential, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $ProxyUseDefaultCredentials, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm + ) +} + +function Update-MgBetaDeviceManagementWindowsQualityUpdateProfile +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $WindowsQualityUpdateProfileId, + + [Parameter()] + [PSObject] + $InputObject, + + [Parameter()] + [PSObject] + $BodyParameter, + + [Parameter()] + [System.String] + $ResponseHeadersVariable, + + [Parameter()] + [System.Collections.Hashtable] + $AdditionalProperties, + + [Parameter()] + [PSObject[]] + $Assignments, + + [Parameter()] + [System.DateTime] + $CreatedDateTime, + + [Parameter()] + [System.String] + $DeployableContentDisplayName, + + [Parameter()] + [System.String] + $Description, + + [Parameter()] + [System.String] + $DisplayName, + + [Parameter()] + [PSObject] + $ExpeditedUpdateSettings, + + [Parameter()] + [System.String] + $Id, + + [Parameter()] + [System.DateTime] + $LastModifiedDateTime, + + [Parameter()] + [System.String] + $ReleaseDateDisplayName, + + [Parameter()] + [System.String[]] + $RoleScopeTagIds, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Break, + + [Parameter()] + [System.Collections.IDictionary] + $Headers, + + [Parameter()] + [PSObject[]] + $HttpPipelineAppend, + + [Parameter()] + [PSObject[]] + $HttpPipelinePrepend, + + [Parameter()] + [System.Uri] + $Proxy, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ProxyCredential, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $ProxyUseDefaultCredentials, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm + ) +} + +#endregion + +#region MgBetaDeviceManagementWindowsQualityUpdateProfileAssignment +function Get-MgBetaDeviceManagementWindowsQualityUpdateProfileAssignment +{ + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $WindowsQualityUpdateProfileAssignmentId, + + [Parameter()] + [System.String] + $WindowsQualityUpdateProfileId, + + [Parameter()] + [PSObject] + $InputObject, + + [Parameter()] + [System.String[]] + $ExpandProperty, + + [Parameter()] + [System.String[]] + $Property, + + [Parameter()] + [System.String] + $Filter, + + [Parameter()] + [System.String] + $Search, + + [Parameter()] + [System.Int32] + $Skip, + + [Parameter()] + [System.String[]] + $Sort, + + [Parameter()] + [System.Int32] + $Top, + + [Parameter()] + [System.String] + $ResponseHeadersVariable, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Break, + + [Parameter()] + [System.Collections.IDictionary] + $Headers, + + [Parameter()] + [PSObject[]] + $HttpPipelineAppend, + + [Parameter()] + [PSObject[]] + $HttpPipelinePrepend, + + [Parameter()] + [System.Uri] + $Proxy, + + [Parameter()] + [System.Management.Automation.PSCredential] + $ProxyCredential, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $ProxyUseDefaultCredentials, + + [Parameter()] + [System.Int32] + $PageSize, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $All, + + [Parameter()] + [System.String] + $CountVariable + ) +} + +#endregion + diff --git a/docs/docs/resources/azure-ad/AADActivityBasedTimeoutPolicy.md b/docs/docs/resources/azure-ad/AADActivityBasedTimeoutPolicy.md index 4a0bbe08ae..a6e6de26d7 100644 --- a/docs/docs/resources/azure-ad/AADActivityBasedTimeoutPolicy.md +++ b/docs/docs/resources/azure-ad/AADActivityBasedTimeoutPolicy.md @@ -58,9 +58,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -73,7 +81,9 @@ Configuration Example DisplayName = "displayName-value"; Ensure = "Present"; Id = "000000-0000-0000-0000-000000000000"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAdministrativeUnit.md b/docs/docs/resources/azure-ad/AADAdministrativeUnit.md index 2aae9da6fb..89dd351064 100644 --- a/docs/docs/resources/azure-ad/AADAdministrativeUnit.md +++ b/docs/docs/resources/azure-ad/AADAdministrativeUnit.md @@ -81,15 +81,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' @@ -105,12 +111,14 @@ Configuration Example RoleName = 'User Administrator' RoleMemberInfo = MSFT_MicrosoftGraphMember { - Identity = "admin@$Domain" + Identity = "admin@$TenantId" Type = "User" } } ) - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -124,22 +132,28 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' Description = 'Test Description Updated' # Updated Property - Visibility = 'HiddenMembership' # Updated Property + Visibility = 'Public' MembershipRule = "(user.country -eq `"US`")" # Updated Property MembershipRuleProcessingState = 'On' MembershipType = 'Dynamic' @@ -149,12 +163,14 @@ Configuration Example RoleName = 'User Administrator' RoleMemberInfo = MSFT_MicrosoftGraphMember { - Identity = "AdeleV@$Domain" # Updated Property + Identity = "AdeleV@$TenantId" # Updated Property Type = "User" } } ) - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -168,22 +184,30 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADAdministrativeUnit 'TestUnit' { DisplayName = 'Test-Unit' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADApplication.md b/docs/docs/resources/azure-ad/AADApplication.md index 395275f43d..00a9a29f14 100644 --- a/docs/docs/resources/azure-ad/AADApplication.md +++ b/docs/docs/resources/azure-ad/AADApplication.md @@ -80,13 +80,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADApplication 'AADApp1' @@ -95,12 +101,12 @@ Configuration Example AvailableToOtherTenants = $false Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -125,7 +131,9 @@ Configuration Example } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -140,13 +148,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADApplication 'AADApp1' @@ -155,12 +170,12 @@ Configuration Example AvailableToOtherTenants = $true # Updated Property Description = "Application Description" GroupMembershipClaims = "None" - Homepage = "https://$Domain" - IdentifierUris = "https://$Domain" + Homepage = "https://$TenantId" + IdentifierUris = "https://$TenantId" KnownClientApplications = "" - LogoutURL = "https://$Domain/logout" + LogoutURL = "https://$TenantId/logout" PublicClient = $false - ReplyURLs = "https://$Domain" + ReplyURLs = "https://$TenantId" Permissions = @( MSFT_AADApplicationPermission { @@ -185,7 +200,9 @@ Configuration Example } ) Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -200,9 +217,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -212,7 +237,9 @@ Configuration Example { DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAttributeSet.md b/docs/docs/resources/azure-ad/AADAttributeSet.md index 5d02ffe128..a867a28c04 100644 --- a/docs/docs/resources/azure-ad/AADAttributeSet.md +++ b/docs/docs/resources/azure-ad/AADAttributeSet.md @@ -57,11 +57,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -70,7 +77,9 @@ Configuration Example { AADAttributeSet "AADAttributeSetTest" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; @@ -88,11 +97,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -101,7 +117,9 @@ Configuration Example { AADAttributeSet "AADAttributeSetTest" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Attribute set with 420 attributes"; Ensure = "Present"; Id = "TestAttributeSet"; diff --git a/docs/docs/resources/azure-ad/AADAuthenticationContextClassReference.md b/docs/docs/resources/azure-ad/AADAuthenticationContextClassReference.md index a8a87315ab..88af7e9605 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationContextClassReference.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationContextClassReference.md @@ -58,11 +58,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +78,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test"; DisplayName = "My Context"; Ensure = "Present"; @@ -90,11 +99,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -103,7 +119,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Present"; @@ -122,11 +140,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -135,7 +160,9 @@ Configuration Example { AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Test" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Context test Updated"; # Updated Property DisplayName = "My Context"; Ensure = "Absent"; diff --git a/docs/docs/resources/azure-ad/AADAuthenticationFlowPolicy.md b/docs/docs/resources/azure-ad/AADAuthenticationFlowPolicy.md index 581a0a6598..cf53b3ae11 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationFlowPolicy.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationFlowPolicy.md @@ -8,7 +8,7 @@ | **Id** | Write | String | Unique identifier of the Authentication Flow Policy. | | | **DisplayName** | Write | String | Display name of the Authentication Flow Policy. | | | **Description** | Write | String | Description of the Authentication Flow Policy. | | -| **SelfServiceSignUpEnabled** | Write | String | Indicates whether self-service sign-up flow is enabled or disabled. The default value is false. This property isn't a key. Required. | | +| **SelfServiceSignUpEnabled** | Write | Boolean | Indicates whether self-service sign-up flow is enabled or disabled. The default value is false. This property isn't a key. Required. | | | **Credential** | Write | PSCredential | Credentials of the Azure Active Directory Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | @@ -57,8 +57,17 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { param( - [System.Management.Automation.PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -67,7 +76,9 @@ Configuration Example { { AADAuthenticationFlowPolicy "AADAuthenticationFlowPolicy" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Authentication flows policy allows modification of settings related to authentication flows in AAD tenant, such as self-service sign up configuration."; DisplayName = "Authentication flows policy"; Id = "authenticationFlowsPolicy"; diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicy.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicy.md index ef058b60eb..fd9fa85e4c 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicy.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicy.md @@ -128,11 +128,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -158,7 +165,9 @@ Configuration Example State = 'default' } }; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md index 95f6bf00db..ceb80457e4 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md @@ -108,11 +108,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -120,7 +127,9 @@ Configuration Example { AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ @@ -181,11 +190,18 @@ Configuration Example Node localhost { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" { @@ -199,7 +215,9 @@ Configuration Example ); IsSoftwareOathEnabled = $True; # Updated Property State = "enabled"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md index 46a93f4da3..e8bd849084 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md @@ -77,11 +77,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -90,7 +97,9 @@ Configuration Example AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" { AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md index 60952ecc93..6828d7d951 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md @@ -89,11 +89,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -101,7 +108,9 @@ Configuration Example { AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ @@ -145,17 +154,26 @@ Configuration Example Node localhost { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" { Ensure = "Absent"; Id = "Fido2"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md index 5a4c79bb7e..e6c30d33f2 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md @@ -76,11 +76,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -88,7 +95,9 @@ Configuration Example { AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ @@ -117,11 +126,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -129,7 +145,9 @@ Configuration Example { AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Sms"; } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md index ddbcf3cc12..b29a65aad3 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md @@ -76,11 +76,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -88,7 +95,9 @@ Configuration Example { AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ @@ -121,11 +130,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -133,7 +149,9 @@ Configuration Example { AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "SoftwareOath"; } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md index 3a3e50f23b..3c4f8b4c4e 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md @@ -81,11 +81,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -93,7 +100,9 @@ Configuration Example { AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DefaultLength = 9; # Updated Property DefaultLifetimeInMinutes = 60; Ensure = "Present"; @@ -127,11 +136,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +155,9 @@ Configuration Example { AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "TemporaryAccessPass"; } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md index 96f900b4fa..a76a6370ef 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md @@ -77,11 +77,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -89,7 +96,9 @@ Configuration Example { AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "Voice"; } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md index 5789bc2a27..19440efafb 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md @@ -108,11 +108,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -141,7 +148,9 @@ Configuration Example X509CertificateField = 'SubjectKeyIdentifier' } ); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; ExcludeTargets = @( MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ @@ -182,7 +191,9 @@ Configuration Example { AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" { - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; Id = "X509Certificate"; } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationStrengthPolicy.md b/docs/docs/resources/azure-ad/AADAuthenticationStrengthPolicy.md index c984932e90..97e991de71 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationStrengthPolicy.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationStrengthPolicy.md @@ -58,11 +58,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -74,7 +81,9 @@ Configuration Example Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -88,11 +97,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -104,7 +120,9 @@ Configuration Example Description = "This is an example"; DisplayName = "Example"; Ensure = "Present"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -118,11 +136,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -132,7 +157,9 @@ Configuration Example { DisplayName = "Example"; Ensure = "Absent"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADAuthorizationPolicy.md b/docs/docs/resources/azure-ad/AADAuthorizationPolicy.md index 3fab6e12e0..48e254f332 100644 --- a/docs/docs/resources/azure-ad/AADAuthorizationPolicy.md +++ b/docs/docs/resources/azure-ad/AADAuthorizationPolicy.md @@ -83,11 +83,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -110,7 +117,9 @@ Configuration Example GuestUserRole = 'Guest' PermissionGrantPolicyIdsAssignedToDefaultUserRole = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md index 166950184d..6c9999834d 100644 --- a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md @@ -98,11 +98,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -112,7 +119,9 @@ Configuration Example { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; @@ -139,11 +148,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -153,7 +169,9 @@ Configuration Example { BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; DisplayName = "Example CAP"; @@ -180,11 +198,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -194,7 +219,9 @@ Configuration Example { DisplayName = 'Example CAP' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md index b8a35807d8..d696e17aa7 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md @@ -58,9 +58,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -69,7 +77,9 @@ Configuration Example AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" { AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "MyXTAPPolicy"; Ensure = "Present"; IsSingleInstance = "Yes"; diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md index c7641d1bfe..ab8bb5d801 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md @@ -98,9 +98,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -188,7 +196,9 @@ Configuration Example ) } } - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; InboundTrust = MSFT_AADCrossTenantAccessPolicyInboundTrust { IsCompliantDeviceAccepted = $False diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationPartner.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationPartner.md index de93aeb652..f864be9bd8 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationPartner.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationPartner.md @@ -108,9 +108,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -143,7 +151,9 @@ Configuration Example ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } } @@ -159,9 +169,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -194,7 +212,9 @@ Configuration Example ) } }; - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; } } @@ -210,9 +230,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -220,7 +248,9 @@ Configuration Example { AADCrossTenantAccessPolicyConfigurationPartner "AADCrossTenantAccessPolicyConfigurationPartner" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; PartnerTenantId = "12345-12345-12345-12345-12345"; } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md index 8e7e27ec9a..0c50a322d3 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md @@ -75,9 +75,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -87,7 +95,9 @@ Configuration Example { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; @@ -107,9 +117,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -119,7 +137,9 @@ Configuration Example { AccessPackagesIncompatibleWith = @(); CatalogId = "General"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Integration Tests"; DisplayName = "Integration Package"; Ensure = "Present"; @@ -139,9 +159,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -151,7 +179,9 @@ Configuration Example { DisplayName = 'Integration Package' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageAssignmentPolicy.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageAssignmentPolicy.md index cd39b938da..1ef0cf133d 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageAssignmentPolicy.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageAssignmentPolicy.md @@ -183,9 +183,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -216,7 +224,9 @@ Configuration Example IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -231,9 +241,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -264,7 +282,9 @@ Configuration Example IsApprovalRequiredForExtension = $False }; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -279,9 +299,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -291,7 +319,9 @@ Configuration Example { DisplayName = "External tenant"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalog.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalog.md index 98cf826d55..2c8685fc73 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalog.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalog.md @@ -61,9 +61,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -78,7 +86,9 @@ Configuration Example IsExternallyVisible = $True Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -93,9 +103,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -110,7 +128,9 @@ Configuration Example IsExternallyVisible = $False # Updated Property Managedidentity = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -125,9 +145,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -137,7 +165,9 @@ Configuration Example { DisplayName = 'My Catalog' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalogResource.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalogResource.md index 9b8c17ab51..6477f179a4 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalogResource.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackageCatalogResource.md @@ -140,27 +140,47 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { + AADGroup 'DependantGroup' + { + DisplayName = "MyGroup" + Description = "Microsoft DSC Group" + SecurityEnabled = $True + MailEnabled = $True + GroupTypes = @("Unified") + MailNickname = "MyGroup" + Visibility = "Private" + Ensure = "Present" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint + } AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $true - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "MyGroup"; + OriginSystem = "AADGroup"; + OriginId = 'MyGroup' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } } } @@ -175,27 +195,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Human Resources' - CatalogId = 'My Catalog' - Description = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - IsPendingOnboarding = $false # Updated Property - OriginId = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - OriginSystem = 'SharePointOnline' - ResourceType = 'SharePoint Online Site' - Url = "https://$($Domain.Split('.')[0]).sharepoint.com/sites/HumanResources" - Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + CatalogId = "My Catalog"; + CertificateThumbprint = $CertificateThumbprint; + DisplayName = "DSCGroup"; + OriginSystem = "AADGroup"; + OriginId = '849b3661-61a8-44a8-92e7-fcc91d296235' + Ensure = "Present"; + IsPendingOnboarding = $False; + TenantId = $TenantId; } } } @@ -210,9 +236,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -220,9 +254,11 @@ Configuration Example { AADEntitlementManagementAccessPackageCatalogResource 'myAccessPackageCatalogResource' { - DisplayName = 'Communication site' + DisplayName = 'DSCGroup' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementConnectedOrganization.md b/docs/docs/resources/azure-ad/AADEntitlementManagementConnectedOrganization.md index aa89bc9871..7c614518b6 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementConnectedOrganization.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementConnectedOrganization.md @@ -75,20 +75,27 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "this is the tenant partner"; DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -96,10 +103,12 @@ Configuration Example odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -114,20 +123,27 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementConnectedOrganization 'MyConnectedOrganization' { Description = "This is the tenant partner - Updated"; # Updated Property DisplayName = "Test Tenant - DSC"; - ExternalSponsors = @("AdeleV@$Domain"); + ExternalSponsors = @("AdeleV@$TenantId"); IdentitySources = @( MSFT_AADEntitlementManagementConnectedOrganizationIdentitySource{ ExternalTenantId = "e7a80bcf-696e-40ca-8775-a7f85fbb3ebc" @@ -135,10 +151,12 @@ Configuration Example odataType = '#microsoft.graph.azureActiveDirectoryTenant' } ); - InternalSponsors = @("AdeleV@$Domain"); + InternalSponsors = @("AdeleV@$TenantId"); State = "configured"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -153,9 +171,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -165,7 +191,9 @@ Configuration Example { DisplayName = "Test Tenant - DSC"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementRoleAssignment.md b/docs/docs/resources/azure-ad/AADEntitlementManagementRoleAssignment.md index 0370fd5913..806f8b1ffe 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementRoleAssignment.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementRoleAssignment.md @@ -60,21 +60,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementRoleAssignment "AADEntitlementManagementRoleAssignment-Create" { AppScopeId = "/"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Present"; - Principal = "John.Smith@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Catalog creator"; } } @@ -90,21 +99,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADEntitlementManagementRoleAssignment "AADEntitlementManagementRoleAssignment-Remove" { AppScopeId = "/"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = "Absent"; - Principal = "John.Smith@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Catalog creator"; } } diff --git a/docs/docs/resources/azure-ad/AADExternalIdentityPolicy.md b/docs/docs/resources/azure-ad/AADExternalIdentityPolicy.md index f44a35cb37..b924f4faaf 100644 --- a/docs/docs/resources/azure-ad/AADExternalIdentityPolicy.md +++ b/docs/docs/resources/azure-ad/AADExternalIdentityPolicy.md @@ -55,11 +55,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -70,7 +77,9 @@ Configuration Example { AllowDeletedIdentitiesDataRemoval = $False; AllowExternalIdentitiesToLeave = $True; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint IsSingleInstance = "Yes"; } } diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index da1d4c8760..c9a32bcf2e 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -81,12 +81,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { @@ -99,9 +106,11 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -116,12 +125,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADGroup 'MyGroups' @@ -133,9 +149,11 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$TenantId", "AdeleV@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -150,9 +168,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -165,7 +191,9 @@ Configuration Example MailEnabled = $True DisplayName = "DSCGroup" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADGroupLifecyclePolicy.md b/docs/docs/resources/azure-ad/AADGroupLifecyclePolicy.md index 0927a1e338..14b00a6227 100644 --- a/docs/docs/resources/azure-ad/AADGroupLifecyclePolicy.md +++ b/docs/docs/resources/azure-ad/AADGroupLifecyclePolicy.md @@ -58,9 +58,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -69,11 +77,13 @@ Configuration Example AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -88,9 +98,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -99,11 +117,13 @@ Configuration Example AADGroupLifecyclePolicy 'GroupLifecyclePolicy' { IsSingleInstance = "Yes" - AlternateNotificationEmails = @("john.smith@contoso.com") + AlternateNotificationEmails = @("john.smith@$TenantId") GroupLifetimeInDays = 99 ManagedGroupTypes = "Selected" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADGroupsNamingPolicy.md b/docs/docs/resources/azure-ad/AADGroupsNamingPolicy.md index 8330417501..eb62239af4 100644 --- a/docs/docs/resources/azure-ad/AADGroupsNamingPolicy.md +++ b/docs/docs/resources/azure-ad/AADGroupsNamingPolicy.md @@ -57,9 +57,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +79,9 @@ Configuration Example CustomBlockedWordsList = @("CEO", "President") PrefixSuffixNamingRequirement = "[Title]Test[Company][GroupName][Office]Redmond" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -86,9 +96,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -98,7 +116,9 @@ Configuration Example { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADGroupsSettings.md b/docs/docs/resources/azure-ad/AADGroupsSettings.md index 38d9bd215c..1bdb022d83 100644 --- a/docs/docs/resources/azure-ad/AADGroupsSettings.md +++ b/docs/docs/resources/azure-ad/AADGroupsSettings.md @@ -66,9 +66,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -85,7 +93,9 @@ Configuration Example GuestUsageGuidelinesUrl = "https://contoso.com/guestusage" UsageGuidelinesUrl = "https://contoso.com/usage" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -100,9 +110,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -112,7 +130,9 @@ Configuration Example { IsSingleInstance = "Yes" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADNamedLocationPolicy.md b/docs/docs/resources/azure-ad/AADNamedLocationPolicy.md index d39f1b3624..543d44d66f 100644 --- a/docs/docs/resources/azure-ad/AADNamedLocationPolicy.md +++ b/docs/docs/resources/azure-ad/AADNamedLocationPolicy.md @@ -62,9 +62,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -77,7 +85,9 @@ Configuration Example IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -92,9 +102,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -107,7 +125,9 @@ Configuration Example IsTrusted = $False OdataType = "#microsoft.graph.ipNamedLocation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -122,9 +142,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -134,7 +162,9 @@ Configuration Example { DisplayName = "Company Network" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADRoleDefinition.md b/docs/docs/resources/azure-ad/AADRoleDefinition.md index ac11d0fee9..0e1833f242 100644 --- a/docs/docs/resources/azure-ad/AADRoleDefinition.md +++ b/docs/docs/resources/azure-ad/AADRoleDefinition.md @@ -65,9 +65,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -82,7 +90,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -97,9 +107,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -114,7 +132,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read","microsoft.directory/applicationPolicies/allProperties/update","microsoft.directory/applicationPolicies/basic/update" Version = "1.0" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -129,9 +149,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -143,7 +171,9 @@ Configuration Example RolePermissions = "microsoft.directory/applicationPolicies/allProperties/read" DisplayName = "DSCRole1" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADRoleEligibilityScheduleRequest.md b/docs/docs/resources/azure-ad/AADRoleEligibilityScheduleRequest.md index 6d64b26924..112b40bd04 100644 --- a/docs/docs/resources/azure-ad/AADRoleEligibilityScheduleRequest.md +++ b/docs/docs/resources/azure-ad/AADRoleEligibilityScheduleRequest.md @@ -138,17 +138,18 @@ Configuration Example Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' @@ -180,17 +181,18 @@ Configuration Example Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminUpdate"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Present"; IsValidationOnly = $False; - Principal = "AdeleV@$Domain"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:45:44Z' # Updated Property @@ -227,11 +229,13 @@ Configuration Example AADRoleEligibilityScheduleRequest "MyRequest" { Action = "AdminAssign"; - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DirectoryScopeId = "/"; Ensure = "Absent"; IsValidationOnly = $True; # Updated Property - Principal = "John.Smith@$OrganizationName"; + Principal = "AdeleV@$TenantId"; RoleDefinition = "Teams Communications Administrator"; ScheduleInfo = MSFT_AADRoleEligibilityScheduleRequestSchedule { startDateTime = '2023-09-01T02:40:44Z' diff --git a/docs/docs/resources/azure-ad/AADRoleSetting.md b/docs/docs/resources/azure-ad/AADRoleSetting.md index 935ca93ce3..33484e1065 100644 --- a/docs/docs/resources/azure-ad/AADRoleSetting.md +++ b/docs/docs/resources/azure-ad/AADRoleSetting.md @@ -99,9 +99,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -148,7 +156,9 @@ Configuration Example ExpireEligibleAssignment = "P365D"; PermanentActiveAssignmentisExpirationRequired = $False; PermanentEligibleAssignmentisExpirationRequired = $False; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Ensure = 'Present' } } diff --git a/docs/docs/resources/azure-ad/AADSecurityDefaults.md b/docs/docs/resources/azure-ad/AADSecurityDefaults.md index 13a46da3f5..ecdda35cdb 100644 --- a/docs/docs/resources/azure-ad/AADSecurityDefaults.md +++ b/docs/docs/resources/azure-ad/AADSecurityDefaults.md @@ -58,9 +58,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -68,7 +76,9 @@ Configuration Example { AADSecurityDefaults 'Defaults' { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Description = "Security defaults is a set of basic identity security mechanisms recommended by Microsoft. When enabled, these recommendations will be automatically enforced in your organization. Administrators and users will be better protected from common identity related attacks."; DisplayName = "Security Defaults"; IsEnabled = $False; diff --git a/docs/docs/resources/azure-ad/AADServicePrincipal.md b/docs/docs/resources/azure-ad/AADServicePrincipal.md index 2bd9e35831..ea0b418f8f 100644 --- a/docs/docs/resources/azure-ad/AADServicePrincipal.md +++ b/docs/docs/resources/azure-ad/AADServicePrincipal.md @@ -79,13 +79,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADServicePrincipal 'AADServicePrincipal' @@ -95,13 +102,15 @@ Configuration Example AlternativeNames = "AlternativeName1","AlternativeName2" AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -116,13 +125,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADServicePrincipal 'AADServicePrincipal' @@ -132,13 +148,15 @@ Configuration Example AlternativeNames = "AlternativeName1","AlternativeName3" # Updated Property AccountEnabled = $true AppRoleAssignmentRequired = $false - Homepage = "https://$Domain" - LogoutUrl = "https://$Domain/logout" - ReplyURLs = "https://$Domain" + Homepage = "https://$TenantId" + LogoutUrl = "https://$TenantId/logout" + ReplyURLs = "https://$TenantId" ServicePrincipalType = "Application" Tags = "{WindowsAzureActiveDirectoryIntegratedApp}" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -153,9 +171,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -166,7 +192,9 @@ Configuration Example AppId = "AppDisplayName" DisplayName = "AppDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADSocialIdentityProvider.md b/docs/docs/resources/azure-ad/AADSocialIdentityProvider.md index f0bf04e72a..2472e76d61 100644 --- a/docs/docs/resources/azure-ad/AADSocialIdentityProvider.md +++ b/docs/docs/resources/azure-ad/AADSocialIdentityProvider.md @@ -60,11 +60,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -75,7 +82,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret"; - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; @@ -92,11 +101,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -107,7 +123,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Present"; IdentityProviderType = "Google"; @@ -124,11 +142,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +164,9 @@ Configuration Example { ClientId = "Google-OAUTH"; ClientSecret = "FakeSecret-Updated"; # Updated Property - Credential = $credsCredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayName = "My Google Provider"; Ensure = "Absent"; IdentityProviderType = "Google"; diff --git a/docs/docs/resources/azure-ad/AADTenantDetails.md b/docs/docs/resources/azure-ad/AADTenantDetails.md index 47f811507a..22b442721c 100644 --- a/docs/docs/resources/azure-ad/AADTenantDetails.md +++ b/docs/docs/resources/azure-ad/AADTenantDetails.md @@ -59,10 +59,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { param( - [System.Management.Automation.PSCredential] - $credsCredential - ) + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + [Parameter()] + [System.String] + $CertificateThumbprint + ) Import-DscResource -ModuleName Microsoft365DSC Node Localhost @@ -72,7 +80,9 @@ Configuration Example { IsSingleInstance = 'Yes' TechnicalNotificationMails = "example@contoso.com" MarketingNotificationEmails = "example@contoso.com" - Credential = $credsCredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADTokenLifetimePolicy.md b/docs/docs/resources/azure-ad/AADTokenLifetimePolicy.md index c52961807a..172290d023 100644 --- a/docs/docs/resources/azure-ad/AADTokenLifetimePolicy.md +++ b/docs/docs/resources/azure-ad/AADTokenLifetimePolicy.md @@ -59,9 +59,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -73,7 +81,9 @@ Configuration Example Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -88,9 +98,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,7 +120,9 @@ Configuration Example Definition = @("{`"TokenLifetimePolicy`":{`"Version`":1,`"AccessTokenLifetime`":`"02:00:00`"}}"); IsOrganizationDefault = $true # Updated Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -117,9 +137,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -129,7 +157,9 @@ Configuration Example { DisplayName = "PolicyDisplayName" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/azure-ad/AADUser.md b/docs/docs/resources/azure-ad/AADUser.md index 7beee6094b..8a53f0316d 100644 --- a/docs/docs/resources/azure-ad/AADUser.md +++ b/docs/docs/resources/azure-ad/AADUser.md @@ -80,18 +80,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -100,7 +107,9 @@ Configuration Example Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -115,18 +124,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" FirstName = "John" LastName = "Smith" DisplayName = "John J. Smith" @@ -135,7 +151,9 @@ Configuration Example Office = "Ottawa - Queen" UsageLocation = "US" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -150,21 +168,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { AADUser 'ConfigureJohnSMith' { - UserPrincipalName = "John.Smith@$Domain" + UserPrincipalName = "John.Smith@$TenantId" DisplayName = "John J. Smith" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAcceptedDomain.md b/docs/docs/resources/exchange/EXOAcceptedDomain.md index 0d42c84531..416f025cc3 100644 --- a/docs/docs/resources/exchange/EXOAcceptedDomain.md +++ b/docs/docs/resources/exchange/EXOAcceptedDomain.md @@ -47,22 +47,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,9 +86,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -87,11 +104,13 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -106,9 +125,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -116,10 +143,12 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = $Domain + Identity = $TenantId DomainType = "Authoritative" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md index 25d5fcb8a2..9676d00d32 100644 --- a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md +++ b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md @@ -46,11 +46,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -63,7 +70,9 @@ Configuration Example QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,11 +86,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -94,7 +110,9 @@ Configuration Example QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -108,11 +126,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +150,9 @@ Configuration Example QueryString = "iOS 6.1 10B145" AccessLevel = "Allow" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAddressBookPolicy.md b/docs/docs/resources/exchange/EXOAddressBookPolicy.md index 5742865e7c..a3d74672e4 100644 --- a/docs/docs/resources/exchange/EXOAddressBookPolicy.md +++ b/docs/docs/resources/exchange/EXOAddressBookPolicy.md @@ -47,11 +47,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -65,7 +72,9 @@ Configuration Example OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -79,11 +88,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -97,7 +113,9 @@ Configuration Example OfflineAddressBook = "\Default Offline Address Book" GlobalAddressList = "\Default Global Address List" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -111,11 +129,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +150,9 @@ Configuration Example { Name = "All Fabrikam ABP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAddressList.md b/docs/docs/resources/exchange/EXOAddressList.md index 06438f1669..b675d33d4d 100644 --- a/docs/docs/resources/exchange/EXOAddressList.md +++ b/docs/docs/resources/exchange/EXOAddressList.md @@ -65,9 +65,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -81,7 +89,9 @@ Configuration Example ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -96,9 +106,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -112,7 +130,9 @@ Configuration Example ConditionalStateOrProvince = "US" IncludedRecipients = "AllRecipients" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -127,9 +147,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +167,9 @@ Configuration Example { Name = "HR Users" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md index 3866339b5b..d0859b5a13 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md +++ b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md @@ -78,9 +78,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +117,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -124,9 +134,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -155,7 +173,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -170,9 +190,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -201,7 +229,9 @@ Configuration Example EnableUnusualCharactersSafetyTips = $null TargetedUserActionRecipients = $null Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index c9e9a3b969..0b556b6129 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -55,13 +55,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -69,9 +76,11 @@ Configuration Example Identity = "Test Rule" AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -86,13 +95,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -101,9 +117,11 @@ Configuration Example Comments = "This is an updated comment." # Updated Property AntiPhishPolicy = "Our Rule" Enabled = $True - SentToMemberOf = @("executives@$Domain") + SentToMemberOf = @("executives@$TenantId") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -118,9 +136,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -131,7 +157,9 @@ Configuration Example Identity = "Test Rule" AntiPhishPolicy = "Our Rule" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md index 9fa1a46662..8b1f6887be 100644 --- a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md +++ b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md @@ -47,15 +47,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' @@ -63,10 +69,12 @@ Configuration Example Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -80,15 +88,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' @@ -96,10 +110,12 @@ Configuration Example Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" + PolicyScopeGroupId = "IntegrationMailEnabled@$TenantId" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -113,11 +129,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -128,7 +151,9 @@ Configuration Example Identity = "Integration Policy" AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAtpPolicyForO365.md b/docs/docs/resources/exchange/EXOAtpPolicyForO365.md index e6b91e99ed..5d9809d9cf 100644 --- a/docs/docs/resources/exchange/EXOAtpPolicyForO365.md +++ b/docs/docs/resources/exchange/EXOAtpPolicyForO365.md @@ -49,9 +49,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -62,7 +70,9 @@ Configuration Example IsSingleInstance = "Yes" EnableATPForSPOTeamsODB = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md index f4394e2bf0..602e77f5a7 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md @@ -56,9 +56,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -80,7 +88,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -95,9 +105,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -119,7 +137,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -134,9 +154,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -158,7 +186,9 @@ Configuration Example AllowBasicAuthSmtp = $False AllowBasicAuthWebServices = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md index 989f6a5dca..04cdfc7453 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md @@ -43,21 +43,30 @@ To authenticate with Microsoft Exchange, this resource required the following pe Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "AdeleV@$Domain" + UserName = "AdeleV@$TenantId" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -70,21 +79,30 @@ Configuration Example Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "AdeleV@$Domain" + UserName = "AdeleV@$TenantId" AuthenticationPolicyName = "Test Policy" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md index e7df67892d..83d0c3a0a6 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md +++ b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md @@ -49,11 +49,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -68,7 +75,9 @@ Configuration Example TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'o365dsc.onmicrosoft.com' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -82,11 +91,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -101,7 +117,9 @@ Configuration Example TargetServiceEpr = 'https://contoso.com/autodiscover/autodiscover.xml' TargetTenantId = 'contoso.onmicrosoft.com' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -115,11 +133,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -130,7 +155,9 @@ Configuration Example { Identity = 'Contoso.com' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOAvailabilityConfig.md b/docs/docs/resources/exchange/EXOAvailabilityConfig.md index 936517c50e..d74942c811 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityConfig.md +++ b/docs/docs/resources/exchange/EXOAvailabilityConfig.md @@ -43,22 +43,31 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "adelev@$Domain" + OrgWideAccount = "adelev@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -72,22 +81,31 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "alexW@$Domain" # Updated Property + OrgWideAccount = "alexW@$TenantId" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -101,22 +119,31 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "alexW@$Domain" # Updated Property + OrgWideAccount = "alexW@$TenantId" # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOCASMailboxPlan.md b/docs/docs/resources/exchange/EXOCASMailboxPlan.md index d63d6a8774..a86f0fbb56 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOCASMailboxPlan.md @@ -50,9 +50,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -66,7 +74,9 @@ Configuration Example Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOCASMailboxSettings.md b/docs/docs/resources/exchange/EXOCASMailboxSettings.md index 9fac50452a..686e5c3a51 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOCASMailboxSettings.md @@ -77,16 +77,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCASMailboxSettings 'AdeleVCasMailboxSettings' @@ -98,7 +103,7 @@ Configuration Example ActiveSyncMailboxPolicy = 'Default' ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True - Identity = "admin@$Domain" + Identity = "admin@$TenantId" ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' @@ -119,7 +124,9 @@ Configuration Example ShowGalAsDefaultView = $True UniversalOutlookEnabled = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOCalendarProcessing.md b/docs/docs/resources/exchange/EXOCalendarProcessing.md index 42b6045f42..1b358814a1 100644 --- a/docs/docs/resources/exchange/EXOCalendarProcessing.md +++ b/docs/docs/resources/exchange/EXOCalendarProcessing.md @@ -81,15 +81,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOCalendarProcessing "CalendarProcessing" @@ -107,7 +114,6 @@ Configuration Example BookingWindowInDays = 180; BookInPolicy = @(); ConflictPercentageAllowed = 0; - Credential = $credsCredential; DeleteAttachments = $True; DeleteComments = $True; DeleteNonCalendarItems = $True; @@ -118,7 +124,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "admin@$Domain"; + Identity = "admin@$TenantId"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -129,10 +135,13 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("AlexW@$Domain"); + RequestInPolicy = @("AlexW@$TenantId"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOClientAccessRule.md b/docs/docs/resources/exchange/EXOClientAccessRule.md index 468b2823c9..f1fcdc480e 100644 --- a/docs/docs/resources/exchange/EXOClientAccessRule.md +++ b/docs/docs/resources/exchange/EXOClientAccessRule.md @@ -64,9 +64,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -88,7 +96,9 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -103,9 +113,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -127,7 +145,9 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -142,9 +162,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -155,7 +183,9 @@ Configuration Example Action = "AllowAccess" Identity = "Always Allow Remote PowerShell" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXODataClassification.md b/docs/docs/resources/exchange/EXODataClassification.md index 261852d7ec..e85a9c96f3 100644 --- a/docs/docs/resources/exchange/EXODataClassification.md +++ b/docs/docs/resources/exchange/EXODataClassification.md @@ -49,9 +49,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -65,7 +73,9 @@ Configuration Example IsDefault = $True; Locale = "en-US"; Name = "Canada Social Insurance Number"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md index 73284eb14c..5146af3072 100644 --- a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md +++ b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md @@ -50,9 +50,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -62,7 +70,9 @@ Configuration Example { Identity = 'US Mailboxes' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXODistributionGroup.md b/docs/docs/resources/exchange/EXODistributionGroup.md index 761c1d7768..c1649e47f4 100644 --- a/docs/docs/resources/exchange/EXODistributionGroup.md +++ b/docs/docs/resources/exchange/EXODistributionGroup.md @@ -85,15 +85,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -104,17 +110,19 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -128,15 +136,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -147,17 +161,19 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("adeleV@$Domain"); + ManagedBy = @("adeleV@$TenantId"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("alexW@$Domain"); + ModeratedBy = @("alexW@$TenantId"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - PrimarySmtpAddress = "demodg@$Domain"; + PrimarySmtpAddress = "demodg@$TenantId"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -171,24 +187,32 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXODistributionGroup 'DemoDG' { DisplayName = "My Demo DG"; Ensure = "Absent"; Identity = "DemoDG"; Name = "DemoDG"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXODkimSigningConfig.md b/docs/docs/resources/exchange/EXODkimSigningConfig.md index 6638eca381..72bcd092b0 100644 --- a/docs/docs/resources/exchange/EXODkimSigningConfig.md +++ b/docs/docs/resources/exchange/EXODkimSigningConfig.md @@ -50,25 +50,34 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $True BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -83,25 +92,34 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { KeySize = 1024 - Identity = $Domain + Identity = $TenantId HeaderCanonicalization = "Relaxed" Enabled = $False # Updated Property BodyCanonicalization = "Relaxed" AdminDisplayName = "" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -116,20 +134,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODkimSigningConfig 'ConfigureDKIMSigning' { - Identity = $Domain + Identity = $TenantId Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOEOPProtectionPolicyRule.md b/docs/docs/resources/exchange/EXOEOPProtectionPolicyRule.md index c439f3314c..d5c0c35184 100644 --- a/docs/docs/resources/exchange/EXOEOPProtectionPolicyRule.md +++ b/docs/docs/resources/exchange/EXOEOPProtectionPolicyRule.md @@ -52,26 +52,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEOPProtectionPolicyRule "EXOEOPProtectionPolicyRule-Strict Preset Security Policy" { - ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; - CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; Ensure = "Present"; ExceptIfRecipientDomainIs = @("sandrodev.onmicrosoft.com"); Identity = "Strict Preset Security Policy"; Name = "Strict Preset Security Policy"; Priority = 0; State = "Enabled"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md index 54bf098cd3..013b05cf2b 100644 --- a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md +++ b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md @@ -48,24 +48,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "" Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -80,24 +89,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" + EnabledEmailAddressTemplates = @("SMTP:@$TenantId") + EnabledPrimarySMTPAddressTemplate = "@$TenantId" ManagedByFilter = "Department -eq 'Sales'" # Updated Property Priority = 1 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -112,20 +130,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOExternalInOutlook.md b/docs/docs/resources/exchange/EXOExternalInOutlook.md index 14a617a670..c06886185b 100644 --- a/docs/docs/resources/exchange/EXOExternalInOutlook.md +++ b/docs/docs/resources/exchange/EXOExternalInOutlook.md @@ -44,10 +44,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -58,7 +67,9 @@ Configuration Example AllowList = @("mobile01@contoso.onmicrosoft.com","*contoso.onmicrosoft.com","contoso.com"); Enabled = $False; Ensure = "Present"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOGlobalAddressList.md b/docs/docs/resources/exchange/EXOGlobalAddressList.md index 03f184e64e..905ab60094 100644 --- a/docs/docs/resources/exchange/EXOGlobalAddressList.md +++ b/docs/docs/resources/exchange/EXOGlobalAddressList.md @@ -63,12 +63,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -81,7 +89,9 @@ Configuration Example ConditionalStateOrProvince = "Washington" IncludedRecipients = 'AllRecipients' Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -95,12 +105,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -112,7 +130,9 @@ Configuration Example ConditionalDepartment = "Finances" # Updated Property ConditionalStateOrProvince = "Washington" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -126,12 +146,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -140,7 +168,9 @@ Configuration Example { Name = "Contoso Human Resources in Washington" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOGroupSettings.md b/docs/docs/resources/exchange/EXOGroupSettings.md index a9994b01f8..ca2bae5934 100644 --- a/docs/docs/resources/exchange/EXOGroupSettings.md +++ b/docs/docs/resources/exchange/EXOGroupSettings.md @@ -94,16 +94,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOGroupSettings 'TestGroup' @@ -115,7 +121,6 @@ Configuration Example AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; ConnectorsEnabled = $False; # Updated Property - Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -124,9 +129,12 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@$Domain"; + PrimarySmtpAddress = "TestGroup@$TenantId"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md index d5ce379cde..24fd712aa2 100644 --- a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md @@ -50,9 +50,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -67,7 +75,9 @@ Configuration Example IPBlockList = @() MakeDefault = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md index 15f1f0a745..d01949203b 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md @@ -97,9 +97,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -147,7 +155,9 @@ Configuration Example TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -162,9 +172,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -212,7 +230,9 @@ Configuration Example TestModeAction = "None" TestModeBccToRecipients = @() Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -227,9 +247,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -239,7 +267,9 @@ Configuration Example { Identity = "Integration CFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md index 1eb607bc93..bc656c1f5e 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md @@ -54,15 +54,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' @@ -70,11 +76,13 @@ Configuration Example Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $True - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -88,15 +96,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' @@ -104,11 +119,13 @@ Configuration Example Identity = "Integration CFR" Comments = "Applies to all users, except when member of HR group" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "LegalTeam@$Domain" + ExceptIfSentToMemberOf = "LegalTeam@$TenantId" RecipientDomainIs = @('contoso.com') HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -122,12 +139,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -137,7 +162,9 @@ Configuration Example Identity = "Integration CFR" HostedContentFilterPolicy = "Integration CFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md index 25ceb5f298..bd16fe3c7b 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md @@ -10,9 +10,9 @@ | **BccSuspiciousOutboundMail** | Write | Boolean | The BccSuspiciousOutboundMail parameter enables or disables adding recipients to the Bcc field of outgoing spam messages. Valid input for this parameter is $true or $false. The default value is $false. You specify the additional recipients using the BccSuspiciousOutboundAdditionalRecipients parameter. | | | **NotifyOutboundSpam** | Write | Boolean | The NotifyOutboundSpam parameter enables or disables sending notification messages to administrators when an outgoing message is determined to be spam. Valid input for this parameter is $true or $false. The default value is $false. You specify the administrators to notify by using the NotifyOutboundSpamRecipients parameter. | | | **NotifyOutboundSpamRecipients** | Write | StringArray[] | The NotifyOutboundSpamRecipients parameter specifies the administrators to notify when an outgoing message is determined to be spam. Valid input for this parameter is an email address. Separate multiple email addresses with commas. | | -| **RecipientLimitInternalPerHour** | Write | String | The RecipientLimitInternalPerHour parameter specifies the maximum number of internal recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | -| **RecipientLimitPerDay** | Write | String | The RecipientLimitPerDay parameter specifies the maximum number of recipients that a user can send to within a day. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | -| **RecipientLimitExternalPerHour** | Write | String | The RecipientLimitExternalPerHour parameter specifies the maximum number of external recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | +| **RecipientLimitInternalPerHour** | Write | UInt32 | The RecipientLimitInternalPerHour parameter specifies the maximum number of internal recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | +| **RecipientLimitPerDay** | Write | UInt32 | The RecipientLimitPerDay parameter specifies the maximum number of recipients that a user can send to within a day. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | +| **RecipientLimitExternalPerHour** | Write | UInt32 | The RecipientLimitExternalPerHour parameter specifies the maximum number of external recipients that a user can send to within an hour. A valid value is 0 to 10000. The default value is 0, which means the service defaults are used. | | | **ActionWhenThresholdReached** | Write | String | The ActionWhenThresholdReached parameter specifies the action to take when any of the limits specified in the policy are reached. Valid values are: Alert, BlockUser, BlockUserForToday. BlockUserForToday is the default value. | | | **AutoForwardingMode** | Write | String | The AutoForwardingMode specifies how the policy controls automatic email forwarding to outbound recipients. Valid values are: Automatic, On, Off. | | | **Ensure** | Write | String | Specify if this policy should exist or not. | `Present`, `Absent` | @@ -55,10 +55,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -73,11 +82,13 @@ Configuration Example BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 0 - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 0 + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -92,10 +103,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -110,11 +130,13 @@ Configuration Example BccSuspiciousOutboundMail = $False NotifyOutboundSpam = $False NotifyOutboundSpamRecipients = @() - RecipientLimitExternalPerHour = 0 - RecipientLimitInternalPerHour = 1 # Updated Property - RecipientLimitPerDay = 0 + #RecipientLimitExternalPerHour = 0 + #RecipientLimitInternalPerHour = 1 # Updated Property + #RecipientLimitPerDay = 0 Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -129,10 +151,19 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -141,7 +172,9 @@ Configuration Example { Identity = "Integration SFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md index 85c7083158..4abd1066cc 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md @@ -54,15 +54,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' @@ -70,11 +77,13 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -88,15 +97,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' @@ -104,11 +120,13 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $False # Updated Property - ExceptIfFrom = "AdeleV@$Domain" - FromMemberOf = "Executives@$Domain" + ExceptIfFrom = "AdeleV@$TenantId" + FromMemberOf = "Executives@$TenantId" HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -122,15 +140,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' diff --git a/docs/docs/resources/exchange/EXOIRMConfiguration.md b/docs/docs/resources/exchange/EXOIRMConfiguration.md index 3fbd8d2935..67903e63f8 100644 --- a/docs/docs/resources/exchange/EXOIRMConfiguration.md +++ b/docs/docs/resources/exchange/EXOIRMConfiguration.md @@ -58,12 +58,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -85,7 +93,9 @@ Configuration Example SimplifiedClientAccessEncryptOnlyDisabled = $True TransportDecryptionSetting = 'Mandatory' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOInboundConnector.md b/docs/docs/resources/exchange/EXOInboundConnector.md index 3d56a2047b..5f7dde5179 100644 --- a/docs/docs/resources/exchange/EXOInboundConnector.md +++ b/docs/docs/resources/exchange/EXOInboundConnector.md @@ -59,12 +59,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -81,7 +89,9 @@ Configuration Example SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -95,12 +105,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -117,7 +135,9 @@ Configuration Example SenderDomains = "*.contoso.com" TlsSenderCertificateName = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -131,12 +151,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -145,7 +173,9 @@ Configuration Example { Identity = "Integration Inbound Connector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md index 7247b53cf0..957c45cde9 100644 --- a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md +++ b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md @@ -47,12 +47,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -64,7 +72,9 @@ Configuration Example TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -78,12 +88,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -95,7 +113,9 @@ Configuration Example TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -109,12 +129,20 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC node localhost @@ -123,7 +151,9 @@ Configuration Example { Identity = "MainCloudConnector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOJournalRule.md b/docs/docs/resources/exchange/EXOJournalRule.md index 5621508b15..aeeead5aa0 100644 --- a/docs/docs/resources/exchange/EXOJournalRule.md +++ b/docs/docs/resources/exchange/EXOJournalRule.md @@ -48,23 +48,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -79,23 +89,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $False # Updated Property - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -110,21 +130,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { - JournalEmailAddress = "AdeleV@$Domain" + JournalEmailAddress = "AdeleV@$TenantId" Name = "Send to Adele" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailContact.md b/docs/docs/resources/exchange/EXOMailContact.md index bd05b43037..16dded24e7 100644 --- a/docs/docs/resources/exchange/EXOMailContact.md +++ b/docs/docs/resources/exchange/EXOMailContact.md @@ -80,19 +80,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -102,11 +108,14 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -121,19 +130,25 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Present' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' @@ -143,11 +158,14 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $false # Updated Property CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -162,28 +180,37 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' - Credential = $Credscredential DisplayName = 'My Test Contact' Ensure = 'Absent' ExternalEmailAddress = 'SMTP:test@tailspintoys.com' Name = 'My Test Contact' - OrganizationalUnit = $Domain + OrganizationalUnit = $TenantId SendModerationNotifications = 'Always' UsePreferMessageFormat = $false # Updated Property CustomAttribute1 = 'Custom Value 1' ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailTips.md b/docs/docs/resources/exchange/EXOMailTips.md index 76f374a191..166ea4f104 100644 --- a/docs/docs/resources/exchange/EXOMailTips.md +++ b/docs/docs/resources/exchange/EXOMailTips.md @@ -49,13 +49,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' @@ -63,11 +70,13 @@ Configuration Example IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -82,13 +91,20 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' @@ -96,11 +112,13 @@ Configuration Example IsSingleInstance = 'Yes' MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $False # Updated Property - MailTipsLargeAudienceThreshold = 100 + #MailTipsLargeAudienceThreshold = 100 MailTipsMailboxSourcedTipsEnabled = $True MailTipsExternalRecipientsTipsEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -115,20 +133,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { IsSingleInstance = 'Yes' Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md index 158fb13cd7..ac9ad5ca55 100644 --- a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md +++ b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md @@ -58,13 +58,21 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) + Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" @@ -72,7 +80,6 @@ Configuration Example AutoDeclineFutureRequestsWhenOOF = $False; AutoReplyState = "Disabled"; CreateOOFEvent = $False; - Credential = $Credscredential; DeclineAllEventsForScheduledOOF = $False; DeclineEventsForScheduledOOF = $False; DeclineMeetingMessage = ""; @@ -80,10 +87,13 @@ Configuration Example Ensure = "Present"; ExternalAudience = "All"; ExternalMessage = (New-Guid).ToString(); # Updated Property - Identity = "AdeleV@$Domain"; + Identity = "AdeleV@$TenantId"; InternalMessage = ""; OOFEventSubject = ""; StartTime = "1/22/2024 3:00:00 PM"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md index f28ef89768..23b1861153 100644 --- a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md +++ b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md @@ -50,27 +50,35 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxCalendarFolder "JohnCalendarFolder" { - Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "AlexW@$Domain" + ":\Calendar"; + Identity = "AlexW@$TenantId" + ":\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailboxPermission.md b/docs/docs/resources/exchange/EXOMailboxPermission.md index c554e2bf5e..f7dfe3b58c 100644 --- a/docs/docs/resources/exchange/EXOMailboxPermission.md +++ b/docs/docs/resources/exchange/EXOMailboxPermission.md @@ -49,24 +49,33 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailboxPermission "TestPermission" { AccessRights = @("FullAccess","ReadPermission"); - Credential = $credsCredential; Deny = $True; # Updated Property Ensure = "Present"; - Identity = "AlexW@$Domain"; + Identity = "AlexW@$TenantId"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailboxPlan.md b/docs/docs/resources/exchange/EXOMailboxPlan.md index 5f5de0e838..6401c6441c 100644 --- a/docs/docs/resources/exchange/EXOMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOMailboxPlan.md @@ -53,9 +53,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -72,7 +80,9 @@ Configuration Example ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMailboxSettings.md b/docs/docs/resources/exchange/EXOMailboxSettings.md index cb5e9dd7e9..0007b04d38 100644 --- a/docs/docs/resources/exchange/EXOMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOMailboxSettings.md @@ -48,11 +48,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -65,7 +72,9 @@ Configuration Example TimeZone = 'Eastern Standard Time' Locale = 'en-US' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md index 0596397bc3..7d9fd4fc7e 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md @@ -62,9 +62,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -82,7 +90,9 @@ Configuration Example QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -97,9 +107,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -117,7 +135,9 @@ Configuration Example QuarantineTag = "AdminOnlyAccessPolicy" ZapEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -132,9 +152,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -144,7 +172,9 @@ Configuration Example { Identity = "IntegrationMFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMalwareFilterRule.md b/docs/docs/resources/exchange/EXOMalwareFilterRule.md index 46f54e7f7e..dc4689f84c 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterRule.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterRule.md @@ -53,11 +53,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +78,9 @@ Configuration Example Enabled = $True RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -85,11 +94,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -103,7 +119,9 @@ Configuration Example Enabled = $False # Updated Property RecipientDomainIs = "contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -117,11 +135,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -132,7 +157,9 @@ Configuration Example Identity = "Contoso Recipients" MalwareFilterPolicy = "IntegrationMFP" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOManagementRole.md b/docs/docs/resources/exchange/EXOManagementRole.md index 43ecc597a6..b0688f5521 100644 --- a/docs/docs/resources/exchange/EXOManagementRole.md +++ b/docs/docs/resources/exchange/EXOManagementRole.md @@ -46,22 +46,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "" - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -76,22 +85,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRole 'ConfigureManagementRole' { Name = "MyDisplayName" Description = "Updated Description" # Updated Property - Parent = "$Domain\MyProfileInformation" + Parent = "$TenantId\MyProfileInformation" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -106,9 +124,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -120,7 +146,9 @@ Configuration Example Description = "Updated Description" # Updated Property Parent = "contoso.onmicrosoft.com\MyProfileInformation" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md index 31934e2895..0a44fcf9f1 100644 --- a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md +++ b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md @@ -55,22 +55,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AdeleV@$Domain"; + User = "AdeleV@$TenantId"; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -85,22 +94,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AlexW@$Domain"; # Updated Property + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -115,22 +133,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOManagementRoleAssignment 'AssignManagementRole' { - Credential = $credsCredential; Ensure = "Absent"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "AlexW@$Domain"; # Updated Property + User = "AlexW@$TenantId"; # Updated Property + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOManagementRoleEntry.md b/docs/docs/resources/exchange/EXOManagementRoleEntry.md index 2c20553e80..d45b2b6e0d 100644 --- a/docs/docs/resources/exchange/EXOManagementRoleEntry.md +++ b/docs/docs/resources/exchange/EXOManagementRoleEntry.md @@ -45,9 +45,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -55,7 +63,9 @@ Configuration Example { EXOManagementRoleEntry "UpdateRoleEntry" { - Credential = $Credscredential; + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint Identity = "Information Rights Management\Get-BookingMailbox" Parameters = @("ANR","RecipientTypeDetails", "ResultSize") } diff --git a/docs/docs/resources/exchange/EXOMessageClassification.md b/docs/docs/resources/exchange/EXOMessageClassification.md index f37a4f8049..4f8a62bcb8 100644 --- a/docs/docs/resources/exchange/EXOMessageClassification.md +++ b/docs/docs/resources/exchange/EXOMessageClassification.md @@ -51,11 +51,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -72,7 +79,9 @@ Configuration Example SenderDescription = "Shown to senders" RetainClassificationEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -86,11 +95,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -107,7 +123,9 @@ Configuration Example SenderDescription = "Shown to senders" RetainClassificationEnabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -121,11 +139,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -137,7 +162,9 @@ Configuration Example Name = "Contoso Message Classification" DisplayName = "Contoso Message Classification" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md index 3285327426..0fdbcff8f4 100644 --- a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md @@ -98,9 +98,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -163,7 +171,9 @@ Configuration Example UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -178,9 +188,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -243,7 +261,9 @@ Configuration Example UNCAccessEnabled = $True WSSAccessEnabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -258,9 +278,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -270,7 +298,9 @@ Configuration Example { Name = "Default" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOMEConfiguration.md b/docs/docs/resources/exchange/EXOOMEConfiguration.md index 3d2e31eff2..45ddac8afe 100644 --- a/docs/docs/resources/exchange/EXOOMEConfiguration.md +++ b/docs/docs/resources/exchange/EXOOMEConfiguration.md @@ -53,11 +53,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -75,7 +82,9 @@ Configuration Example PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -89,11 +98,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -111,7 +127,9 @@ Configuration Example PortalText = "This portal is encrypted." SocialIdSignIn = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -125,11 +143,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +164,9 @@ Configuration Example { Identity = "Contoso Marketing" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOfflineAddressBook.md b/docs/docs/resources/exchange/EXOOfflineAddressBook.md index 3fc957f8c4..4439e5ab9c 100644 --- a/docs/docs/resources/exchange/EXOOfflineAddressBook.md +++ b/docs/docs/resources/exchange/EXOOfflineAddressBook.md @@ -47,11 +47,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -65,7 +72,9 @@ Configuration Example DiffRetentionPeriod = "30" IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -79,11 +88,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -97,7 +113,9 @@ Configuration Example DiffRetentionPeriod = "60" # Updated Property IsDefault = $true Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -111,11 +129,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -130,7 +155,9 @@ Configuration Example DiffRetentionPeriod = "30" IsDefault = $true Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md index a36dd455a3..b9ac4ad94c 100644 --- a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md +++ b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md @@ -50,11 +50,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +78,9 @@ Configuration Example OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DependsOn = "[EXOOutboundConnector]OutboundDependency" } EXOOutboundConnector 'OutboundDependency' @@ -90,7 +99,9 @@ Configuration Example TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -104,11 +115,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +143,9 @@ Configuration Example OrganizationName = 'O365DSC' OutboundConnector = 'Contoso Outbound Connector' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -139,11 +159,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -153,7 +180,9 @@ Configuration Example EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' { Identity = 'Contoso' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOrganizationConfig.md b/docs/docs/resources/exchange/EXOOrganizationConfig.md index 4cb2c64b8d..13977a5b61 100644 --- a/docs/docs/resources/exchange/EXOOrganizationConfig.md +++ b/docs/docs/resources/exchange/EXOOrganizationConfig.md @@ -150,9 +150,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -221,7 +229,9 @@ Configuration Example AutoExpandingArchive = $null ConnectorsEnabledForSharepoint = $True ReadTrackingEnabled = $False - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOrganizationRelationship.md b/docs/docs/resources/exchange/EXOOrganizationRelationship.md index f13e4acac0..c088e8fc91 100644 --- a/docs/docs/resources/exchange/EXOOrganizationRelationship.md +++ b/docs/docs/resources/exchange/EXOOrganizationRelationship.md @@ -63,11 +63,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -89,7 +96,9 @@ Configuration Example TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -103,11 +112,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -129,7 +145,9 @@ Configuration Example TargetApplicationUri = "mail.contoso.com" TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -143,11 +161,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -158,7 +183,9 @@ Configuration Example Name = "Contoso" Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOutboundConnector.md b/docs/docs/resources/exchange/EXOOutboundConnector.md index cf2d1b3c8a..12fe6fc758 100644 --- a/docs/docs/resources/exchange/EXOOutboundConnector.md +++ b/docs/docs/resources/exchange/EXOOutboundConnector.md @@ -59,11 +59,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -85,7 +92,9 @@ Configuration Example TlsSettings = "DomainValidation" UseMxRecord = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -99,11 +108,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -113,7 +129,9 @@ Configuration Example { Identity = "Contoso Outbound Connector" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md index 48446c50ee..b5b36683c3 100644 --- a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md @@ -129,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -213,7 +221,9 @@ Configuration Example WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -228,9 +238,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -312,7 +330,9 @@ Configuration Example WeatherEnabled = $True WebPartsFrameOptionsType = "SameOrigin" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -327,9 +347,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -337,9 +365,11 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Integration" - Ensure = "Absent" - Credential = $Credscredential + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOPartnerApplication.md b/docs/docs/resources/exchange/EXOPartnerApplication.md index 171b6139ef..c2a9274372 100644 --- a/docs/docs/resources/exchange/EXOPartnerApplication.md +++ b/docs/docs/resources/exchange/EXOPartnerApplication.md @@ -48,11 +48,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -65,7 +72,9 @@ Configuration Example AcceptSecurityIdentifierInformation = $true Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -79,11 +88,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -96,7 +112,9 @@ Configuration Example AcceptSecurityIdentifierInformation = $False # Updated Property Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -110,11 +128,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +150,9 @@ Configuration Example Name = "HRApp" ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOPerimeterConfiguration.md b/docs/docs/resources/exchange/EXOPerimeterConfiguration.md index 7be82338d6..fd4f32630f 100644 --- a/docs/docs/resources/exchange/EXOPerimeterConfiguration.md +++ b/docs/docs/resources/exchange/EXOPerimeterConfiguration.md @@ -44,11 +44,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -59,7 +66,9 @@ Configuration Example IsSingleInstance = 'Yes' #GatewayIPAddresses = '123.0.0.1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOPlace.md b/docs/docs/resources/exchange/EXOPlace.md index 3871b8b820..ff45da9f80 100644 --- a/docs/docs/resources/exchange/EXOPlace.md +++ b/docs/docs/resources/exchange/EXOPlace.md @@ -65,16 +65,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -82,10 +88,12 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -105,16 +113,22 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -122,10 +136,12 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 16; # Updated Property City = ""; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -145,25 +161,33 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' { AudioDeviceName = "MyAudioDevice"; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Absent' - Identity = "Hood@$Domain"; + Identity = "Hood@$TenantId"; } } } diff --git a/docs/docs/resources/exchange/EXOPolicyTipConfig.md b/docs/docs/resources/exchange/EXOPolicyTipConfig.md index db36152278..8bb48246bd 100644 --- a/docs/docs/resources/exchange/EXOPolicyTipConfig.md +++ b/docs/docs/resources/exchange/EXOPolicyTipConfig.md @@ -44,11 +44,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -59,7 +66,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy." Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -73,11 +82,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -88,7 +104,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -102,11 +120,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -117,7 +142,9 @@ Configuration Example Name = "en\NotifyOnly" Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOQuarantinePolicy.md b/docs/docs/resources/exchange/EXOQuarantinePolicy.md index 28bfdad964..0a52e3dee5 100644 --- a/docs/docs/resources/exchange/EXOQuarantinePolicy.md +++ b/docs/docs/resources/exchange/EXOQuarantinePolicy.md @@ -56,23 +56,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -87,23 +95,31 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $True; # Updated Property - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -118,21 +134,29 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) - $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { - Identity = "$Domain\IntegrationPolicy"; + Identity = "$TenantId\IntegrationPolicy"; Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXORecipientPermission.md b/docs/docs/resources/exchange/EXORecipientPermission.md index a4826c215a..94520d12c2 100644 --- a/docs/docs/resources/exchange/EXORecipientPermission.md +++ b/docs/docs/resources/exchange/EXORecipientPermission.md @@ -45,25 +45,33 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXORecipientPermission 'AddSendAs' { - Identity = "AlexW@$Domain" - Trustee = "admin@$Domain" + Identity = "AlexW@$TenantId" + Trustee = "admin@$TenantId" AccessRights = 'SendAs' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,25 +85,33 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXORecipientPermission 'AddSendAs' { Identity = 'AdeleV@$Domain' - Trustee = "admin@$Domain" + Trustee = "admin@$TenantId" Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXORemoteDomain.md b/docs/docs/resources/exchange/EXORemoteDomain.md index 7a861c31ba..68d429a45e 100644 --- a/docs/docs/resources/exchange/EXORemoteDomain.md +++ b/docs/docs/resources/exchange/EXORemoteDomain.md @@ -66,9 +66,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -97,7 +105,9 @@ Configuration Example TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -112,9 +122,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -143,7 +161,9 @@ Configuration Example TrustedMailOutboundEnabled = $False UseSimpleDisplayName = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -158,9 +178,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -170,7 +198,9 @@ Configuration Example { Identity = "Integration" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOReportSubmissionPolicy.md b/docs/docs/resources/exchange/EXOReportSubmissionPolicy.md index 18e09b8021..9e685a4f18 100644 --- a/docs/docs/resources/exchange/EXOReportSubmissionPolicy.md +++ b/docs/docs/resources/exchange/EXOReportSubmissionPolicy.md @@ -68,9 +68,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -91,7 +99,9 @@ Configuration Example ReportNotJunkToCustomizedAddress = $False ReportPhishToCustomizedAddress = $False Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOReportSubmissionRule.md b/docs/docs/resources/exchange/EXOReportSubmissionRule.md index 091855231f..d541c21d72 100644 --- a/docs/docs/resources/exchange/EXOReportSubmissionRule.md +++ b/docs/docs/resources/exchange/EXOReportSubmissionRule.md @@ -47,9 +47,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -62,7 +70,9 @@ Configuration Example Comments = "This is my default rule" SentTo = "submission@contoso.com" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOResourceConfiguration.md b/docs/docs/resources/exchange/EXOResourceConfiguration.md index a31936bbad..a8b78c947d 100644 --- a/docs/docs/resources/exchange/EXOResourceConfiguration.md +++ b/docs/docs/resources/exchange/EXOResourceConfiguration.md @@ -44,11 +44,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -60,7 +67,9 @@ Configuration Example IsSingleInstance = 'Yes' ResourcePropertySchema = @('Room/TV', 'Equipment/Laptop') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md index 9ed00e0a90..43d6cc6115 100644 --- a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md +++ b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md @@ -47,9 +47,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -62,7 +70,9 @@ Configuration Example IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,9 +87,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -92,7 +110,9 @@ Configuration Example IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -107,9 +127,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -121,7 +149,9 @@ Configuration Example IsDefault = $False # Updated Property Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXORoleGroup.md b/docs/docs/resources/exchange/EXORoleGroup.md index e9d4fd8065..3072a3f721 100644 --- a/docs/docs/resources/exchange/EXORoleGroup.md +++ b/docs/docs/resources/exchange/EXORoleGroup.md @@ -46,11 +46,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -63,7 +70,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,11 +86,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -94,7 +110,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -108,11 +126,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -124,7 +149,9 @@ Configuration Example Members = @("Exchange Administrator") Roles = @("Address Lists") Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md index 11579e4698..13ee9bbaa3 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md @@ -51,15 +51,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -67,9 +73,11 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -83,15 +91,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -99,9 +113,11 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $False # Updated Property Redirect = $True - RedirectAddress = "admin@$Domain" + RedirectAddress = "admin@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -115,15 +131,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -131,7 +153,9 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $False # Updated Property Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md index 5516640d52..488adb3565 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md @@ -53,15 +53,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' @@ -69,11 +75,13 @@ Configuration Example Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -87,15 +95,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' @@ -103,11 +117,13 @@ Configuration Example Identity = "Research Department Attachment Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeAttachmentPolicy = "Marketing Block Attachments" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -121,11 +137,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +162,9 @@ Configuration Example SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md index e4c923aa6d..3b23dbd204 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md @@ -58,11 +58,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -78,7 +85,9 @@ Configuration Example EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -92,11 +101,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -112,7 +128,9 @@ Configuration Example EnableSafeLinksForTeams = $True ScanUrls = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -126,11 +144,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -140,7 +165,9 @@ Configuration Example { Identity = 'Marketing Block URL' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSafeLinksRule.md b/docs/docs/resources/exchange/EXOSafeLinksRule.md index 5ccd53294f..5fa7c600e1 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksRule.md +++ b/docs/docs/resources/exchange/EXOSafeLinksRule.md @@ -53,15 +53,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeLinksRule 'ConfigureSafeLinksRule' @@ -69,11 +75,13 @@ Configuration Example Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $True - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -87,15 +95,21 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeLinksRule 'ConfigureSafeLinksRule' @@ -103,11 +117,13 @@ Configuration Example Identity = "Research Department URL Rule" Comments = "Applies to Research Department, except managers" Enabled = $False # Updated Property - ExceptIfSentToMemberOf = "Executives@$Domain" + ExceptIfSentToMemberOf = "Executives@$TenantId" SafeLinksPolicy = "Marketing Block URL" - SentToMemberOf = "LegalTeam@$Domain" + SentToMemberOf = "LegalTeam@$TenantId" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -121,11 +137,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -138,7 +161,9 @@ Configuration Example Enabled = $False # Updated Property SafeLinksPolicy = "Marketing Block URL" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSharedMailbox.md b/docs/docs/resources/exchange/EXOSharedMailbox.md index 05118d3172..1511cac2e4 100644 --- a/docs/docs/resources/exchange/EXOSharedMailbox.md +++ b/docs/docs/resources/exchange/EXOSharedMailbox.md @@ -48,23 +48,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -79,23 +88,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain", "IntegrationSM2@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") Alias = "IntegrationSM" Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -110,23 +128,32 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Integration" - PrimarySMTPAddress = "Integration@$Domain" - EmailAddresses = @("IntegrationSM@$Domain", "IntegrationSM2@$Domain") + PrimarySMTPAddress = "Integration@$TenantId" + EmailAddresses = @("IntegrationSM@$TenantId", "IntegrationSM2@$TenantId") Alias = "IntegrationSM" Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOSharingPolicy.md b/docs/docs/resources/exchange/EXOSharingPolicy.md index 47d213d5ac..2b91d57af1 100644 --- a/docs/docs/resources/exchange/EXOSharingPolicy.md +++ b/docs/docs/resources/exchange/EXOSharingPolicy.md @@ -47,9 +47,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -62,7 +70,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -77,9 +87,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -92,7 +110,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -107,9 +127,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -122,7 +150,9 @@ Configuration Example Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOTransportConfig.md b/docs/docs/resources/exchange/EXOTransportConfig.md index 239887b01f..fe43448e3e 100644 --- a/docs/docs/resources/exchange/EXOTransportConfig.md +++ b/docs/docs/resources/exchange/EXOTransportConfig.md @@ -70,9 +70,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,7 +110,9 @@ Configuration Example ReplyAllStormProtectionEnabled = $True; Rfc2231EncodingEnabled = $False; SmtpClientAuthenticationDisabled = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/exchange/EXOTransportRule.md b/docs/docs/resources/exchange/EXOTransportRule.md index 4ac253aa5c..16270f8937 100644 --- a/docs/docs/resources/exchange/EXOTransportRule.md +++ b/docs/docs/resources/exchange/EXOTransportRule.md @@ -210,28 +210,36 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $True Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -245,28 +253,36 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC - $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOTransportRule 'ConfigureTransportRule' { Name = "Ethical Wall - Sales and Executives Departments" - BetweenMemberOf1 = "SalesTeam@$Domain" - BetweenMemberOf2 = "Executives@$Domain" - ExceptIfFrom = "AdeleV@$Domain" + BetweenMemberOf1 = "SalesTeam@$TenantId" + BetweenMemberOf2 = "Executives@$TenantId" + ExceptIfFrom = "AdeleV@$TenantId" ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." Enabled = $False # Updated Property Ensure = "Present" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } @@ -280,11 +296,18 @@ It is not meant to use as a production baseline. ```powershell Configuration Example { - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -295,7 +318,9 @@ Configuration Example Name = "Ethical Wall - Sales and Brokerage Departments" Enabled = $True Ensure = "Absent" - Credential = $Credscredential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } } } diff --git a/docs/docs/resources/intune/IntuneASRRulesPolicyWindows10.md b/docs/docs/resources/intune/IntuneASRRulesPolicyWindows10.md index a43861f37e..0134626168 100644 --- a/docs/docs/resources/intune/IntuneASRRulesPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneASRRulesPolicyWindows10.md @@ -93,9 +93,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -126,7 +134,9 @@ Configuration Example UntrustedExecutableType = 'block' UntrustedUSBProcessType = 'block' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -141,9 +151,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -174,7 +192,9 @@ Configuration Example UntrustedExecutableType = 'block' UntrustedUSBProcessType = 'block' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -189,9 +209,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -201,7 +229,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy.md b/docs/docs/resources/intune/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy.md index f83473b8d7..e19cc33b08 100644 --- a/docs/docs/resources/intune/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy.md +++ b/docs/docs/resources/intune/IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy.md @@ -84,9 +84,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -97,7 +105,6 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -108,6 +115,9 @@ Configuration Example PasswordAgeDays_AAD = 10; AdministratorAccountName = "Administrator"; PasswordAgeDays = 20; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -122,9 +132,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -135,7 +153,6 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -146,6 +163,9 @@ Configuration Example PasswordAgeDays_AAD = 15; # Updated Property AdministratorAccountName = "Administrator"; PasswordAgeDays = 20; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -160,9 +180,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -173,7 +201,9 @@ Configuration Example DisplayName = "Account Protection LAPS Policy"; Description = "My revised description"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAccountProtectionLocalUserGroupMembershipPolicy.md b/docs/docs/resources/intune/IntuneAccountProtectionLocalUserGroupMembershipPolicy.md index d48318c77a..25709f754b 100644 --- a/docs/docs/resources/intune/IntuneAccountProtectionLocalUserGroupMembershipPolicy.md +++ b/docs/docs/resources/intune/IntuneAccountProtectionLocalUserGroupMembershipPolicy.md @@ -85,9 +85,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -98,7 +106,6 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @( MSFT_IntuneAccountProtectionLocalUserGroupMembershipPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -113,6 +120,9 @@ Configuration Example UserSelectionType = 'users' } ); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -127,9 +137,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -140,7 +158,6 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Present"; - Credential = $Credscredential Assignments = @(); # Updated Property LocalUserGroupCollection = @( MSFT_IntuneAccountProtectionLocalUserGroupCollection{ @@ -150,6 +167,9 @@ Configuration Example UserSelectionType = 'users' } ); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -164,9 +184,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -177,7 +205,9 @@ Configuration Example DisplayName = "Account Protection LUGM Policy"; Description = "My revised description"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAccountProtectionPolicy.md b/docs/docs/resources/intune/IntuneAccountProtectionPolicy.md index 58e3210822..2da74fb4a8 100644 --- a/docs/docs/resources/intune/IntuneAccountProtectionPolicy.md +++ b/docs/docs/resources/intune/IntuneAccountProtectionPolicy.md @@ -88,9 +88,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -104,7 +112,9 @@ Configuration Example PinMinimumLength = 5 PinSpecialCharactersUsage = 'required' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -119,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -135,7 +153,9 @@ Configuration Example PinMinimumLength = 10 # Updated Property PinSpecialCharactersUsage = 'required' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -150,9 +170,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -162,7 +190,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAntivirusPolicyWindows10SettingCatalog.md b/docs/docs/resources/intune/IntuneAntivirusPolicyWindows10SettingCatalog.md index f06177ddeb..535b6c4d86 100644 --- a/docs/docs/resources/intune/IntuneAntivirusPolicyWindows10SettingCatalog.md +++ b/docs/docs/resources/intune/IntuneAntivirusPolicyWindows10SettingCatalog.md @@ -145,9 +145,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -167,7 +175,9 @@ Configuration Example excludedprocesses = @('processes.exe', 'process2.exe') templateId = '45fea5e9-280d-4da1-9792-fb5736da0ca9_1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -182,9 +192,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -204,7 +222,9 @@ Configuration Example excludedprocesses = @('processes.exe', 'process3.exe') # Updated Property templateId = '45fea5e9-280d-4da1-9792-fb5736da0ca9_1' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -219,9 +239,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -231,7 +259,9 @@ Configuration Example { DisplayName = 'av exclusions' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAppConfigurationDevicePolicy.md b/docs/docs/resources/intune/IntuneAppConfigurationDevicePolicy.md index 1b5e27d2d3..319165e8e6 100644 --- a/docs/docs/resources/intune/IntuneAppConfigurationDevicePolicy.md +++ b/docs/docs/resources/intune/IntuneAppConfigurationDevicePolicy.md @@ -101,9 +101,17 @@ This example creates a new App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -111,7 +119,6 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Assignments = @(); Description = ""; DisplayName = "Example"; @@ -124,7 +131,9 @@ Configuration Example ProfileApplicability = "default" RoleScopeTagIds = @("0"); TargetedMobileApps = @("<Mobile App Id>"); - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -138,9 +147,17 @@ This example updates an App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -148,7 +165,6 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Assignments = @(); Description = ""; DisplayName = "Example"; @@ -166,7 +182,9 @@ Configuration Example ProfileApplicability = "default" RoleScopeTagIds = @("0"); TargetedMobileApps = @("<Mobile App Id>"); - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -180,9 +198,17 @@ This example deletes a new App Configuration Device Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -190,12 +216,13 @@ Configuration Example { IntuneAppConfigurationDevicePolicy "IntuneAppConfigurationDevicePolicy-Example" { - Credential = $Credscredential; Description = ""; DisplayName = "Example"; Ensure = "Present"; Id = "0000000-0000-0000-0000-000000000000"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAppConfigurationPolicy.md b/docs/docs/resources/intune/IntuneAppConfigurationPolicy.md index aab0389510..c82c22102d 100644 --- a/docs/docs/resources/intune/IntuneAppConfigurationPolicy.md +++ b/docs/docs/resources/intune/IntuneAppConfigurationPolicy.md @@ -81,9 +81,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -93,7 +101,6 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; CustomSettings = @( MSFT_IntuneAppConfigurationPolicyCustomSetting { name = 'com.microsoft.intune.mam.managedbrowser.BlockListURLs' @@ -108,6 +115,9 @@ Configuration Example value = 'TestValue' }); Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -121,9 +131,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -133,7 +151,6 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; CustomSettings = @( MSFT_IntuneAppConfigurationPolicyCustomSetting { name = 'com.microsoft.intune.mam.managedbrowser.BlockListURLs' @@ -148,6 +165,9 @@ Configuration Example value = 'TestValue2' }); Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -161,9 +181,17 @@ This example creates a new App Configuration Policy. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -173,8 +201,10 @@ Configuration Example { DisplayName = 'ContosoNew' Description = 'New Contoso Policy' - Credential = $Credscredential; Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAppProtectionPolicyAndroid.md b/docs/docs/resources/intune/IntuneAppProtectionPolicyAndroid.md index 3479c429bf..d3a1ef135e 100644 --- a/docs/docs/resources/intune/IntuneAppProtectionPolicyAndroid.md +++ b/docs/docs/resources/intune/IntuneAppProtectionPolicyAndroid.md @@ -100,9 +100,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -131,11 +139,12 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - ``` ### Example 2 @@ -148,9 +157,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -179,11 +196,12 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - ``` ### Example 3 @@ -196,9 +214,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -208,10 +234,11 @@ Configuration Example { DisplayName = 'My DSC Android App Protection Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } - ``` diff --git a/docs/docs/resources/intune/IntuneAppProtectionPolicyiOS.md b/docs/docs/resources/intune/IntuneAppProtectionPolicyiOS.md index cb1bcc00fb..742ce453d8 100644 --- a/docs/docs/resources/intune/IntuneAppProtectionPolicyiOS.md +++ b/docs/docs/resources/intune/IntuneAppProtectionPolicyiOS.md @@ -106,9 +106,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -141,7 +149,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -155,9 +165,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -190,7 +208,9 @@ Configuration Example SaveAsBlocked = $True SimplePinBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -204,9 +224,17 @@ This example creates a new App ProtectionPolicy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -216,7 +244,9 @@ Configuration Example { DisplayName = 'My DSC iOS App Protection Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneApplicationControlPolicyWindows10.md b/docs/docs/resources/intune/IntuneApplicationControlPolicyWindows10.md index ea295e4c90..a45a81497f 100644 --- a/docs/docs/resources/intune/IntuneApplicationControlPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneApplicationControlPolicyWindows10.md @@ -75,9 +75,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -91,7 +99,9 @@ Configuration Example SmartScreenBlockOverrideForFiles = $True SmartScreenEnableInShell = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -107,9 +117,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -123,7 +141,9 @@ Configuration Example SmartScreenBlockOverrideForFiles = $False # Updated Property SmartScreenEnableInShell = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -139,9 +159,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -152,7 +180,9 @@ Configuration Example DisplayName = 'Windows 10 Desktops' Description = 'All windows 10 Desktops' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager.md b/docs/docs/resources/intune/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager.md index 38b4e579d7..4c2dbf4fd5 100644 --- a/docs/docs/resources/intune/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager.md +++ b/docs/docs/resources/intune/IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager.md @@ -95,9 +95,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +117,9 @@ Configuration Example blockadobereaderfromcreatingchildprocesses = "block"; Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -124,9 +134,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -138,7 +156,9 @@ Configuration Example blockadobereaderfromcreatingchildprocesses = "audit"; # Updated Property Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -153,9 +173,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -165,7 +193,9 @@ Configuration Example { DisplayName = 'asr ConfigMgr' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceAndAppManagementAssignmentFilter.md b/docs/docs/resources/intune/IntuneDeviceAndAppManagementAssignmentFilter.md index da57e49e56..869765baaa 100644 --- a/docs/docs/resources/intune/IntuneDeviceAndAppManagementAssignmentFilter.md +++ b/docs/docs/resources/intune/IntuneDeviceAndAppManagementAssignmentFilter.md @@ -61,9 +61,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -76,7 +84,9 @@ Configuration Example Platform = 'windows10AndLater' Rule = "(device.manufacturer -ne `"Microsoft Corporation`")" Ensure = 'Present' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -90,9 +100,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -105,7 +123,9 @@ Configuration Example Platform = 'windows10AndLater' Rule = "(device.manufacturer -ne `"Apple`")" # Updated Property Ensure = 'Present' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -119,9 +139,17 @@ This example creates a new Device and App Management Assignment Filter. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $intuneAdmin + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -131,7 +159,9 @@ Configuration Example { DisplayName = 'Test Device Filter' Ensure = 'Absent' - Credential = $intuneAdmin + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCategory.md b/docs/docs/resources/intune/IntuneDeviceCategory.md index 6bd5ea1b4e..ef79691a7d 100644 --- a/docs/docs/resources/intune/IntuneDeviceCategory.md +++ b/docs/docs/resources/intune/IntuneDeviceCategory.md @@ -56,9 +56,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -69,7 +77,9 @@ Configuration Example DisplayName = 'Contoso' Description = 'Contoso Category' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -83,9 +93,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -96,7 +114,9 @@ Configuration Example DisplayName = 'Contoso' Description = 'Contoso Category - Updated' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -110,9 +130,17 @@ This example creates a new Device Category. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -122,7 +150,9 @@ Configuration Example { DisplayName = 'Contoso' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCleanupRule.md b/docs/docs/resources/intune/IntuneDeviceCleanupRule.md index e6a1755a3d..525c6351cc 100644 --- a/docs/docs/resources/intune/IntuneDeviceCleanupRule.md +++ b/docs/docs/resources/intune/IntuneDeviceCleanupRule.md @@ -57,9 +57,17 @@ This example sets the device cleanup rule. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +79,9 @@ Configuration Example IsSingleInstance = 'Yes' DeviceInactivityBeforeRetirementInDays = 25 # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroid.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroid.md index b6ba7e74d0..f80985d6ae 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroid.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroid.md @@ -262,9 +262,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -294,7 +302,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -308,9 +318,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -340,7 +358,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -354,9 +374,17 @@ This example creates a new Device Compliance Policy for Android devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -366,7 +394,9 @@ Configuration Example { DisplayName = 'Test Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidDeviceOwner.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidDeviceOwner.md index e82ef37850..5077132b8a 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidDeviceOwner.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidDeviceOwner.md @@ -206,9 +206,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -234,7 +242,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -249,9 +259,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -277,7 +295,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -292,9 +312,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -320,7 +348,9 @@ Configuration Example PasswordPreviousPasswordCountToBlock = 13 StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidWorkProfile.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidWorkProfile.md index 3ad55ebaba..0ac8a37438 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidWorkProfile.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyAndroidWorkProfile.md @@ -214,9 +214,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -244,7 +252,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -258,9 +268,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -288,7 +306,9 @@ Configuration Example SecurityRequireVerifyApps = $False StorageRequireEncryption = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -302,9 +322,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -314,7 +342,9 @@ Configuration Example { DisplayName = 'Test Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyMacOS.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyMacOS.md index 537b3b1a93..1dbafd1602 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyMacOS.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyMacOS.md @@ -171,9 +171,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -201,7 +209,9 @@ Configuration Example FirewallBlockAllIncoming = $False FirewallEnableStealthMode = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -215,9 +225,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -245,7 +263,9 @@ Configuration Example FirewallBlockAllIncoming = $False FirewallEnableStealthMode = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -259,9 +279,17 @@ This example creates a new Device Comliance Policy for MacOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -271,7 +299,9 @@ Configuration Example { DisplayName = 'MacOS DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyWindows10.md index 0f91d8a81d..f9249a42a4 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyWindows10.md @@ -287,9 +287,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -332,7 +340,9 @@ Configuration Example deviceCompliancePolicyScript = $null ValidOperatingSystemBuildRanges = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -346,9 +356,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -391,7 +409,9 @@ Configuration Example deviceCompliancePolicyScript = $null ValidOperatingSystemBuildRanges = @() Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -405,9 +425,17 @@ This example creates a new Device Comliance Policy for Windows. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -417,7 +445,9 @@ Configuration Example { DisplayName = 'Windows 10 DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyiOs.md b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyiOs.md index cfbcb3c725..b52a7bcd11 100644 --- a/docs/docs/resources/intune/IntuneDeviceCompliancePolicyiOs.md +++ b/docs/docs/resources/intune/IntuneDeviceCompliancePolicyiOs.md @@ -100,9 +100,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -127,8 +135,9 @@ Configuration Example DeviceThreatProtectionRequiredSecurityLevel = 'medium' ManagedEmailProfileRequired = $True Ensure = 'Present' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -142,9 +151,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -169,8 +186,9 @@ Configuration Example DeviceThreatProtectionRequiredSecurityLevel = 'medium' ManagedEmailProfileRequired = $True Ensure = 'Present' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -184,9 +202,17 @@ This example creates a new Device Compliance Policy for iOs devices Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -196,8 +222,9 @@ Configuration Example { DisplayName = 'Test iOS Device Compliance Policy' Ensure = 'Absent' - Credential = $Credscredential - + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10.md index 7073741793..b40d25a38c 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10.md @@ -129,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -139,7 +147,6 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments { @@ -261,6 +268,9 @@ Configuration Example DisplayName = 'admin template' Ensure = 'Present' PolicyConfigurationIngestionType = 'unknown' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -275,9 +285,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -285,7 +303,6 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments { @@ -407,6 +424,9 @@ Configuration Example DisplayName = 'admin template' Ensure = 'Present' PolicyConfigurationIngestionType = 'builtIn' # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -421,9 +441,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -431,9 +459,11 @@ Configuration Example { IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 'Example' { - Credential = $Credscredential DisplayName = 'admin template' Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationCustomPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationCustomPolicyWindows10.md index 8dc5f537a4..1cab65c261 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationCustomPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationCustomPolicyWindows10.md @@ -90,9 +90,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -106,7 +114,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; OmaSettings = @( @@ -130,6 +137,9 @@ Configuration Example } ); SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -144,9 +154,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -160,7 +178,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; OmaSettings = @( @@ -184,6 +201,9 @@ Configuration Example } ); SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -198,9 +218,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -208,9 +236,11 @@ Configuration Example { IntuneDeviceConfigurationCustomPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.md index 442a3a4a95..4cb1a2d2a3 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.md @@ -79,9 +79,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -99,10 +107,12 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; EnableExpeditedTelemetryReporting = $True; Ensure = "Present"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -117,9 +127,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -136,10 +154,12 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; EnableExpeditedTelemetryReporting = $True; Ensure = "Present"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -154,9 +174,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -164,9 +192,11 @@ Configuration Example { IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "MDE onboarding Legacy"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10.md index 0a8ddae0ed..0bf2db5749 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10.md @@ -135,9 +135,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -160,7 +168,6 @@ Configuration Example CacheServerBackgroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerForegroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerHostNames = @("domain.com"); - Credential = $Credscredential; DeliveryOptimizationMode = "httpWithPeeringPrivateGroup"; DisplayName = "delivery optimisation"; Ensure = "Present"; @@ -182,6 +189,9 @@ Configuration Example RestrictPeerSelectionBy = "subnetMask"; SupportsScopeTags = $True; VpnPeerCaching = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -196,9 +206,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -221,7 +239,6 @@ Configuration Example CacheServerBackgroundDownloadFallbackToHttpDelayInSeconds = 5; # Updated Property CacheServerForegroundDownloadFallbackToHttpDelayInSeconds = 3; CacheServerHostNames = @("domain.com"); - Credential = $Credscredential; DeliveryOptimizationMode = "httpWithPeeringPrivateGroup"; DisplayName = "delivery optimisation"; Ensure = "Present"; @@ -243,6 +260,9 @@ Configuration Example RestrictPeerSelectionBy = "subnetMask"; SupportsScopeTags = $True; VpnPeerCaching = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -257,9 +277,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -267,9 +295,11 @@ Configuration Example { IntuneDeviceConfigurationDeliveryOptimizationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "delivery optimisation"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationDomainJoinPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationDomainJoinPolicyWindows10.md index 5683f64725..a705947392 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationDomainJoinPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationDomainJoinPolicyWindows10.md @@ -77,9 +77,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -96,11 +104,13 @@ Configuration Example ); ComputerNameStaticPrefix = "WK-"; ComputerNameSuffixRandomCharCount = 12; - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Present"; OrganizationalUnit = "OU=workstation,CN=domain,CN=com"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -115,9 +125,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -134,11 +152,13 @@ Configuration Example ); ComputerNameStaticPrefix = "WK-"; ComputerNameSuffixRandomCharCount = 12; - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Present"; OrganizationalUnit = "OU=workstation,CN=domain,CN=com"; SupportsScopeTags = $False; # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -153,9 +173,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -163,9 +191,11 @@ Configuration Example { IntuneDeviceConfigurationDomainJoinPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Domain Join"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationEmailProfilePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationEmailProfilePolicyWindows10.md index abe3499923..d798e86d27 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationEmailProfilePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationEmailProfilePolicyWindows10.md @@ -85,9 +85,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,7 +110,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "email"; DurationOfEmailToSync = "unlimited"; EmailAddressSource = "primarySmtpAddress"; @@ -113,6 +120,9 @@ Configuration Example SyncCalendar = $True; SyncContacts = $True; SyncTasks = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -127,9 +137,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -144,7 +162,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "email"; DurationOfEmailToSync = "unlimited"; EmailAddressSource = "primarySmtpAddress"; @@ -155,6 +172,9 @@ Configuration Example SyncCalendar = $True; SyncContacts = $True; SyncTasks = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -169,9 +189,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -179,9 +207,11 @@ Configuration Example { IntuneDeviceConfigurationEmailProfilePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "email"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10.md index c1c6bddc91..86f72ab269 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationEndpointProtectionPolicyWindows10.md @@ -435,9 +435,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -508,7 +516,6 @@ Configuration Example StartupAuthenticationTpmKeyUsage = 'allowed' StartupAuthenticationBlockWithoutTpmChip = $False }; - Credential = $Credscredential; DefenderAdditionalGuardedFolders = @(); DefenderAdobeReaderLaunchChildProcess = "notConfigured"; DefenderAdvancedRansomewareProtectionType = "notConfigured"; @@ -670,6 +677,9 @@ Configuration Example XboxServicesLiveAuthManagerServiceStartupMode = "manual"; XboxServicesLiveGameSaveServiceStartupMode = "manual"; XboxServicesLiveNetworkingServiceStartupMode = "manual"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -684,9 +694,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -757,7 +775,6 @@ Configuration Example StartupAuthenticationTpmKeyUsage = 'allowed' StartupAuthenticationBlockWithoutTpmChip = $False }; - Credential = $Credscredential; DefenderAdditionalGuardedFolders = @(); DefenderAdobeReaderLaunchChildProcess = "notConfigured"; DefenderAdvancedRansomewareProtectionType = "notConfigured"; @@ -919,6 +936,9 @@ Configuration Example XboxServicesLiveAuthManagerServiceStartupMode = "manual"; XboxServicesLiveGameSaveServiceStartupMode = "manual"; XboxServicesLiveNetworkingServiceStartupMode = "manual"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -933,9 +953,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -944,8 +972,10 @@ Configuration Example IntuneDeviceConfigurationEndpointProtectionPolicyWindows10 'Example' { DisplayName = "endpoint protection legacy - dsc v2.0"; - Credential = $Credscredential; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10.md index 3f44c28cd7..6ec96ea63a 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10.md @@ -94,9 +94,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -115,7 +123,6 @@ Configuration Example BootFromExternalMedia = "notConfigured"; Cameras = "enabled"; ChangeUefiSettingsPermission = "notConfiguredOnly"; - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Present"; FrontCamera = "enabled"; @@ -135,6 +142,9 @@ Configuration Example WiFi = "notConfigured"; WindowsPlatformBinaryTable = "enabled"; WirelessWideAreaNetwork = "notConfigured"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -149,9 +159,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -170,7 +188,6 @@ Configuration Example BootFromExternalMedia = "notConfigured"; Cameras = "enabled"; # Updated Property ChangeUefiSettingsPermission = "notConfiguredOnly"; - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Present"; FrontCamera = "enabled"; @@ -190,6 +207,9 @@ Configuration Example WiFi = "notConfigured"; WindowsPlatformBinaryTable = "enabled"; WirelessWideAreaNetwork = "notConfigured"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -204,9 +224,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -214,9 +242,11 @@ Configuration Example { IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "firmware"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10.md index ac8d7b57a4..b22ae76162 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10.md @@ -76,9 +76,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -94,10 +102,12 @@ Configuration Example } ); ConfigDeviceHealthMonitoringScope = @("bootPerformance","windowsUpdates"); - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Present"; SupportsScopeTags = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -112,9 +122,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -130,10 +148,12 @@ Configuration Example } ); ConfigDeviceHealthMonitoringScope = @("bootPerformance","windowsUpdates"); - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Present"; SupportsScopeTags = $False; # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -148,9 +168,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -158,9 +186,11 @@ Configuration Example { IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Health Monitoring Configuration"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10.md index 295b97f7ec..2d9c1e50bd 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationIdentityProtectionPolicyWindows10.md @@ -87,9 +87,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -103,7 +111,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "identity protection"; EnhancedAntiSpoofingForFacialFeaturesEnabled = $True; Ensure = "Present"; @@ -121,6 +128,9 @@ Configuration Example UseCertificatesForOnPremisesAuthEnabled = $True; UseSecurityKeyForSignin = $True; WindowsHelloForBusinessBlocked = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -135,9 +145,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -151,7 +169,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "identity protection"; EnhancedAntiSpoofingForFacialFeaturesEnabled = $True; Ensure = "Present"; @@ -169,6 +186,9 @@ Configuration Example UseCertificatesForOnPremisesAuthEnabled = $True; UseSecurityKeyForSignin = $True; WindowsHelloForBusinessBlocked = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -183,9 +203,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -193,9 +221,11 @@ Configuration Example { IntuneDeviceConfigurationIdentityProtectionPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "identity protection"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10.md index 8162f3d521..cb9e49e688 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10.md @@ -79,9 +79,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -97,7 +105,6 @@ Configuration Example ); CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 1; - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Present"; IntendedPurpose = "unassigned"; @@ -105,6 +112,9 @@ Configuration Example RenewalThresholdPercentage = 50; SubjectAlternativeNameType = "emailAddress"; SubjectNameFormat = "commonName"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -119,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -137,7 +155,6 @@ Configuration Example ); CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 1; - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Present"; IntendedPurpose = "unassigned"; @@ -145,6 +162,9 @@ Configuration Example RenewalThresholdPercentage = 60; # Updated Property SubjectAlternativeNameType = "emailAddress"; SubjectNameFormat = "commonName"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -159,9 +179,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -169,9 +197,11 @@ Configuration Example { IntuneDeviceConfigurationImportedPfxCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "PKCS Imported"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationKioskPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationKioskPolicyWindows10.md index 276d034e81..998029d885 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationKioskPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationKioskPolicyWindows10.md @@ -203,9 +203,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -219,7 +227,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "kiosk"; EdgeKioskEnablePublicBrowsing = $False; Ensure = "Present"; @@ -259,6 +266,9 @@ Configuration Example Recurrence = 'daily' DayofWeek = 'sunday' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -273,9 +283,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -289,7 +307,6 @@ Configuration Example dataType = '#microsoft.graph.allLicensedUsersAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "kiosk"; EdgeKioskEnablePublicBrowsing = $False; # Updated Property Ensure = "Present"; @@ -329,6 +346,9 @@ Configuration Example Recurrence = 'daily' DayofWeek = 'sunday' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -343,9 +363,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -353,9 +381,11 @@ Configuration Example { IntuneDeviceConfigurationKioskPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "kiosk"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10.md index 6223fcad87..756039e8b5 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10.md @@ -109,9 +109,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +133,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Present"; SupportsScopeTags = $True; @@ -144,6 +151,9 @@ Configuration Example ) NeutralDomainResources = @() }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -158,9 +168,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -174,7 +192,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Present"; SupportsScopeTags = $False; # Updated Property @@ -193,6 +210,9 @@ Configuration Example ) NeutralDomainResources = @() }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -207,9 +227,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -217,9 +245,11 @@ Configuration Example { IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "network boundary"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10.md index 6007fbc0c6..150c6e599a 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPkcsCertificatePolicyWindows10.md @@ -104,9 +104,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -126,7 +134,6 @@ Configuration Example CertificateValidityPeriodValue = 1; CertificationAuthority = "CA=Name"; CertificationAuthorityName = "Test"; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -140,6 +147,9 @@ Configuration Example SubjectAlternativeNameType = "none"; SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -154,9 +164,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -176,7 +194,6 @@ Configuration Example CertificateValidityPeriodValue = 1; CertificationAuthority = "CA=Name"; CertificationAuthorityName = "Test"; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -190,6 +207,9 @@ Configuration Example SubjectAlternativeNameType = "none"; SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -204,9 +224,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -214,9 +242,11 @@ Configuration Example { IntuneDeviceConfigurationPkcsCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "PKCS"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptMacOS.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptMacOS.md index 022d2c4211..00ee60fb40 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptMacOS.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptMacOS.md @@ -79,9 +79,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -95,7 +103,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; BlockExecutionNotifications = $False; @@ -107,7 +114,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAsAccount = "user"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -122,9 +131,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -138,7 +155,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; BlockExecutionNotifications = $False; @@ -150,7 +166,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAsAccount = "user"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -165,9 +183,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -175,10 +201,12 @@ Configuration Example { IntuneDeviceConfigurationPlatformScriptMacOS 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; Id = "00000000-0000-0000-0000-000000000000"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptWindows.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptWindows.md index 961259c9f9..8daa7a321e 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptWindows.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPlatformScriptWindows.md @@ -78,9 +78,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -94,7 +102,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; EnforceSignatureCheck = $False; @@ -103,7 +110,9 @@ Configuration Example RunAs32Bit = $True; RunAsAccount = "system"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -118,9 +127,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -134,7 +151,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Present"; EnforceSignatureCheck = $False; @@ -143,7 +159,9 @@ Configuration Example RunAs32Bit = $False; # Updated property RunAsAccount = "system"; ScriptContent = "Base64 encoded script content"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -158,9 +176,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -168,11 +194,12 @@ Configuration Example { IntuneDeviceConfigurationPlatformScriptWindows 'Example' { - Credential = $Credscredential; DisplayName = "custom"; Ensure = "Absent"; Id = "00000000-0000-0000-0000-000000000000"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator.md index 6d3d0ffe97..0c8d6a404f 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator.md @@ -134,9 +134,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -200,7 +208,9 @@ Configuration Example WebBrowserCookieSettings = 'allowAlways' WiFiBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -215,9 +225,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -281,7 +299,9 @@ Configuration Example WebBrowserCookieSettings = 'allowAlways' WiFiBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -296,9 +316,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -308,7 +336,9 @@ Configuration Example { DisplayName = 'Android device admin' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceOwner.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceOwner.md index d1b4efc9fa..599a916218 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceOwner.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidDeviceOwner.md @@ -305,9 +305,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -357,7 +365,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfilePasswordRequireUnlock = 'deviceDefault' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -372,9 +382,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -424,7 +442,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfilePasswordRequireUnlock = 'deviceDefault' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -439,9 +459,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -451,7 +479,9 @@ Configuration Example { DisplayName = 'general confi - AndroidDeviceOwner' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject.md index dc7a0be1ec..4052c23262 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidOpenSourceProject.md @@ -85,9 +85,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -108,7 +116,9 @@ Configuration Example ScreenCaptureBlocked = $True StorageBlockExternalMedia = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -123,9 +133,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -146,7 +164,9 @@ Configuration Example ScreenCaptureBlocked = $True StorageBlockExternalMedia = $True Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -161,9 +181,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -173,7 +201,9 @@ Configuration Example { DisplayName = 'aosp' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidWorkProfile.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidWorkProfile.md index fe00ed6616..830ea4f2f4 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidWorkProfile.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyAndroidWorkProfile.md @@ -114,9 +114,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -146,7 +154,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfileRequirePassword = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -160,9 +170,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -192,7 +210,9 @@ Configuration Example WorkProfilePasswordRequiredType = 'deviceDefault' WorkProfileRequirePassword = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -206,9 +226,17 @@ This example creates a new General Device Configuration Policy for Android WorkP Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -218,7 +246,9 @@ Configuration Example { DisplayName = 'Android Work Profile - Device Restrictions - Standard' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyMacOS.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyMacOS.md index 80d452577d..44ac6ea8b4 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyMacOS.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyMacOS.md @@ -187,9 +187,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -290,7 +298,9 @@ Configuration Example UpdateDelayPolicy = @('delayOSUpdateVisibility', 'delayAppUpdateVisibility', 'delayMajorOsUpdateVisibility') WallpaperModificationBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -305,9 +315,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -408,7 +426,9 @@ Configuration Example UpdateDelayPolicy = @('delayOSUpdateVisibility', 'delayAppUpdateVisibility', 'delayMajorOsUpdateVisibility') WallpaperModificationBlocked = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -423,9 +443,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -435,7 +463,9 @@ Configuration Example { DisplayName = 'MacOS device restriction' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyWindows10.md index 2a5101f5bf..076052931f 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyWindows10.md @@ -405,9 +405,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -446,7 +454,6 @@ Configuration Example ConnectedDevicesServiceBlocked = $False; CopyPasteBlocked = $False; CortanaBlocked = $False; - Credential = $Credscredential; CryptographyAllowFipsAlgorithmPolicy = $False; DefenderBlockEndUserAccess = $False; DefenderBlockOnAccessProtection = $False; @@ -666,6 +673,9 @@ Configuration Example WirelessDisplayBlockProjectionToThisDevice = $False; WirelessDisplayBlockUserInputFromReceiver = $False; WirelessDisplayRequirePinForPairing = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -680,9 +690,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -721,7 +739,6 @@ Configuration Example ConnectedDevicesServiceBlocked = $False; CopyPasteBlocked = $False; CortanaBlocked = $False; - Credential = $Credscredential; CryptographyAllowFipsAlgorithmPolicy = $False; DefenderBlockEndUserAccess = $False; DefenderBlockOnAccessProtection = $False; @@ -941,6 +958,9 @@ Configuration Example WirelessDisplayBlockProjectionToThisDevice = $False; WirelessDisplayBlockUserInputFromReceiver = $False; WirelessDisplayRequirePinForPairing = $False; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -955,9 +975,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -965,9 +993,11 @@ Configuration Example { IntuneDeviceConfigurationPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "device config"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyiOS.md b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyiOS.md index bb2ed9c19a..56ff63330b 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyiOS.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationPolicyiOS.md @@ -361,9 +361,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -480,7 +488,9 @@ Configuration Example VoiceDialingBlocked = $False WallpaperBlockModification = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -494,9 +504,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -613,7 +631,9 @@ Configuration Example VoiceDialingBlocked = $False WallpaperBlockModification = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -627,9 +647,17 @@ This example creates a new Device Configuration Policy for iOS. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -639,7 +667,9 @@ Configuration Example { DisplayName = 'iOS DSC Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationScepCertificatePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationScepCertificatePolicyWindows10.md index da2f130324..9f84dbc720 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationScepCertificatePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationScepCertificatePolicyWindows10.md @@ -107,9 +107,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -126,7 +134,6 @@ Configuration Example CertificateStore = "user"; CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 5; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -151,6 +158,9 @@ Configuration Example SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; RootCertificateId = "169bf4fc-5914-40f4-ad33-48c225396183"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -165,9 +175,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -184,7 +202,6 @@ Configuration Example CertificateStore = "user"; CertificateValidityPeriodScale = "years"; CertificateValidityPeriodValue = 5; - Credential = $Credscredential; CustomSubjectAlternativeNames = @( MSFT_MicrosoftGraphcustomSubjectAlternativeName{ SanType = 'domainNameService' @@ -209,6 +226,9 @@ Configuration Example SubjectNameFormat = "custom"; SubjectNameFormatString = "CN={{UserName}},E={{EmailAddress}}"; RootCertificateId = "169bf4fc-5914-40f4-ad33-48c225396183"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -223,9 +243,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -233,9 +261,11 @@ Configuration Example { IntuneDeviceConfigurationScepCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "SCEP"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10.md index 68d50ba62a..f864dc4e88 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationSecureAssessmentPolicyWindows10.md @@ -80,9 +80,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,11 +110,13 @@ Configuration Example ); ConfigurationAccount = "user@domain.com"; ConfigurationAccountType = "azureADAccount"; - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Present"; LaunchUri = "https://assessment.domain.com"; LocalGuestAccountName = ""; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -121,9 +131,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -143,11 +161,13 @@ Configuration Example ); ConfigurationAccount = "user@domain.com"; ConfigurationAccountType = "azureADAccount"; - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Present"; LaunchUri = "https://assessment.domain.com"; LocalGuestAccountName = ""; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -162,9 +182,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -172,9 +200,11 @@ Configuration Example { IntuneDeviceConfigurationSecureAssessmentPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Secure Assessment"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10.md index 16dcf8a7da..443fb8dac9 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10.md @@ -101,9 +101,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -124,7 +132,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisableAccountManager = $False; DisableEduPolicies = $False; DisablePowerPolicies = $False; @@ -140,6 +147,9 @@ Configuration Example SetEduPolicies = "enabled"; SetPowerPolicies = "enabled"; SignInOnResume = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -154,9 +164,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -177,7 +195,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; DisableAccountManager = $False; DisableEduPolicies = $False; DisablePowerPolicies = $False; @@ -193,6 +210,9 @@ Configuration Example SetEduPolicies = "enabled"; SetPowerPolicies = "enabled"; SignInOnResume = "enabled"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -207,9 +227,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -217,9 +245,11 @@ Configuration Example { IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Shared Multi device"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10.md index 2aac250211..90261573a7 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationTrustedCertificatePolicyWindows10.md @@ -75,9 +75,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -92,11 +100,13 @@ Configuration Example } ); CertFileName = "RootCA.cer"; - Credential = $Credscredential; DestinationStore = "computerCertStoreRoot"; DisplayName = "Trusted Cert"; Ensure = "Present"; TrustedRootCertificate = "MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA="; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -111,9 +121,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -128,11 +146,13 @@ Configuration Example } ); CertFileName = "RootNew.cer"; # Updated Property - Credential = $Credscredential; DestinationStore = "computerCertStoreRoot"; DisplayName = "Trusted Cert"; Ensure = "Present"; TrustedRootCertificate = "MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChjKSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9gMmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbBRucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMUYFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4XfAgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAyn54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVnbA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiPfriXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM09VUP0bNHFWmcNsSOoeTdZ+n0qA="; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -147,9 +167,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -157,9 +185,11 @@ Configuration Example { IntuneDeviceConfigurationTrustedCertificatePolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Trusted Cert"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationVpnPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationVpnPolicyWindows10.md index bade0d24d3..f677318176 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationVpnPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationVpnPolicyWindows10.md @@ -212,9 +212,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -231,7 +239,6 @@ Configuration Example AuthenticationMethod = "usernameAndPassword"; ConnectionName = "Cisco VPN"; ConnectionType = "ciscoAnyConnect"; - Credential = $Credscredential; CustomXml = ""; DisplayName = "VPN"; DnsRules = @( @@ -279,6 +286,9 @@ Configuration Example } ); TrustedNetworkDomains = @(); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -293,9 +303,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -312,7 +330,6 @@ Configuration Example AuthenticationMethod = "usernameAndPassword"; ConnectionName = "Cisco VPN"; ConnectionType = "ciscoAnyConnect"; - Credential = $Credscredential; CustomXml = ""; DisplayName = "VPN"; DnsRules = @( @@ -360,6 +377,9 @@ Configuration Example } ); TrustedNetworkDomains = @(); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -374,9 +394,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -384,9 +412,11 @@ Configuration Example { IntuneDeviceConfigurationVpnPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "VPN"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationWindowsTeamPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationWindowsTeamPolicyWindows10.md index 3efa4dff87..93cceec8d8 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationWindowsTeamPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationWindowsTeamPolicyWindows10.md @@ -93,9 +93,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -111,7 +119,6 @@ Configuration Example ); AzureOperationalInsightsBlockTelemetry = $True; ConnectAppBlockAutoLaunch = $True; - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Present"; MaintenanceWindowBlocked = $False; @@ -126,6 +133,9 @@ Configuration Example SupportsScopeTags = $True; WelcomeScreenBlockAutomaticWakeUp = $True; WelcomeScreenMeetingInformation = "showOrganizerAndTimeOnly"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -140,9 +150,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -158,7 +176,6 @@ Configuration Example ); AzureOperationalInsightsBlockTelemetry = $False; # Updated Property ConnectAppBlockAutoLaunch = $True; - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Present"; MaintenanceWindowBlocked = $False; @@ -173,6 +190,9 @@ Configuration Example SupportsScopeTags = $True; WelcomeScreenBlockAutomaticWakeUp = $True; WelcomeScreenMeetingInformation = "showOrganizerAndTimeOnly"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -187,9 +207,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -197,9 +225,11 @@ Configuration Example { IntuneDeviceConfigurationWindowsTeamPolicyWindows10 'Example' { - Credential = $Credscredential; DisplayName = "Device restrictions (Windows 10 Team)"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceConfigurationWiredNetworkPolicyWindows10.md b/docs/docs/resources/intune/IntuneDeviceConfigurationWiredNetworkPolicyWindows10.md index c296f6dc23..ab63011a7a 100644 --- a/docs/docs/resources/intune/IntuneDeviceConfigurationWiredNetworkPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceConfigurationWiredNetworkPolicyWindows10.md @@ -101,9 +101,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -124,7 +132,6 @@ Configuration Example AuthenticationRetryDelayPeriodInSeconds = 5 AuthenticationType = 'machine' CacheCredentials = $True - Credential = $Credscredential DisplayName = 'Wired Network' EapolStartPeriodInSeconds = 5 EapType = 'teap' @@ -136,6 +143,9 @@ Configuration Example TrustedServerCertificateNames = @('srv.domain.com') RootCertificatesForServerValidationIds = @('a485d322-13cd-43ef-beda-733f656f48ea', '169bf4fc-5914-40f4-ad33-48c225396183') SecondaryIdentityCertificateForClientAuthenticationId = '0b9aef2f-1671-4260-8eb9-3ab3138e176a' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -150,9 +160,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -173,7 +191,6 @@ Configuration Example AuthenticationRetryDelayPeriodInSeconds = 5 AuthenticationType = 'machine' CacheCredentials = $True - Credential = $Credscredential DisplayName = 'Wired Network' EapolStartPeriodInSeconds = 5 EapType = 'teap' @@ -185,6 +202,9 @@ Configuration Example TrustedServerCertificateNames = @('srv.domain.com') RootCertificatesForServerValidationIds = @('a485d322-13cd-43ef-beda-733f656f48ea', '169bf4fc-5914-40f4-ad33-48c225396183') SecondaryIdentityCertificateForClientAuthenticationId = '0b9aef2f-1671-4260-8eb9-3ab3138e176a' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -199,9 +219,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -209,9 +237,11 @@ Configuration Example { IntuneDeviceConfigurationWiredNetworkPolicyWindows10 'Example' { - Credential = $Credscredential DisplayName = 'Wired Network' Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceEnrollmentLimitRestriction.md b/docs/docs/resources/intune/IntuneDeviceEnrollmentLimitRestriction.md index 6380f1c06e..8c2973162c 100644 --- a/docs/docs/resources/intune/IntuneDeviceEnrollmentLimitRestriction.md +++ b/docs/docs/resources/intune/IntuneDeviceEnrollmentLimitRestriction.md @@ -57,9 +57,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -71,7 +79,9 @@ Configuration Example Description = 'My Restriction' Limit = 12 Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -85,9 +95,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -99,7 +117,9 @@ Configuration Example Description = 'My Restriction' Limit = 11 # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -113,9 +133,17 @@ This example creates a new Device Enrollment Limit Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -125,7 +153,9 @@ Configuration Example { DisplayName = 'My DSC Limit' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceEnrollmentPlatformRestriction.md b/docs/docs/resources/intune/IntuneDeviceEnrollmentPlatformRestriction.md index cc0062d561..30dcaf901c 100644 --- a/docs/docs/resources/intune/IntuneDeviceEnrollmentPlatformRestriction.md +++ b/docs/docs/resources/intune/IntuneDeviceEnrollmentPlatformRestriction.md @@ -99,9 +99,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -122,7 +130,6 @@ Configuration Example deviceAndAppManagementAssignmentFilterType = 'none' dataType = '#microsoft.graph.allDevicesAssignmentTarget' }); - Credential = $Credscredential Description = "This is the default Device Type Restriction applied with the lowest priority to all users regardless of group membership."; DeviceEnrollmentConfigurationType = "platformRestrictions"; DisplayName = "All users and all devices"; @@ -152,6 +159,9 @@ Configuration Example platformBlocked = $False personalDeviceEnrollmentBlocked = $False }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -165,9 +175,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -188,7 +206,6 @@ Configuration Example deviceAndAppManagementAssignmentFilterType = 'none' dataType = '#microsoft.graph.allDevicesAssignmentTarget' }); - Credential = $Credscredential Description = "This is the default Device Type Restriction applied with the lowest priority to all users regardless of group membership."; DeviceEnrollmentConfigurationType = "platformRestrictions"; DisplayName = "All users and all devices"; @@ -218,6 +235,9 @@ Configuration Example platformBlocked = $False personalDeviceEnrollmentBlocked = $False }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -231,9 +251,17 @@ This example creates a new Device Enrollment Platform Restriction. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -241,7 +269,6 @@ Configuration Example { IntuneDeviceEnrollmentPlatformRestriction 'DeviceEnrollmentPlatformRestriction' { - Credential = $Credscredential DisplayName = "Removed Policy"; Ensure = "Absent"; Assignments = @(); @@ -253,7 +280,9 @@ Configuration Example PersonalDeviceEnrollmentBlocked = $False }; Priority = 1; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceEnrollmentStatusPageWindows10.md b/docs/docs/resources/intune/IntuneDeviceEnrollmentStatusPageWindows10.md index 187f1779de..231aff3635 100644 --- a/docs/docs/resources/intune/IntuneDeviceEnrollmentStatusPageWindows10.md +++ b/docs/docs/resources/intune/IntuneDeviceEnrollmentStatusPageWindows10.md @@ -85,9 +85,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -117,7 +125,9 @@ Configuration Example SelectedMobileAppIds = @(); ShowInstallationProgress = $True; TrackInstallProgressForAutopilotOnly = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -131,9 +141,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -163,7 +181,9 @@ Configuration Example SelectedMobileAppIds = @(); ShowInstallationProgress = $True; TrackInstallProgressForAutopilotOnly = $True; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -177,9 +197,17 @@ This example creates a new Device Enrollment Status Page. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -189,7 +217,9 @@ Configuration Example { DisplayName = "All users and all devices"; Ensure = "Absent"; - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceManagementComplianceSettings.md b/docs/docs/resources/intune/IntuneDeviceManagementComplianceSettings.md index d373490263..41217dc41e 100644 --- a/docs/docs/resources/intune/IntuneDeviceManagementComplianceSettings.md +++ b/docs/docs/resources/intune/IntuneDeviceManagementComplianceSettings.md @@ -57,9 +57,17 @@ This example updates the Device Management Compliance Settings Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -67,10 +75,12 @@ Configuration Example { IntuneDeviceManagementComplianceSettings 'DeviceManagementComplianceSettings' { - Credential = $Credscredential DeviceComplianceCheckinThresholdDays = 22; IsSingleInstance = "Yes"; SecureByDefault = $True; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDeviceRemediation.md b/docs/docs/resources/intune/IntuneDeviceRemediation.md index d4d43ac6c0..acfe62a44f 100644 --- a/docs/docs/resources/intune/IntuneDeviceRemediation.md +++ b/docs/docs/resources/intune/IntuneDeviceRemediation.md @@ -116,9 +116,17 @@ This example creates a new Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -143,7 +151,6 @@ Configuration Example } } ); - Credential = $Credscredential Description = 'Description' DetectionScriptContent = "Base64 encoded script content"; DeviceHealthScriptType = "deviceHealthScript"; @@ -156,7 +163,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAs32Bit = $True; RunAsAccount = "system"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -170,9 +179,17 @@ This example updates a new Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -197,7 +214,6 @@ Configuration Example } } ); - Credential = $Credscredential Description = 'Description' DetectionScriptContent = "Base64 encoded script content 2"; # Updated property DeviceHealthScriptType = "deviceHealthScript"; @@ -210,7 +226,9 @@ Configuration Example RoleScopeTagIds = @("0"); RunAs32Bit = $True; RunAsAccount = "system"; - TenantId = $OrganizationName; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -224,9 +242,17 @@ This example removes a Device Remediation. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -237,7 +263,9 @@ Configuration Example Id = '00000000-0000-0000-0000-000000000000' DisplayName = 'Device remediation' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDiskEncryptionMacOS.md b/docs/docs/resources/intune/IntuneDiskEncryptionMacOS.md index 112953a0c4..f4289f16e9 100644 --- a/docs/docs/resources/intune/IntuneDiskEncryptionMacOS.md +++ b/docs/docs/resources/intune/IntuneDiskEncryptionMacOS.md @@ -83,9 +83,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -104,7 +112,9 @@ Configuration Example PersonalRecoveryKeyRotationInMonths = 2; RoleScopeTagIds = @("0"); SelectedRecoveryKeyTypes = @("personalRecoveryKey"); - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -119,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -140,7 +158,9 @@ Configuration Example PersonalRecoveryKeyRotationInMonths = 3; # Updated property RoleScopeTagIds = @("0"); SelectedRecoveryKeyTypes = @("personalRecoveryKey"); - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -155,9 +175,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -167,7 +195,9 @@ Configuration Example { DisplayName = 'test' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneDiskEncryptionWindows10.md b/docs/docs/resources/intune/IntuneDiskEncryptionWindows10.md new file mode 100644 index 0000000000..b359738f21 --- /dev/null +++ b/docs/docs/resources/intune/IntuneDiskEncryptionWindows10.md @@ -0,0 +1,251 @@ +# IntuneDiskEncryptionWindows10 + +## Parameters + +| Parameter | Attribute | DataType | Description | Allowed Values | +| --- | --- | --- | --- | --- | +| **Description** | Write | String | Policy description | | +| **DisplayName** | Key | String | Policy name | | +| **RoleScopeTagIds** | Write | StringArray[] | List of Scope Tags for this Entity instance. | | +| **Id** | Write | String | The unique identifier for an entity. Read-only. | | +| **RequireDeviceEncryption** | Write | String | Require Device Encryption (0: Disabled, 1: Enabled) | `0`, `1` | +| **EncryptionMethodWithXts_Name** | Write | String | Choose drive encryption method and cipher strength (Windows 10 [Version 1511] and later) (0: Disabled, 1: Enabled) | `0`, `1` | +| **EncryptionMethodWithXtsOsDropDown_Name** | Write | String | Select the encryption method for operating system drives: (3: AES-CBC 128-bit, 4: AES-CBC 256-bit, 6: XTS-AES 128-bit (default), 7: XTS-AES 256-bit) | `3`, `4`, `6`, `7` | +| **EncryptionMethodWithXtsFdvDropDown_Name** | Write | String | Select the encryption method for fixed data drives: (3: AES-CBC 128-bit, 4: AES-CBC 256-bit, 6: XTS-AES 128-bit (default), 7: XTS-AES 256-bit) | `3`, `4`, `6`, `7` | +| **EncryptionMethodWithXtsRdvDropDown_Name** | Write | String | Select the encryption method for removable data drives: (3: AES-CBC 128-bit (default), 4: AES-CBC 256-bit, 6: XTS-AES 128-bit, 7: XTS-AES 256-bit) | `3`, `4`, `6`, `7` | +| **IdentificationField_Name** | Write | String | Provide the unique identifiers for your organization (0: Disabled, 1: Enabled) | `0`, `1` | +| **IdentificationField** | Write | String | BitLocker identification field: (Device) | | +| **SecIdentificationField** | Write | String | Allowed BitLocker identification field: (Device) | | +| **AllowWarningForOtherDiskEncryption** | Write | String | Allow Warning For Other Disk Encryption (0: Disabled, 1: Enabled) | `0`, `1` | +| **AllowStandardUserEncryption** | Write | String | Allow Standard User Encryption (0: This is the default, when the policy is not set. If current logged on user is a standard user, 'RequireDeviceEncryption' policy will not try to enable encryption on any drive., 1: 'RequireDeviceEncryption' policy will try to enable encryption on all fixed drives even if a current logged in user is standard user.) | `0`, `1` | +| **ConfigureRecoveryPasswordRotation** | Write | String | Configure Recovery Password Rotation (0: Refresh off (default), 1: Refresh on for Azure AD-joined devices, 2: Refresh on for both Azure AD-joined and hybrid-joined devices) | `0`, `1`, `2` | +| **OSEncryptionType_Name** | Write | String | Enforce drive encryption type on operating system drives (0: Disabled, 1: Enabled) | `0`, `1` | +| **OSEncryptionTypeDropDown_Name** | Write | String | Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption) | `0`, `1`, `2` | +| **ConfigureAdvancedStartup_Name** | Write | String | Require additional authentication at startup (0: Disabled, 1: Enabled) | `0`, `1` | +| **ConfigureTPMStartupKeyUsageDropDown_Name** | Write | String | Configure TPM startup key: (2: Allow startup key with TPM, 1: Require startup key with TPM, 0: Do not allow startup key with TPM) | `2`, `1`, `0` | +| **ConfigureTPMPINKeyUsageDropDown_Name** | Write | String | Configure TPM startup key and PIN: (2: Allow startup key and PIN with TPM, 1: Require startup key and PIN with TPM, 0: Do not allow startup key and PIN with TPM) | `2`, `1`, `0` | +| **ConfigureTPMUsageDropDown_Name** | Write | String | Configure TPM startup: (2: Allow TPM, 1: Require TPM, 0: Do not allow TPM) | `2`, `1`, `0` | +| **ConfigureNonTPMStartupKeyUsage_Name** | Write | String | Allow BitLocker without a compatible TPM (requires a password or a startup key on a USB flash drive) (0: False, 1: True) | `0`, `1` | +| **ConfigurePINUsageDropDown_Name** | Write | String | Configure TPM startup PIN: (2: Allow startup PIN with TPM, 1: Require startup PIN with TPM, 0: Do not allow startup PIN with TPM) | `2`, `1`, `0` | +| **MinimumPINLength_Name** | Write | String | Configure minimum PIN length for startup (0: Disabled, 1: Enabled) | `0`, `1` | +| **MinPINLength** | Write | SInt32 | Minimum characters: | | +| **EnhancedPIN_Name** | Write | String | Allow enhanced PINs for startup (0: Disabled, 1: Enabled) | `0`, `1` | +| **DisallowStandardUsersCanChangePIN_Name** | Write | String | Disallow standard users from changing the PIN or password (0: Disabled, 1: Enabled) | `0`, `1` | +| **EnablePreBootPinExceptionOnDECapableDevice_Name** | Write | String | Allow devices compliant with InstantGo or HSTI to opt out of pre-boot PIN. (0: Disabled, 1: Enabled) | `0`, `1` | +| **EnablePrebootInputProtectorsOnSlates_Name** | Write | String | Enable use of BitLocker authentication requiring preboot keyboard input on slates (0: Disabled, 1: Enabled) | `0`, `1` | +| **OSRecoveryUsage_Name** | Write | String | Choose how BitLocker-protected operating system drives can be recovered (0: Disabled, 1: Enabled) | `0`, `1` | +| **OSRequireActiveDirectoryBackup_Name** | Write | String | Do not enable BitLocker until recovery information is stored to AD DS for operating system drives (0: False, 1: True) | `0`, `1` | +| **OSActiveDirectoryBackup_Name** | Write | String | Save BitLocker recovery information to AD DS for operating system drives (0: False, 1: True) | `0`, `1` | +| **OSRecoveryPasswordUsageDropDown_Name** | Write | String | Configure user storage of BitLocker recovery information: (2: Allow 48-digit recovery password, 1: Require 48-digit recovery password, 0: Do not allow 48-digit recovery password) | `2`, `1`, `0` | +| **OSHideRecoveryPage_Name** | Write | String | Omit recovery options from the BitLocker setup wizard (0: False, 1: True) | `0`, `1` | +| **OSAllowDRA_Name** | Write | String | Allow data recovery agent (0: False, 1: True) | `0`, `1` | +| **OSRecoveryKeyUsageDropDown_Name** | Write | String | Configure OS recovery key usage: (2: Allow 256-bit recovery key, 1: Require 256-bit recovery key, 0: Do not allow 256-bit recovery key) | `2`, `1`, `0` | +| **OSActiveDirectoryBackupDropDown_Name** | Write | String | Configure storage of BitLocker recovery information to AD DS: (1: Store recovery passwords and key packages, 2: Store recovery passwords only) | `1`, `2` | +| **PrebootRecoveryInfo_Name** | Write | String | Configure pre-boot recovery message and URL (0: Disabled, 1: Enabled) | `0`, `1` | +| **PrebootRecoveryInfoDropDown_Name** | Write | String | Select an option for the pre-boot recovery message: (0: , 1: Use default recovery message and URL, 2: Use custom recovery message, 3: Use custom recovery URL) | `0`, `1`, `2`, `3` | +| **RecoveryUrl_Input** | Write | String | Custom recovery URL option: | | +| **RecoveryMessage_Input** | Write | String | Custom recovery message option: | | +| **FDVEncryptionType_Name** | Write | String | Enforce drive encryption type on fixed data drives (0: Disabled, 1: Enabled) | `0`, `1` | +| **FDVEncryptionTypeDropDown_Name** | Write | String | Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption) | `0`, `1`, `2` | +| **FDVRecoveryUsage_Name** | Write | String | Choose how BitLocker-protected fixed drives can be recovered (0: Disabled, 1: Enabled) | `0`, `1` | +| **FDVActiveDirectoryBackup_Name** | Write | String | Save BitLocker recovery information to AD DS for fixed data drives (0: False, 1: True) | `0`, `1` | +| **FDVHideRecoveryPage_Name** | Write | String | Omit recovery options from the BitLocker setup wizard (0: False, 1: True) | `0`, `1` | +| **FDVRecoveryPasswordUsageDropDown_Name** | Write | String | Configure user storage of BitLocker recovery information: (2: Allow 48-digit recovery password, 1: Require 48-digit recovery password, 0: Do not allow 48-digit recovery password) | `2`, `1`, `0` | +| **FDVRequireActiveDirectoryBackup_Name** | Write | String | Do not enable BitLocker until recovery information is stored to AD DS for fixed data drives (0: False, 1: True) | `0`, `1` | +| **FDVAllowDRA_Name** | Write | String | Allow data recovery agent (0: False, 1: True) | `0`, `1` | +| **FDVActiveDirectoryBackupDropDown_Name** | Write | String | Configure storage of BitLocker recovery information to AD DS: (1: Backup recovery passwords and key packages, 2: Backup recovery passwords only) | `1`, `2` | +| **FDVRecoveryKeyUsageDropDown_Name** | Write | String | Select the fixed drive recovery key usage: (2: Allow 256-bit recovery key, 1: Require 256-bit recovery key, 0: Do not allow 256-bit recovery key) | `2`, `1`, `0` | +| **FDVDenyWriteAccess_Name** | Write | String | Deny write access to fixed drives not protected by BitLocker (0: Disabled, 1: Enabled) | `0`, `1` | +| **RDVConfigureBDE** | Write | String | Control use of BitLocker on removable drives (0: Disabled, 1: Enabled) | `0`, `1` | +| **RDVAllowBDE_Name** | Write | String | Allow users to apply BitLocker protection on removable data drives (Device) (0: False, 1: True) | `0`, `1` | +| **RDVEncryptionType_Name** | Write | String | Enforce drive encryption type on removable data drives (0: Disabled, 1: Enabled) | `0`, `1` | +| **RDVEncryptionTypeDropDown_Name** | Write | String | Select the encryption type: (Device) (0: Allow user to choose (default), 1: Full encryption, 2: Used Space Only encryption) | `0`, `1`, `2` | +| **RDVDisableBDE_Name** | Write | String | Allow users to suspend and decrypt BitLocker protection on removable data drives (Device) (0: False, 1: True) | `0`, `1` | +| **RDVDenyWriteAccess_Name** | Write | String | Deny write access to removable drives not protected by BitLocker (0: Disabled, 1: Enabled) | `0`, `1` | +| **RDVCrossOrg** | Write | String | Do not allow write access to devices configured in another organization (0: False, 1: True) | `0`, `1` | +| **Assignments** | Write | MSFT_DeviceManagementConfigurationPolicyAssignments[] | Represents the assignment to the Intune policy. | | +| **Ensure** | Write | String | Present ensures the policy exists, absent ensures it is removed. | `Present`, `Absent` | +| **Credential** | Write | PSCredential | Credentials of the Admin | | +| **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | +| **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | +| **ApplicationSecret** | Write | PSCredential | Secret of the Azure Active Directory tenant used for authentication. | | +| **CertificateThumbprint** | Write | String | Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication. | | +| **ManagedIdentity** | Write | Boolean | Managed ID being used for authentication. | | +| **AccessTokens** | Write | StringArray[] | Access token used for authentication. | | + +### MSFT_DeviceManagementConfigurationPolicyAssignments + +#### Parameters + +| Parameter | Attribute | DataType | Description | Allowed Values | +| --- | --- | --- | --- | --- | +| **dataType** | Write | String | The type of the target assignment. | `#microsoft.graph.groupAssignmentTarget`, `#microsoft.graph.allLicensedUsersAssignmentTarget`, `#microsoft.graph.allDevicesAssignmentTarget`, `#microsoft.graph.exclusionGroupAssignmentTarget`, `#microsoft.graph.configurationManagerCollectionAssignmentTarget` | +| **deviceAndAppManagementAssignmentFilterType** | Write | String | The type of filter of the target assignment i.e. Exclude or Include. Possible values are:none, include, exclude. | `none`, `include`, `exclude` | +| **deviceAndAppManagementAssignmentFilterId** | Write | String | The Id of the filter for the target assignment. | | +| **groupId** | Write | String | The group Id that is the target of the assignment. | | +| **groupDisplayName** | Write | String | The group Display Name that is the target of the assignment. | | +| **collectionId** | Write | String | The collection Id that is the target of the assignment.(ConfigMgr) | | + + +## Description + +Intune Disk Encryption for Windows10 + +## Permissions + +### Microsoft Graph + +To authenticate with the Microsoft Graph API, this resource required the following permissions: + +#### Delegated permissions + +- **Read** + + - DeviceManagementConfiguration.Read.All + +- **Update** + + - DeviceManagementConfiguration.ReadWrite.All + +#### Application permissions + +- **Read** + + - DeviceManagementConfiguration.Read.All + +- **Update** + + - DeviceManagementConfiguration.ReadWrite.All + +## Examples + +### Example 1 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments { + deviceAndAppManagementAssignmentFilterType = 'none' + dataType = '#microsoft.graph.allDevicesAssignmentTarget' + }) + Description = '' + IdentificationField_Name = '1' + IdentificationField = 'IdentificationField' + SecIdentificationField = 'SecIdentificationField' + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments { + deviceAndAppManagementAssignmentFilterType = 'none' + dataType = '#microsoft.graph.allDevicesAssignmentTarget' + }) + Description = '' + IdentificationField_Name = '1' + IdentificationField = 'IdentificationField' + SecIdentificationField = 'UpdatedSecIdentificationField' # Updated property + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + Node localhost + { + IntuneDiskEncryptionWindows10 'myDiskEncryption' + { + DisplayName = 'Disk Encryption' + Description = '' + Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + diff --git a/docs/docs/resources/intune/IntuneEndpointDetectionAndResponsePolicyWindows10.md b/docs/docs/resources/intune/IntuneEndpointDetectionAndResponsePolicyWindows10.md index 4aa3c793ab..9893c32f98 100644 --- a/docs/docs/resources/intune/IntuneEndpointDetectionAndResponsePolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneEndpointDetectionAndResponsePolicyWindows10.md @@ -75,9 +75,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -89,7 +97,9 @@ Configuration Example Assignments = @() Description = 'My revised description' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -104,9 +114,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -118,7 +136,9 @@ Configuration Example Assignments = @() Description = 'My updated description' # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -133,9 +153,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -145,7 +173,9 @@ Configuration Example { DisplayName = 'Edr Policy' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneExploitProtectionPolicyWindows10SettingCatalog.md b/docs/docs/resources/intune/IntuneExploitProtectionPolicyWindows10SettingCatalog.md index 05e7646068..17b0440a3d 100644 --- a/docs/docs/resources/intune/IntuneExploitProtectionPolicyWindows10SettingCatalog.md +++ b/docs/docs/resources/intune/IntuneExploitProtectionPolicyWindows10SettingCatalog.md @@ -79,9 +79,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -244,7 +252,9 @@ Configuration Example </AppConfig> </MitigationPolicy>" Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -259,9 +269,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -424,7 +442,9 @@ Configuration Example </AppConfig> </MitigationPolicy>" # Updated Property Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -439,9 +459,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -451,7 +479,9 @@ Configuration Example { DisplayName = 'exploit Protection policy with assignments' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntunePolicySets.md b/docs/docs/resources/intune/IntunePolicySets.md index 2659656ed8..d1bb683e0a 100644 --- a/docs/docs/resources/intune/IntunePolicySets.md +++ b/docs/docs/resources/intune/IntunePolicySets.md @@ -87,16 +87,23 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -123,10 +130,11 @@ Configuration Example } ); RoleScopeTags = @("0","1"); + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } ``` @@ -139,16 +147,23 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -175,10 +190,11 @@ Configuration Example } ); RoleScopeTags = @("0","1","2"); # Updated Property + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } ``` @@ -191,22 +207,30 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName 'Microsoft365DSC' Node localhost { IntunePolicySets "Example" { - Credential = $Credscredential; DisplayName = "Example"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } - } - } ``` diff --git a/docs/docs/resources/intune/IntuneRoleAssignment.md b/docs/docs/resources/intune/IntuneRoleAssignment.md index 71641ec684..ab0133db1c 100644 --- a/docs/docs/resources/intune/IntuneRoleAssignment.md +++ b/docs/docs/resources/intune/IntuneRoleAssignment.md @@ -64,9 +64,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -84,7 +92,9 @@ Configuration Example RoleDefinition = '2d00d0fd-45e9-4166-904f-b76ac5eed2c7' RoleDefinitionDisplayName = 'This is my role' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -98,9 +108,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -118,7 +136,9 @@ Configuration Example RoleDefinition = '2d00d0fd-45e9-4166-904f-b76ac5eed2c7' RoleDefinitionDisplayName = 'This is my role' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -132,9 +152,17 @@ This example creates a new Intune Role Assigment. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -144,7 +172,9 @@ Configuration Example { DisplayName = 'test2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneRoleDefinition.md b/docs/docs/resources/intune/IntuneRoleDefinition.md index 035ff9e956..aab8a240cd 100644 --- a/docs/docs/resources/intune/IntuneRoleDefinition.md +++ b/docs/docs/resources/intune/IntuneRoleDefinition.md @@ -61,9 +61,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -78,7 +86,9 @@ Configuration Example notallowedResourceActions = @() roleScopeTagIds = @('0', '1') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -92,9 +102,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +127,9 @@ Configuration Example notallowedResourceActions = @() roleScopeTagIds = @('0', '1') Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -123,9 +143,17 @@ This example creates a new Intune Role Definition. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -135,7 +163,9 @@ Configuration Example { DisplayName = 'This is my role' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneSettingCatalogASRRulesPolicyWindows10.md b/docs/docs/resources/intune/IntuneSettingCatalogASRRulesPolicyWindows10.md index 9aa201c36c..b565f3f12c 100644 --- a/docs/docs/resources/intune/IntuneSettingCatalogASRRulesPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneSettingCatalogASRRulesPolicyWindows10.md @@ -115,9 +115,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -136,7 +144,9 @@ Configuration Example blockexecutablefilesrunningunlesstheymeetprevalenceagetrustedlistcriterion = 'audit' Description = 'Post' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -151,9 +161,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -172,7 +190,9 @@ Configuration Example blockexecutablefilesrunningunlesstheymeetprevalenceagetrustedlistcriterion = 'audit' Description = 'Post' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -187,9 +207,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -199,7 +227,9 @@ Configuration Example { DisplayName = 'asr 2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneSettingCatalogCustomPolicyWindows10.md b/docs/docs/resources/intune/IntuneSettingCatalogCustomPolicyWindows10.md index 3eb71ca136..fb7b396272 100644 --- a/docs/docs/resources/intune/IntuneSettingCatalogCustomPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneSettingCatalogCustomPolicyWindows10.md @@ -164,9 +164,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -174,7 +182,6 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -243,6 +250,9 @@ Configuration Example } ); Technologies = "mdm"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -257,9 +267,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -267,7 +285,6 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Assignments = @( MSFT_DeviceManagementConfigurationPolicyAssignments{ deviceAndAppManagementAssignmentFilterType = 'none' @@ -336,6 +353,9 @@ Configuration Example } ); Technologies = "mdm"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -350,9 +370,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -360,9 +388,11 @@ Configuration Example { IntuneSettingCatalogCustomPolicyWindows10 'Example' { - Credential = $Credscredential Ensure = "Absent"; Name = "Setting Catalog Raw - DSC"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidDeviceAdministrator.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidDeviceAdministrator.md index 6eddf28dad..8f3324c65a 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidDeviceAdministrator.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidDeviceAdministrator.md @@ -77,9 +77,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -100,7 +108,9 @@ Configuration Example Ssid = 'sf' WiFiSecurityType = 'wpaEnterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -115,9 +125,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -138,7 +156,9 @@ Configuration Example Ssid = 'sf' WiFiSecurityType = 'wpaEnterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -153,9 +173,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -165,7 +193,9 @@ Configuration Example { DisplayName = 'Wifi Configuration Androind Device' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner.md index 2a25e7cd2b..a2d42ba204 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner.md @@ -85,9 +85,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -110,7 +118,9 @@ Configuration Example ProxySettings = 'none' Ssid = 'MySSID - 3' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -126,9 +136,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -151,7 +169,9 @@ Configuration Example ProxySettings = 'none' Ssid = 'MySSID - 3' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -167,9 +187,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -179,7 +207,9 @@ Configuration Example { DisplayName = 'Wifi - androidForWork' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile.md index e287c3661a..3b93f6cb7f 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidEnterpriseWorkProfile.md @@ -78,9 +78,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,7 +110,9 @@ Configuration Example Ssid = 'MySSID' WiFiSecurityType = 'open' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -118,9 +128,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -142,7 +160,9 @@ Configuration Example Ssid = 'MySSID' WiFiSecurityType = 'open' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -158,9 +178,17 @@ Configuration Example { param ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -170,7 +198,9 @@ Configuration Example { DisplayName = 'wifi - android BYOD' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidForWork.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidForWork.md index 337418cbb1..01e681328d 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidForWork.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidForWork.md @@ -77,9 +77,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -104,7 +112,9 @@ Configuration Example Ssid = 'WiFi' WiFiSecurityType = 'wpa2Enterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -119,9 +129,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -146,7 +164,9 @@ Configuration Example Ssid = 'WiFi' WiFiSecurityType = 'wpa2Enterprise' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -161,9 +181,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -173,7 +201,9 @@ Configuration Example { DisplayName = 'AndroindForWork' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidOpenSourceProject.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidOpenSourceProject.md index cd1ebe8313..ef98411a57 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidOpenSourceProject.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyAndroidOpenSourceProject.md @@ -79,9 +79,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -103,7 +111,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -118,9 +128,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -142,7 +160,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -157,9 +177,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -169,7 +197,9 @@ Configuration Example { DisplayName = 'wifi aosp' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyIOS.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyIOS.md index 2375bd1d1b..ddcf26325a 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyIOS.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyIOS.md @@ -83,9 +83,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -109,7 +117,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -124,9 +134,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -150,7 +168,9 @@ Configuration Example Ssid = 'aaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -165,9 +185,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -177,7 +205,9 @@ Configuration Example { DisplayName = 'ios wifi' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyMacOS.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyMacOS.md index cc22276650..57e8731161 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyMacOS.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyMacOS.md @@ -82,9 +82,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -107,7 +115,9 @@ Configuration Example Ssid = 'aaaaaaaaaaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -122,9 +132,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -147,7 +165,9 @@ Configuration Example Ssid = 'aaaaaaaaaaaaa' WiFiSecurityType = 'wpaPersonal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -162,9 +182,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -174,7 +202,9 @@ Configuration Example { DisplayName = 'macos wifi' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyWindows10.md b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyWindows10.md index be916f3b6b..23ba85724c 100644 --- a/docs/docs/resources/intune/IntuneWifiConfigurationPolicyWindows10.md +++ b/docs/docs/resources/intune/IntuneWifiConfigurationPolicyWindows10.md @@ -85,9 +85,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -113,7 +121,9 @@ Configuration Example Ssid = 'ssid' WifiSecurityType = 'wpa2Personal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -128,9 +138,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -156,7 +174,9 @@ Configuration Example Ssid = 'ssid' WifiSecurityType = 'wpa2Personal' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -171,9 +191,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -183,7 +211,9 @@ Configuration Example { DisplayName = 'win10 wifi - revised' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined.md b/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined.md index b260b7e293..43d2e26d9f 100644 --- a/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined.md +++ b/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined.md @@ -108,9 +108,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -119,7 +127,6 @@ Configuration Example IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { Assignments = @(); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = ""; DeviceType = "windowsPc"; @@ -137,6 +144,9 @@ Configuration Example SkipKeyboardSelectionPage = $False UserType = 'standard' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -151,9 +161,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -162,7 +180,6 @@ Configuration Example IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { Assignments = @(); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = ""; DeviceType = "windowsPc"; @@ -180,6 +197,9 @@ Configuration Example SkipKeyboardSelectionPage = $False UserType = 'standard' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -194,9 +214,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -204,9 +232,11 @@ Configuration Example { IntuneWindowsAutopilotDeploymentProfileAzureADHybridJoined 'Example' { - Credential = $Credscredential; DisplayName = "hybrid"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADJoined.md b/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADJoined.md index 6909ac9fbc..526656617c 100644 --- a/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADJoined.md +++ b/docs/docs/resources/intune/IntuneWindowsAutopilotDeploymentProfileAzureADJoined.md @@ -107,9 +107,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -123,7 +131,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = "test"; DeviceType = "windowsPc"; @@ -140,6 +147,9 @@ Configuration Example SkipKeyboardSelectionPage = $True UserType = 'administrator' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -154,9 +164,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -170,7 +188,6 @@ Configuration Example dataType = '#microsoft.graph.allDevicesAssignmentTarget' } ); - Credential = $Credscredential; Description = ""; DeviceNameTemplate = "test"; DeviceType = "windowsPc"; @@ -187,6 +204,9 @@ Configuration Example SkipKeyboardSelectionPage = $True UserType = 'administrator' }; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -201,9 +221,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -211,9 +239,11 @@ Configuration Example { IntuneWindowsAutopilotDeploymentProfileAzureADJoined 'Example' { - Credential = $Credscredential; DisplayName = "AAD"; Ensure = "Absent"; + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled.md b/docs/docs/resources/intune/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled.md index cd23311e1e..e581a1dcc1 100644 --- a/docs/docs/resources/intune/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled.md +++ b/docs/docs/resources/intune/IntuneWindowsInformationProtectionPolicyWindows10MdmEnrolled.md @@ -167,9 +167,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -211,7 +219,9 @@ Configuration Example ProtectionUnderLockConfigRequired = $False RevokeOnUnenrollDisabled = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -226,9 +236,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -270,7 +288,9 @@ Configuration Example ProtectionUnderLockConfigRequired = $False RevokeOnUnenrollDisabled = $False Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -285,9 +305,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -297,7 +325,9 @@ Configuration Example { DisplayName = 'WIP' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10.md b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10.md index 9f0ae10108..edb5abbe42 100644 --- a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10.md +++ b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessDriverUpdateProfileWindows10.md @@ -77,9 +77,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -92,7 +100,9 @@ Configuration Example Description = 'test 2' approvalType = 'manual' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -107,9 +117,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -122,7 +140,9 @@ Configuration Example Description = 'test 3' # Updated property approvalType = 'manual' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -137,9 +157,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -150,7 +178,9 @@ Configuration Example DisplayName = 'Driver Update Example' Description = 'test 2' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10.md b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10.md index 386ba33b3c..6bd3ae2629 100644 --- a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10.md +++ b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessFeatureUpdateProfileWindows10.md @@ -84,9 +84,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -102,7 +110,9 @@ Configuration Example OfferStartDateTimeInUTC = '2023-02-03T16:00:00.0000000+00:00' } Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -117,9 +127,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -135,7 +153,9 @@ Configuration Example OfferStartDateTimeInUTC = '2023-02-05T16:00:00.0000000+00:00' # Updated Property } Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -150,9 +170,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -162,7 +190,9 @@ Configuration Example { DisplayName = 'WUfB Feature -dsc' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } diff --git a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.md b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.md new file mode 100644 index 0000000000..413892c638 --- /dev/null +++ b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10.md @@ -0,0 +1,215 @@ +# IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 + +## Parameters + +| Parameter | Attribute | DataType | Description | Allowed Values | +| --- | --- | --- | --- | --- | +| **DisplayName** | Key | String | The display name for the profile. | | +| **Description** | Write | String | The description of the profile. | | +| **ExpeditedUpdateSettings** | Write | MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings | Expedited update settings. | | +| **RoleScopeTagIds** | Write | StringArray[] | List of Scope Tags for this Quality Update entity. | | +| **Id** | Write | String | The unique identifier for an entity. Read-only. | | +| **Assignments** | Write | MSFT_DeviceManagementConfigurationPolicyAssignments[] | Represents the assignment to the Intune policy. | | +| **Ensure** | Write | String | Present ensures the policy exists, absent ensures it is removed. | `Present`, `Absent` | +| **Credential** | Write | PSCredential | Credentials of the Admin | | +| **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | +| **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | +| **ApplicationSecret** | Write | PSCredential | Secret of the Azure Active Directory tenant used for authentication. | | +| **CertificateThumbprint** | Write | String | Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication. | | +| **ManagedIdentity** | Write | Boolean | Managed ID being used for authentication. | | +| **AccessTokens** | Write | StringArray[] | Access token used for authentication. | | + +### MSFT_DeviceManagementConfigurationPolicyAssignments + +#### Parameters + +| Parameter | Attribute | DataType | Description | Allowed Values | +| --- | --- | --- | --- | --- | +| **dataType** | Write | String | The type of the target assignment. | `#microsoft.graph.groupAssignmentTarget`, `#microsoft.graph.allLicensedUsersAssignmentTarget`, `#microsoft.graph.allDevicesAssignmentTarget`, `#microsoft.graph.exclusionGroupAssignmentTarget`, `#microsoft.graph.configurationManagerCollectionAssignmentTarget` | +| **deviceAndAppManagementAssignmentFilterType** | Write | String | The type of filter of the target assignment i.e. Exclude or Include. Possible values are:none, include, exclude. | `none`, `include`, `exclude` | +| **deviceAndAppManagementAssignmentFilterId** | Write | String | The Id of the filter for the target assignment. | | +| **groupId** | Write | String | The group Id that is the target of the assignment. | | +| **groupDisplayName** | Write | String | The group Display Name that is the target of the assignment. | | +| **collectionId** | Write | String | The collection Id that is the target of the assignment.(ConfigMgr) | | + +### MSFT_MicrosoftGraphExpeditedWindowsQualityUpdateSettings + +#### Parameters + +| Parameter | Attribute | DataType | Description | Allowed Values | +| --- | --- | --- | --- | --- | +| **DaysUntilForcedReboot** | Write | UInt32 | The number of days after installation that forced reboot will happen. Must be in range from 0 to 2. | | +| **QualityUpdateRelease** | Write | String | The release date to identify a quality update. Format is yyyy-MM-ddT00:00:00Z. | | + + +## Description + +Intune Windows Update For Business Quality Update Profile for Windows10 + +## Permissions + +### Microsoft Graph + +To authenticate with the Microsoft Graph API, this resource required the following permissions: + +#### Delegated permissions + +- **Read** + + - DeviceManagementConfiguration.Read.All + +- **Update** + + - DeviceManagementConfiguration.ReadWrite.All + +#### Application permissions + +- **Read** + + - DeviceManagementConfiguration.Read.All + +- **Update** + + - DeviceManagementConfiguration.ReadWrite.All + +## Examples + +### Example 1 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments{ + deviceAndAppManagementAssignmentFilterType = 'none' + groupDisplayName = 'Exclude' + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '258a1749-8408-4dd0-8028-fab6208a28d7' + } + ); + DisplayName = 'Windows Quality Update' + Description = '' + ExpeditedUpdateSettings = MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings{ + QualityUpdateRelease = '2024-06-11T00:00:00Z' + DaysUntilForcedReboot = 0 + } + RoleScopeTagIds = @("0") + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + Assignments = @( + MSFT_DeviceManagementConfigurationPolicyAssignments{ + deviceAndAppManagementAssignmentFilterType = 'none' + groupDisplayName = 'Exclude' + dataType = '#microsoft.graph.exclusionGroupAssignmentTarget' + groupId = '258a1749-8408-4dd0-8028-fab6208a28d7' + } + ); + DisplayName = 'Windows Quality Update' + Description = '' + ExpeditedUpdateSettings = MSFT_MicrosoftGraphexpeditedWindowsQualityUpdateSettings{ + QualityUpdateRelease = '2024-06-11T00:00:00Z' + DaysUntilForcedReboot = 1 # Updated property + } + RoleScopeTagIds = @("0") + Ensure = 'Present' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + IntuneWindowsUpdateForBusinessQualityUpdateProfileWindows10 'Example' + { + DisplayName = 'Windows Quality Update' + Ensure = 'Absent' + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; + } + } +} +``` + diff --git a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10.md b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10.md index caf2890e04..46d2e49c70 100644 --- a/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10.md +++ b/docs/docs/resources/intune/IntuneWindowsUpdateForBusinessRingUpdateProfileWindows10.md @@ -118,9 +118,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -168,7 +176,9 @@ Configuration Example UserPauseAccess = 'enabled' UserWindowsUpdateScanAccess = 'enabled' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -183,9 +193,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -233,7 +251,9 @@ Configuration Example UserPauseAccess = 'enabled' UserWindowsUpdateScanAccess = 'enabled' Ensure = 'Present' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } } @@ -248,9 +268,17 @@ It is not meant to use as a production baseline. Configuration Example { param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential + [Parameter()] + [System.String] + $ApplicationId, + + [Parameter()] + [System.String] + $TenantId, + + [Parameter()] + [System.String] + $CertificateThumbprint ) Import-DscResource -ModuleName Microsoft365DSC @@ -260,7 +288,9 @@ Configuration Example { DisplayName = 'WUfB Ring' Ensure = 'Absent' - Credential = $Credscredential + ApplicationId = $ApplicationId; + TenantId = $TenantId; + CertificateThumbprint = $CertificateThumbprint; } } }