Sometimes when we execute the following PowerShell command,
Move-SPUser -Identity DOMAIN\old_username -NewAlias DOMAIN\new_username
we get the following error.
Move-SPUser : The parameterless Read method can only be used when this instance was initialized with an SPUser object.
This is because the old username (profile) has been deleted from the user profile database and the profile service application is not able to find a profile with old_username. In order to avoid this error, create an SPUser object specifying a site collection URL as -Web parameter where the duplicate profile is present and then use that SPUser object as -Identity in the PowerShell command. An example is given below:
$user = Get-SPUser -Identity DOMAIN\old_username -Web https://site_collection_url Move-SPUser -Identity $user -NewAlias DOMAIN\new_username