functions/set-d365rsattier2crypto.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

<#
    .SYNOPSIS
        Set the needed configuration to work on Tier2+ environments
         
    .DESCRIPTION
        Set the needed registry settings for when you are running RSAT against a Tier2+ environment
         
    .EXAMPLE
        PS C:\> Set-D365RsatTier2Crypto
         
        This will configure the registry to support RSAT against a Tier2+ environment.
         
    .NOTES
        Tags: RSAT, Testing, Regression Suite Automation Test, Regression, Test, Automation, Configuration
         
        Author: Mötz Jensen (@Splaxi)
         
#>


function Set-D365RsatTier2Crypto {
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]

    [CmdletBinding()]
    [OutputType()]
    param ()
    
    if ((Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319")) {
        Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name SchUseStrongCrypto -Value 1 -Type dword -Force -Confirm:$false
    }
}