USMT LoadState failing to create User profiles

Cody Riggs 6 Reputation points
2020-07-02T00:57:44.163+00:00

2020-07-02 10:26:51, Error [0x080000] There was an error while calling CreateProfile. Error: 0x80070005 2020-07-02 10:26:51, Error [0x000000] Error 2147942405 creating profile: Win32Exception: There was an error while calling CreateProfile.: Access is denied. [0x80070005] class UnBCL::String *__cdecl Mig::COnlineWinNTPlatform::CreateProfileForUserPrivate(class UnBCL::String *,class UnBCL::String *,class UnBCL::String *,class UnBCL::String *,int,class UnBCL::String **,class UnBCL::String **) 2020-07-02 10:26:51, Error [0x000000] Error creating profile for user Domain\User (source user Domain\User) 2020-07-02 10:26:51, Info [0x000000] Failed.[gle=0x00000091] 2020-07-02 10:26:51, Info [0x000000] A Windows Win32 API error occurred Windows error 2147942405 description: Access is denied.[gle=0x00000091] 2020-07-02 10:26:51, Error [0x0802f5] CMediaManager::Close: m_pSelectedTransport->Close(1) failed with Exception Win32Exception: Device was open with readonly access.: Access is denied. [0x00000005] void __cdecl Mig::CMediaManager::CloseTransport(int) void __cdecl Mig::CUNCTransport::Close(int).[gle=0x00000091] 2020-07-02 10:26:51, Error [0x000000] MigCloseCurrentStore caught exception: Win32Exception: Device was open with readonly access.: Access is denied. [0x00000005] void __cdecl Mig::CMediaManager::CloseTransport(int) void __cdecl Mig::CUNCTransport::Close(int)[gle=0x00000091] 2020-07-02 10:26:51, Info [0x000000] USMT Completed at 2020/07/02:10:26:51.224[gle=0x00000091] 2020-07-02 10:26:51, Info [0x000000] ----------------------------------- USMT ERROR SUMMARY ----------------------------------- 2020-07-02 10:26:51, Info [0x000000] * USMT error code 71: 2020-07-02 10:26:51, Info [0x000000] +----------------------------------------------------------------------------------------- 2020-07-02 10:26:51, Info [0x000000] | A Windows Win32 API error occurred 2020-07-02 10:26:51, Info [0x000000] | Windows error 2147942405 description: Access is denied.

this seems to be only occurring on devices that are 1803, have 0 issues restoring client data using the below script on 1909 devices

Here's the Restore Script we are using

Start function Restore

function Restore{

$OldPCName = $BackupPCDropDownBox.Text $BackupPath = LocationSelection

$USMTPath = USMT64Path -BackupPath $BackupPath $loadstateFile = $USMTPath + '\loadstate.exe'

$BackupPath = "$BackupPath\USMT_Store" $PCRestorePath = $BackupPath + '' + $OldPCName $InstalledPrinterFile = $PCRestorePath + '\InstalledPrinters.csv'

if((Test-path $PCRestorePath) -eq $false) { $outputBox.AppendText("No folder associated with $OldPCName found in $BackupPath" + "rn") Return }

Set-Location $BackupPath Set-Location $USMTPath

$USMTarglist = @( "$PCRestorePath" "/l:$PCRestorePath\load.log" '/i:MST-MigUser.xml' '/i:MST-MigApp.xml' '/uel:180' '/v:13' '/nocompress' ) #run loadstate to restore user data

$outputBox.AppendText("Restoring data from PC $OldPCName to PC $LocalPCName ..." + "`r`n")
$outputBox.AppendText("Restoring user data, please wait..." + "`r`n")
$Process = Start-Process $loadstateFile -ArgumentList $USMTarglist -Verb runas

#Restore Printers
RestorePrinters

#Running SCCM client action cycles
Invoke-CMClient

#check loadstate process, once it's complete, output a message
Start-Sleep 1
Do
{
    $loadstateProcess = Get-Process loadstate -ErrorAction SilentlyContinue
    if($loadstateProcess -eq $null)
    {
        $outputBox.AppendText("User data have been restored." + "`r`n")
    }
}While($loadstateProcess)


#Move files from C:\Cardio to C:\ProgramData\Cardio
RestoreCardio

#Update SPOK database
#updateSPOK -OldPCName $OldPCName

$outputBox.AppendText("********Restore Complete********" + "`r`n")

}

end function Restore

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,997 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Jordan Calo 6 Reputation points
    2021-02-27T01:53:40.36+00:00

    I wanted to follow up on this issue because I finally figured it out for my environment.

    The problem was occurring because OneDrive was being included in the build and capture for my reference image. That process is controlled by SCCM.

    USMT works great once I pulled the OneDrive install step from the build process. Hopefully Microsoft can provide a bug fix. Until then, I will include OneDrive as a post deployment application install.

    72550-2021-02-26-17-34-40-eis93pc-remote-desktop-connect.png

    72580-2021-02-26-17-35-41-eis93pc-remote-desktop-connect.png

    1 person found this answer helpful.