@@ -135,6 +135,8 @@ $ConfiguringCloudManagementClusterSvc = "Creating Cloud Management cluster resou
135
135
$StartingCloudManagementMessage = " Starting Cloud Management agent."
136
136
$RemoteSupportConsentText = "`r`n`r`nBy approving this request, the Microsoft support organization or the Azure engineering team supporting this feature ('Microsoft Support Engineer') will be given direct access to your device for troubleshooting purposes and/or resolving the technical issue described in the Microsoft support case. `r`n`r`nDuring a remote support session, a Microsoft Support Engineer may need to collect logs. By enabling remote support, you have agreed to a diagnostic logs collection by Microsoft Support Engineer to address a support case You also acknowledge and consent to the upload and retention of those logs in an Azure storage account managed and controlled by Microsoft. These logs may be accessed by Microsoft in the context of a support case and to improve the health of Azure Stack HCI. `r`n`r`nThe data will be used only to troubleshoot failures that are subject to a support ticket, and will not be used for marketing, advertising, or any other commercial purposes without your consent. The data may be retained for up to ninety (90) days and will be handled following our standard privacy practices (https://privacy.microsoft.com/en-US/). Any data previously collected with your consent will not be affected by the revocation of your permission."
137
137
138
+ $UpgradeOSMessage = " Your system is running Azure Local, version 22H2, and will no longer receive security updates and support after May 31, 2025. To continue receiving security updates and support, you must upgrade your operating system. Visit https://aka.ms/azlocal-os-upgrade to learn more."
139
+
138
140
$AlreadyLoggedFlag = " Already Logged"
139
141
# endregion
140
142
@@ -492,6 +494,30 @@ Function Print-FunctionParameters{
492
494
return " Parameters for {0} are: {1}" -f $Message , ($body | Out-String )
493
495
}
494
496
497
+ function Confirm-UserAcknowledgmentToUpgradeOS {
498
+ [CmdletBinding (SupportsShouldProcess = $true , ConfirmImpact = ' High' )]
499
+ param (
500
+ [Parameter (Mandatory = $true )]
501
+ [System.Management.Automation.Runspaces.PSSession ]
502
+ $ClusterNodeSession
503
+ )
504
+
505
+ $osVersionDetectoid = { $displayVersion = (Get-ItemProperty - Path " HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ).DisplayVersion; $buildNumber = (Get-CimInstance - ClassName CIM_OperatingSystem).BuildNumber; New-Object - TypeName PSObject - Property @ {' DisplayVersion' = $displayVersion ; ' BuildNumber' = $buildNumber } }
506
+ $osVersionInfo = Invoke-Command - Session $clusterNodeSession - ScriptBlock $osVersionDetectoid
507
+ $isOSVersion22H2 = ([Int ]::Parse($osVersionInfo.BuildNumber ) -le $22H2BuildNumber )
508
+
509
+ $doNotAbort = $true
510
+
511
+ if ($isOSVersion22H2 )
512
+ {
513
+ $doNotAbort = $PSCmdlet.ShouldProcess (" " , " " , $UpgradeOSMessage )
514
+ }
515
+ if ( -not $doNotAbort )
516
+ {
517
+ throw " Aborting based on user input"
518
+ }
519
+ }
520
+
495
521
$CheckNodeArcRegistrationStateScriptBlock = {
496
522
if (Test-Path - Path " C:\Program Files\AzureConnectedMachineAgent\azcmagent.exe" )
497
523
{
@@ -2918,6 +2944,8 @@ param(
2918
2944
2919
2945
$regContext , $IsClusterRegistered , $clusterNodeSession , $_ = Get-SetupLoggingDetails - ComputerName $ComputerName - Credential $Credential - IsManagementNode $isManagementNode
2920
2946
2947
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
2948
+
2921
2949
$global :HCILogsDirectory = Setup- Logging - LogsDirectory $LogsDirectory - LogFilePrefix " RegisterHCI" - DebugEnabled ($DebugPreference -ne " SilentlyContinue" ) - IsClusterRegistered $IsClusterRegistered - ClusterNodeSession $clusterNodeSession
2922
2950
2923
2951
if ($IsClusterRegistered -and ! ([string ]::IsNullOrEmpty($LogsDirectory )))
@@ -4166,6 +4194,8 @@ param(
4166
4194
4167
4195
$regContext , $IsClusterRegistered , $clusterNodeSession , $_ = Get-SetupLoggingDetails - ComputerName $ComputerName - Credential $Credential - IsManagementNode $isManagementNode
4168
4196
4197
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
4198
+
4169
4199
$global :HCILogsDirectory = Setup- Logging - LogFilePrefix " UnregisterHCI" - DebugEnabled ($DebugPreference -ne " SilentlyContinue" ) - IsClusterRegistered $IsClusterRegistered - ClusterNodeSession $clusterNodeSession
4170
4200
4171
4201
Write-Progress - Id $MainProgressBarId - activity $UnregisterProgressActivityName - status $CheckingDependentModules - percentcomplete 1
@@ -4590,6 +4620,8 @@ param(
4590
4620
$clusterNodeSession = New-PSSession - ComputerName localhost
4591
4621
}
4592
4622
4623
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
4624
+
4593
4625
$logsDirectory = Get-LogsDirectoryHelper - ClusterNodeSession $clusterNodeSession | Out-String
4594
4626
4595
4627
if (! [string ]::IsNullOrEmpty($logsDirectory ))
@@ -4780,6 +4812,8 @@ param(
4780
4812
4781
4813
$regContext , $IsClusterRegistered , $clusterNodeSession , $nodeSessionParams = Get-SetupLoggingDetails - ComputerName $ComputerName - Credential $Credential - IsManagementNode $isManagementNode
4782
4814
4815
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
4816
+
4783
4817
Setup- Logging - LogFilePrefix " SetAzStackHCI" - DebugEnabled ($DebugPreference -ne " SilentlyContinue" ) - IsClusterRegistered $IsClusterRegistered - ClusterNodeSession $clusterNodeSession | Out-Null
4784
4818
4785
4819
if ($clusterNodeSession -ne $Null )
@@ -5443,6 +5477,10 @@ param(
5443
5477
$IsManagementNode = $True
5444
5478
}
5445
5479
5480
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails - Credential $Credential - ComputerName $ComputerName - IsManagementNode $IsManagementNode
5481
+
5482
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
5483
+
5446
5484
$LogFilePrefix = " EnableAzStackHCIAttestation"
5447
5485
$DebugEnabled = $DebugPreference -ne " SilentlyContinue"
5448
5486
$date = Get-Date
@@ -5730,6 +5768,10 @@ param(
5730
5768
$IsManagementNode = $True
5731
5769
}
5732
5770
5771
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails - Credential $Credential - ComputerName $ComputerName - IsManagementNode $IsManagementNode
5772
+
5773
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
5774
+
5733
5775
$LogFilePrefix = " DisableAzStackHCIAttestation"
5734
5776
$DebugEnabled = $DebugPreference -ne " SilentlyContinue"
5735
5777
@@ -5941,6 +5983,10 @@ param(
5941
5983
5942
5984
try
5943
5985
{
5986
+
5987
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
5988
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
5989
+
5944
5990
$LogFilePrefix = " AddAzStackHCIVMAttestation"
5945
5991
$DebugEnabled = $DebugPreference -ne " SilentlyContinue"
5946
5992
$date = Get-Date
@@ -6134,6 +6180,9 @@ param(
6134
6180
6135
6181
try
6136
6182
{
6183
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6184
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6185
+
6137
6186
$LogFilePrefix = " RemoveAzStackHCIVMAttestation"
6138
6187
$DebugEnabled = $DebugPreference -ne " SilentlyContinue"
6139
6188
@@ -6259,6 +6308,9 @@ param(
6259
6308
{
6260
6309
try
6261
6310
{
6311
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6312
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6313
+
6262
6314
$getImdsOutputList = [System.Collections.ArrayList ]::new()
6263
6315
6264
6316
$SessionParams = @ {
@@ -6504,6 +6556,8 @@ function Install-AzStackHCIRemoteSupport{
6504
6556
6505
6557
$_ , $IsClusterRegistered , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6506
6558
6559
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6560
+
6507
6561
$IsClusterRegistered = $regContext.RegistrationStatus -eq [RegistrationStatus ]::Registered
6508
6562
Setup- Logging - LogFilePrefix " AzStackHCIRemoteSupportInstall" - DebugEnabled ($DebugPreference -ne " SilentlyContinue" ) - ClusterNodeSession $clusterNodeSession - IsClusterRegistered $IsClusterRegistered | Out-Null
6509
6563
if ($Null -ne $clusterNodeSession )
@@ -6541,6 +6595,7 @@ function Remove-AzStackHCIRemoteSupport{
6541
6595
param ()
6542
6596
6543
6597
$_ , $IsClusterRegistered , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6598
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6544
6599
Setup- Logging - LogFilePrefix " AzStackHCIRemoteSupportRemove" - DebugEnabled ($DebugPreference -ne " SilentlyContinue" ) - ClusterNodeSession $clusterNodeSession - IsClusterRegistered $IsClusterRegistered | Out-Null
6545
6600
if ($Null -ne $clusterNodeSession )
6546
6601
{
@@ -6607,6 +6662,9 @@ function Enable-AzStackHCIRemoteSupport{
6607
6662
$AgreeToRemoteSupportConsent
6608
6663
)
6609
6664
6665
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6666
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6667
+
6610
6668
if ($AgreeToRemoteSupportConsent -ne $true )
6611
6669
{
6612
6670
if ($PSCmdlet.ShouldContinue (" `r`n Proceed with enabling remote support?" , $RemoteSupportConsentText ))
@@ -6650,6 +6708,10 @@ function Disable-AzStackHCIRemoteSupport{
6650
6708
[CmdletBinding (SupportsShouldProcess )]
6651
6709
[OutputType ([Boolean ])]
6652
6710
param ()
6711
+
6712
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6713
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6714
+
6653
6715
$agentInstallType = (Get-ItemProperty - Path " HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" - ErrorAction SilentlyContinue).InstallType
6654
6716
$observabilityStackPresent = Assert-IsObservabilityStackPresent
6655
6717
@@ -6695,6 +6757,9 @@ function Get-AzStackHCIRemoteSupportAccess{
6695
6757
$IncludeExpired
6696
6758
)
6697
6759
6760
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6761
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6762
+
6698
6763
$agentInstallType = (Get-ItemProperty - Path " HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" - ErrorAction SilentlyContinue).InstallType
6699
6764
$observabilityStackPresent = Assert-IsObservabilityStackPresent
6700
6765
@@ -6794,6 +6859,9 @@ function Get-AzStackHCIRemoteSupportSessionHistory{
6794
6859
$FromDate = (Get-Date ).AddDays(-7 )
6795
6860
)
6796
6861
6862
+ $_ , $_ , $clusterNodeSession , $_ = Get-SetupLoggingDetails
6863
+ Confirm-UserAcknowledgmentToUpgradeOS - ClusterNodeSession $clusterNodeSession
6864
+
6797
6865
$agentInstallType = (Get-ItemProperty - Path " HKLM:\SYSTEM\Software\Microsoft\AzureStack\Observability\RemoteSupport" - ErrorAction SilentlyContinue).InstallType
6798
6866
$observabilityStackPresent = Assert-IsObservabilityStackPresent
6799
6867
0 commit comments