question

CodyRiggs-9596 avatar image
1 Vote"
CodyRiggs-9596 asked ·

USMT LoadState failing to create User profiles

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" + "`r`n")
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-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JamesTran-MSFT avatar image
0 Votes"
JamesTran-MSFT answered ·

@CodyRiggs-9596
It looks like your issue pertains more to PowerShell, which is currently not supported in the Q&A forums. You can find the list of supported products here.


For assistance with PowerShell issues, please refer to our PowerShell Community.


Thank you for your time!


· 4 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JamesTran-MSFT
I think the problem is NOT related to PowerShell, because we are experiencing exactly the same problem without using PowerShell.
We call Loadstate manually and logged in as domain administrator. Opening cmd with "open as administrator" still results in the errors mentioned above.


Everything worked great until about half a year ago - I suspect a connection with the switch to Office 365, but not sure about that.


Our current workaround is that the user to be migrated logs on to the computer once before calling Loadstate - then the restore also works.


Any new ideas about this would make me very happy.


0 Votes 0 ·
JordanCalo-7541 avatar image JordanCalo-7541 OliverBleckmannlokalerAdmin-4298 ·

Did you ever find a solution for this issue? We are seeing the same problem with USMT and Windows 10 1909. Devices running 1809 do not have any issues. We are not using any PowerShell with our migration.

0 Votes 0 ·

Really strange

I just backed up a profile with User Profile Central (it's using USMT) from a Windows 10 1909 and restored the profile to another PC

The PC did previously have that user logging in but I removed the profile completely (from within "View Advanced System settings")
and restarted prior to the restore.

I just restore the SAME profile to a PC that did not previously hold it and it runs through as well.
(some irellevant errors - 5 - due to McAfee installation files not masked out in my XMLs..)

Do you by any chance have "Controlled Folder Access" enabled?
It will prevent any program, running from anywhere outside c:\Program files c:\Program files(x86), from accessing the user folders.

0 Votes 0 ·

Here is an additional workaround for a USMT Restore, if logging users into Windows prior to the transfer is not feasible.
1. Run USMT.
2. Receive Error.
3. Reboot Endpoint
4. Re-run USMT. This time the restore should process without error.

At the moment I am working to determine if a group policy might be causing this issue. I have placed a test workstation into an OU where all non-enforced policies have been blocked. This did not solve the issue. My next steps will be to see if a sysadmin can block some of the enforced policies from applying to my test workstation.



0 Votes 0 ·
JordanCalo-7541 avatar image
0 Votes"
JordanCalo-7541 answered ·

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 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Strange though

Just had one doing the same. However we do not install Onedrive but we do install Office 365.

Also just had one PC where the user cannot login to Offce 365 after restore.
I tested this in a variety of scenarios but cannot recreate the error.

0 Votes 0 ·
ThomasEhlerAU-4063 avatar image
0 Votes"
ThomasEhlerAU-4063 answered ·

Great find! And thank you for returning with feedback on this issue!

With kind regards
Thomas Ehler - EhlerTech
Home of the USMTGUI migration managers

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.