Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Task sequence script failing to change drive letter

sjmckeeman

New Member
Messages
1
Reaction score
0
Points
1
Running a server build task sequence in SCCM and encountering the following error when a configuration script runs to assign a different drive letter to one of the drives.
The command being ran from the script:

$LocalDataDrive = "E"
$dataDrive = Get-Volume | Where-Object {$_.FileSystemLabel -eq "Data"}
if($dataDrive){
Write-Output " DEBUG: Change Data drive letter to: $LocalDataDrive"
$dataDriveLetter = $dataDrive.DriveLetter
Get-CimInstance -Class Win32_Volume -Filter "DriveLetter = '${dataDriveLetter}:'" | Set-CimInstance -Arguments @{DriveLetter="${LocalDataDrive}:"}
}

The error being logged:

PS>TerminatingError(Set-CimInstance): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Not supported "
>> TerminatingError(Set-CimInstance): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Not supported "
>> TerminatingError(Set-CimInstance): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Not supported "
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Not supported
Set-CimInstance : Not supported
At D:\_SMSTaskSequence\Packages\A01002CB\HPE-New-StoreHost.ps1:111 char:89
+ ... etter}:'" | Set-CimInstance -Arguments @{DriveLetter="${LocalDataDriv ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (Win32_Volume: D...4-adba-0529...):CimInstance) [Set-CimInstance], CimEx
ception
+ FullyQualifiedErrorId : HRESULT 0x8004100c,Microsoft.Management.Infrastructure.CimCmdlets.SetCimInstanceCommand
Sometimes the error does not even log, and the last line will be the write-output in the script above.
Either way, on the OSD screen the task will hang, reboot, and the sequence does not resume for the remaining steps.
This same task previously worked on the same servers (HPE ML110s in RAID config, Server 2019 and Server 2022). The same task still does work on our older Lenovo servers (single disk, Server 2012R2).
Verified running the script manually on the server does assign the correct drive letter, so it is not an issue with the commands.

I have also tried a couple different methods of changing the drive letter, but it still either hangs or errors.
 
Have you tested this script with the local system account?
 

Forum statistics

Threads
7,144
Messages
27,894
Members
18,190
Latest member
escdarck

Trending content

Back
Top