Add Azure user roaming and reproducible Laboratorio wallpaper policy
This commit is contained in:
@@ -18,6 +18,17 @@ param(
|
||||
[string]$VpnClientAddressPoolPrefix = '172.30.0.0/24',
|
||||
[string[]]$PublicEnrollmentSourceAddressPrefixes = @(),
|
||||
[string]$AdministratorSourceAddressPrefix = '',
|
||||
[bool]$DeployUserRoaming = $true,
|
||||
[ValidatePattern('^$|^[a-z0-9]{3,24}$')]
|
||||
[string]$UserRoamingStorageAccountName = '',
|
||||
[ValidatePattern('^[a-z0-9](?:[a-z0-9-]{1,61}[a-z0-9])$')]
|
||||
[string]$FsLogixProfilesShareName = 'profiles',
|
||||
[ValidatePattern('^[a-z0-9](?:[a-z0-9-]{1,61}[a-z0-9])$')]
|
||||
[string]$RedirectedFoldersShareName = 'redirected',
|
||||
[ValidateRange(100, 102400)]
|
||||
[int]$FsLogixProfilesQuotaGiB = 1024,
|
||||
[ValidateRange(100, 102400)]
|
||||
[int]$RedirectedFoldersQuotaGiB = 1024,
|
||||
[string]$TemplateFile = (Join-Path $PSScriptRoot '..\infra\azure\main.bicep')
|
||||
)
|
||||
|
||||
@@ -33,6 +44,17 @@ if (-not (Test-Path -LiteralPath $TemplateFile -PathType Leaf)) {
|
||||
if (-not $AdministratorPassword) {
|
||||
$AdministratorPassword = Read-Host 'Password for the local Azure VM administrator' -AsSecureString
|
||||
}
|
||||
if ($DeployUserRoaming -and -not $DeployVpnGateway) {
|
||||
throw 'Azure user roaming requires the P2S gateway deployed by this template so clients can reach the private Azure Files endpoint. Use -DeployUserRoaming $false with direct public enrollment.'
|
||||
}
|
||||
foreach ($shareName in @($FsLogixProfilesShareName, $RedirectedFoldersShareName)) {
|
||||
if ($shareName.Contains('--')) {
|
||||
throw "Azure Files share names cannot contain consecutive hyphens: $shareName"
|
||||
}
|
||||
}
|
||||
if ($FsLogixProfilesShareName -eq $RedirectedFoldersShareName) {
|
||||
throw 'FsLogixProfilesShareName and RedirectedFoldersShareName must be different.'
|
||||
}
|
||||
|
||||
$rootCertificateData = ''
|
||||
if ($DeployVpnGateway) {
|
||||
@@ -58,7 +80,10 @@ if ($LASTEXITCODE -ne 0) {
|
||||
throw "Could not select Azure subscription $SubscriptionId."
|
||||
}
|
||||
|
||||
$deploymentDescription = if ($DeployVpnGateway) {
|
||||
$deploymentDescription = if ($DeployVpnGateway -and $DeployUserRoaming) {
|
||||
'Create Azure VNet, Windows Server 2025 VM, public IP, P2S VPN Gateway, and private user-roaming storage'
|
||||
}
|
||||
elseif ($DeployVpnGateway) {
|
||||
'Create Azure VNet, Windows Server 2025 VM, public IP, and P2S VPN Gateway'
|
||||
}
|
||||
else {
|
||||
@@ -105,6 +130,12 @@ if ($PSCmdlet.ShouldProcess("$ResourceGroupName in $Location", $deploymentDescri
|
||||
p2sRootCertificateData = @{ value = $rootCertificateData }
|
||||
publicEnrollmentSourceAddressPrefixes = @{ value = @($PublicEnrollmentSourceAddressPrefixes) }
|
||||
administratorSourceAddressPrefix = @{ value = $AdministratorSourceAddressPrefix }
|
||||
deployUserRoaming = @{ value = $DeployUserRoaming }
|
||||
userRoamingStorageAccountName = @{ value = $UserRoamingStorageAccountName }
|
||||
fsLogixProfilesShareName = @{ value = $FsLogixProfilesShareName }
|
||||
redirectedFoldersShareName = @{ value = $RedirectedFoldersShareName }
|
||||
fsLogixProfilesQuotaGiB = @{ value = $FsLogixProfilesQuotaGiB }
|
||||
redirectedFoldersQuotaGiB = @{ value = $RedirectedFoldersQuotaGiB }
|
||||
}
|
||||
}
|
||||
[IO.File]::WriteAllText(
|
||||
@@ -152,5 +183,10 @@ if ($PSCmdlet.ShouldProcess("$ResourceGroupName in $Location", $deploymentDescri
|
||||
DeployVpnGateway = $DeployVpnGateway
|
||||
PublicEnrollmentSourceAddressPrefixes = @($PublicEnrollmentSourceAddressPrefixes)
|
||||
ServerBootstrapArguments = $values.serverBootstrapArguments
|
||||
UserRoamingEnabled = [bool]$values.userRoamingEnabled
|
||||
UserRoamingStorageAccountName = $values.userRoamingStorageAccountName
|
||||
FsLogixProfilesSharePath = $values.fsLogixProfilesSharePath
|
||||
RedirectedFoldersSharePath = $values.redirectedFoldersSharePath
|
||||
UserRoamingSetupArguments = @($values.userRoamingSetupArguments)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user