Created
December 22, 2021 09:57
-
-
Save lansalot/953c2b46ae48e1b18b18a49e5894a565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)][String] $ADGroupGUID, | |
[Parameter(Mandatory = $true)][String] $VHDXLocation | |
) | |
If ($ADGroupGUID -NotMatch "S-1-5-") { | |
Write-Warning "Looks like ADGroupGUID is NOT a GUID - Aborting FSLogic config!!!" | |
Exit | |
} | |
Write-Output "Creating FSLogix keys for AD Group GUID $($ADGroupGUID) at $($VHDXLocation)" | |
New-Item HKLM:\Software\FSLogix\Profiles -Force | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles -Name Enabled -PropertyType Dword -Value 1 | Out-Null | |
New-Item HKLM:\Software\FSLogix\Profiles\ObjectSpecific | Out-Null | |
New-Item HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Apps -Name CleanupInvalidSessions -PropertyType Dword -Value 1 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name FlipFlopProfileDirectoryName -PropertyType Dword -Value 1 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name IncludeOneDrive -PropertyType Dword -Value 0 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name DeleteLocalProfileWhenVHDShouldApply -PropertyType Dword -Value 1 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name PreventLoginWithTempProfile -PropertyType Dword -Value 1 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name PreventLoginWithFailure -PropertyType Dword -Value 1 | Out-Null | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name VolumeType -PropertyType String -Value "vhdx" | Out-Null | |
$VhdLoc = @" | |
$($VHDXLocation) | |
"@ | |
New-ItemProperty HKLM:\Software\FSLogix\Profiles\ObjectSpecific\$($ADGroupGUID) -Name VHDLocations -PropertyType MultiString -Value $VhdLoc | Out-Null | |
Write-Output "Create-FSLogixConfig.ps1 ends" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment