Hello @GN, Yashas (Cognizant) ,
Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
If this is an Azure VM, and you need to reset the local administrator password, you can do that in below 2 ways
$RgName = "<RESOURCE GROUP NAME>"
$VmName = "<VM NAME>"
$Location = "<LOCATION>"
Connect-AzAccount
Select-AzSubscription -SubscriptionId $SubID
Set-AzVMAccessExtension -ResourceGroupName $RgName -Location $Location -VMName $VmName -Credential (get-credential) -typeHandlerVersion "2.0" -Name VMAccessAgent
Hope this helps
If this is any other VM or machine, do let me know in your comments by tagging me.
If the answer provided by has helped, please 'Accept as Answer' and Upvote using "Thumbs-up" so that it can improve discoverability for others in the community looking for help on the same topic.