Saturday, October 2, 2021

Solved : The user profile failed to attach. The process cannot access the file becase it is being used by another process

Issue :  The user profile failed to attach. Please contact Support.

Status : 0x0000000B, Message: Cannot open virtual disk

Error Code: 0x00000020, Message: The process cannot access the file becase it is being used by another process


Solution : 

Connect to Azure:

# Connect-AzAccount

Select the subscription of the target storage account:

# Select-AzSubscription -subscriptionid "SubscriptionID"

Create context for the target storage account:

# $Context = New-AzStorageContext -StorageAccountName "StorageAccountName" -StorageAccountKey "StorageAccessKey"

Get Current open files
Get-AzStorageFileHandle -Context $Context -ShareName "WVDUserProfilesShareName" -Recursive | Sort-Object ClientIP,OpenTime

Close an open handle:

# Close-AzStorageFileHandle -Context $Context -ShareName "WVDUserProfilesShareName" -Path 'New folder/Profile_Username.vhd' -CloseAll



No comments:

Post a Comment

Solved : The user profile failed to attach. The process cannot access the file becase it is being used by another process

Issue :  The user profile failed to attach. Please contact Support. Status : 0x0000000B, Message: Cannot open virtual disk Error Code: 0x000...