Skip to content

Set-SessionHostConfiguration.ps1 errors #769

@jwaltireland

Description

@jwaltireland

pulled in upstream changes yesterday; refactored code to update parameter changes.

Set-SessionHostConfiguration-2025-04-02 21-02-40 log file:

Date Category Details
[04/02/2025 21:02:40] Info [Set-RegistryValue]: Setting Registry Value: NoAutoUpdate

[04/02/2025 21:02:40] Info [Set-RegistryValue]: Current Value of HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate : 0

[04/02/2025 21:02:40] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate : 1

[04/02/2025 21:02:41] Info [Set-RegistryValue]: Setting Registry Value: fEnableTimeZoneRedirection

[04/02/2025 21:02:41] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\fEnableTimeZoneRedirection : 1

[04/02/2025 21:02:41] Info [Set-RegistryValue]: Setting Registry Value: Enabled

[04/02/2025 21:02:41] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\Fslogix\Profiles\Enabled : 1

[04/02/2025 21:02:42] Info [Set-RegistryValue]: Setting Registry Value: DeleteLocalProfileWhenVHDShouldApply

[04/02/2025 21:02:42] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\DeleteLocalProfileWhenVHDShouldApply : 1

[04/02/2025 21:02:42] Info [Set-RegistryValue]: Setting Registry Value: FlipFlopProfileDirectoryName

[04/02/2025 21:02:42] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\FlipFlopProfileDirectoryName : 1

[04/02/2025 21:02:43] Info [Set-RegistryValue]: Setting Registry Value: VHDLocations

[04/02/2025 21:02:43] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\VHDLocations : {redacted}

[04/02/2025 21:02:43] Info [Set-RegistryValue]: Setting Registry Value: VolumeType

[04/02/2025 21:02:43] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\VolumeType : vhdx

[04/02/2025 21:02:44] Info [Set-RegistryValue]: Setting Registry Value: LockedRetryCount

[04/02/2025 21:02:44] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\LockedRetryCount : 3

[04/02/2025 21:02:45] Info [Set-RegistryValue]: Setting Registry Value: LockedRetryInterval

[04/02/2025 21:02:45] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\LockedRetryInterval : 15

[04/02/2025 21:02:45] Info [Set-RegistryValue]: Setting Registry Value: ReAttachIntervalSeconds

[04/02/2025 21:02:45] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\ReAttachIntervalSeconds : 15

[04/02/2025 21:02:46] Info [Set-RegistryValue]: Setting Registry Value: ReAttachRetryCount

[04/02/2025 21:02:46] Info [Set-RegistryValue]: Setting Value of HKLM:\SOFTWARE\FSLogix\Profiles\ReAttachRetryCount : 3

[04/02/2025 21:02:46] Info Resizing OS Disk

[04/02/2025 21:02:59] Error Size Not Supported

Extended information:
The size of the extent is less than the minimum of 1MB.

Activity ID: {872f9b74-8fc7-0002-8af1-426d12a4db01}

Why is the code resizing the disk???

Getting this error at the extension on the VM blade:
Command execution finished, but failed because it returned a non-zero exit code of: '1'. The command had an error output of: 'Write-Log : [04/02/2025 21:02:59] Error Size Not Supported Extended information: The size of the extent is less than the minimum of 1MB. Activity ID: {872f9b74-8fc7-0002-8af1-426d12a4db01} At C:\Packages\Plugins\Microsoft.Compute.CustomScriptE...' For more information, check the instance view by executing Get-AzVmssVm or Get-AzVm (https://aka.ms/GetAzVm). These commands can be executed using CloudShell (https://aka.ms/CloudShell)

In the logs on the vm, C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.20\Status:

[{"version":"1","timestampUTC":"2025-04-02T21:03:00.1122195Z","status":{"name":"SecureCommand_0","operation":"Command Execution Finished","status":"error","code":1,"formattedMessage":{"lang":"en-US","message":"Command execution finished, but failed because it returned a non-zero exit code of: '1'. The command had an error output of: 'Write-Log : [04/02/2025 21:02:59]\tError\t\tSize Not Supported\r\n \r\nExtended information:\r\nThe size of the extent is less than the minimum of 1MB.\r\n \r\nActivity ID: {872f9b74-8fc7-0002-8af1-426d12a4db01}\r\nAt \r\nC:\Packages\Plugins\Microsoft.Compute.CustomScriptE...' For more information, check the instance view by executing Get-AzVmssVm or Get-AzVm (https://aka.ms/GetAzVm). These commands can be executed using CloudShell (https://aka.ms/CloudShell)"},"substatus":[{"name":"StdOut","status":"success","code":0,"formattedMessage":{"lang":"en-US","message":"tion 'Clear-StorageDiagnosticInfo'.\r\nVERBOSE: Importing function 'Get-StorageDiagnosticInfoInternal'.\r\nVERBOSE: Importing function 'Get-StorageSubSystem'.\r\nVERBOSE: Importing function 'New-MaskingSet'.\r\nVERBOSE: Importing function 'New-StorageFileServer'.\r\nVERBOSE: Importing function 'New-StoragePool'.\r\nVERBOSE: Importing function 'New-StorageSubsystemVirtualDisk'.\r\nVERBOSE: Importing function 'Start-StorageDiagnosticLog'.\r\nVERBOSE: Importing function 'Stop-StorageDiagnosticLog'.\r\nVERBOSE: Importing alias 'Disable-StorageDiagnosticLog'.\r\nVERBOSE: Importing alias 'Enable-StorageDiagnosticLog'.\r\nVERBOSE: Exporting function 'Get-StorageHealth'.\r\nVERBOSE: Exporting function 'Get-StorageHealthSettingInternal'.\r\nVERBOSE: Exporting function 'Remove-StorageHealthSettingInternal'.\r\nVERBOSE: Exporting function 'Set-StorageHealthSettingInternal'.\r\nVERBOSE: Exporting function 'Clear-StorageDiagnosticInfo'.\r\nVERBOSE: Exporting function 'Get-StorageDiagnosticInfoInternal'.\r\nVERBOSE: Exporting function 'Get-StorageSubSystem'.\r\nVERBOSE: Exporting function 'New-MaskingSet'.\r\nVERBOSE: Exporting function 'New-StorageFileServer'.\r\nVERBOSE: Exporting function 'New-StoragePool'.\r\nVERBOSE: Exporting function 'New-StorageSubsystemVirtualDisk'.\r\nVERBOSE: Exporting function 'Start-StorageDiagnosticLog'.\r\nVERBOSE: Exporting function 'Stop-StorageDiagnosticLog'.\r\nVERBOSE: Exporting function 'CreateErrorRecord'.\r\nVERBOSE: Exporting function 'Get-StorageHistory'.\r\nVERBOSE: Exporting function 'Show-StorageHistory'.\r\nVERBOSE: Exporting function 'Enable-StorageDataCollection'.\r\nVERBOSE: Exporting function 'Disable-StorageDataCollection'.\r\nVERBOSE: Exporting function 'Save-StorageDataCollection'.\r\nVERBOSE: Exporting function 'Get-StorageDataCollection'.\r\nVERBOSE: Exporting function 'Get-PhysicalDisk'.\r\nVERBOSE: Exporting function 'Get-PhysicalExtent'.\r\nVERBOSE: Exporting function 'Convert-PhysicalDisk'.\r\nVERBOSE: Exporting function 'Get-PhysicalExtentAssociation'.\r\nVERBOSE: Exporting function 'Enable-PhysicalDiskIdentification'.\r\nVERBOSE: Exporting function 'Disable-PhysicalDiskIdentification'.\r\nVERBOSE: Exporting function 'Reset-PhysicalDisk'.\r\nVERBOSE: Exporting function 'Get-StorageFirmwareInformation'.\r\nVERBOSE: Exporting function 'Update-StorageFirmware'.\r\nVERBOSE: Exporting function 'Get-PhysicalDiskStorageNodeView'.\r\nVERBOSE: Exporting function 'Get-DiskStorageNodeView'.\r\nVERBOSE: Exporting function 'Get-StorageEnclosureStorageNodeView'.\r\nVERBOSE: Exporting function 'Get-StorageHealthAction'.\r\nVERBOSE: Exporting function 'Get-StorageFaultDomain'.\r\nVERBOSE: Exporting function 'Get-StorageScaleUnit'.\r\nVERBOSE: Exporting function 'Get-StorageChassis'.\r\nVERBOSE: Exporting function 'Get-StorageRack'.\r\nVERBOSE: Exporting function 'Get-StorageSite'.\r\nVERBOSE: Exporting function 'ValidateFaultDomainsExist'.\r\nVERBOSE: Exporting function 'Add-StorageFaultDomain'.\r\nVERBOSE: Exporting function 'Remove-StorageFaultDomain'.\r\nVERBOSE: Exporting function 'New-Volume'.\r\nVERBOSE: Exporting function 'Get-StorageExtendedStatus'.\r\nVERBOSE: Exporting function 'Get-StorageAdvancedProperty'.\r\nVERBOSE: Exporting function 'Get-StorageHealthReport'.\r\nVERBOSE: Exporting function 'Get-StorageHealthSetting'.\r\nVERBOSE: Exporting function 'Set-StorageHealthSetting'.\r\nVERBOSE: Exporting function 'Remove-StorageHealthSetting'.\r\nVERBOSE: Exporting function 'Debug-StorageSubSystem'.\r\nVERBOSE: Exporting function 'Debug-FileShare'.\r\nVERBOSE: Exporting function 'Debug-Volume'.\r\nVERBOSE: Exporting function 'Enable-StorageMaintenanceMode'.\r\nVERBOSE: Exporting function 'Disable-StorageMaintenanceMode'.\r\nVERBOSE: Exporting function 'Get-StorageDiagnosticInfo'.\r\nVERBOSE: Exporting function 'Remove-StorageHealthIntent'.\r\nVERBOSE: Exporting alias 'Disable-StorageDiagnosticLog'.\r\nVERBOSE: Exporting alias 'Enable-StorageDiagnosticLog'.\r\nVERBOSE: Exporting alias 'Enable-PhysicalDiskIndication'.\r\nVERBOSE: Exporting alias 'Disable-PhysicalDiskIndication'.\r\nVERBOSE: Exporting alias 'Get-PhysicalDiskSNV'.\r\nVERBOSE: Exporting alias 'Get-DiskSNV'.\r\nVERBOSE: Exporting alias 'Get-StorageEnclosureSNV'.\r\n"}},{"name":"StdErr","status":"success","code":0,"formattedMessage":{"lang":"en-US","message":"Write-Log : [04/02/2025 21:02:59]\tError\t\tSize Not Supported\r\n \r\nExtended information:\r\nThe size of the extent is less than the minimum of 1MB.\r\n \r\nActivity ID: {872f9b74-8fc7-0002-8af1-426d12a4db01}\r\nAt \r\nC:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.20\Downloads\0\Set-SessionHostConfiguration.ps1:500 \r\nchar:9\r\n+ Write-Log -Message $_ -Category 'Error'\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException\r\n + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-Log\r\n \r\n"}},{"name":"ErrorClarification","status":"error","code":2,"formattedMessage":null}]}}]

In the event viewer:

Faulting application name: CustomScriptHandler.exe, version: 2.8.6.412, time stamp: 0x67932d34
Faulting module name: KERNELBASE.dll, version: 10.0.26100.3470, time stamp: 0xcdfc8fa1
Exception code: 0xe0434352
Fault offset: 0x00000000000cab6a
Faulting process id: 0x1A04
Faulting application start time: 0x1DBA4981915D086
Faulting application path: C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.20\bin\CustomScriptHandler.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: e98871eb-1717-4525-bb6f-b4824496cfd3
Faulting package full name:
Faulting package-relative application ID:

Application: CustomScriptHandler.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
at System.IO.__Error.WinIOError(Int32, System.String)
at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
at System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean, Int32, Boolean)
at System.IO.StreamReader..ctor(System.String)
at System.IO.File.OpenText(System.String)
at Microsoft.WindowsAzure.GuestAgent.Plugins.CustomScriptHandler.JsonHelpers.DeserializeJsonStringFromFile[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.String, Microsoft.WindowsAzure.GuestAgent.Plugins.ExtensionEventLogger.Logger, Microsoft.WindowsAzure.GuestAgent.Plugins.ExtensionEventLogger.IExtensionEventLogger)
at Microsoft.WindowsAzure.GuestAgent.Plugins.CustomScriptHandler.Program.Main(System.String[])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions