Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate Azure Virtual machine username and password?

Need to validate the Azure Virtual machine username and password.

Now used the following code to validate the Virtual machine username and password.

$SecureVmPassword = ConvertTo-SecureString -string $VmPassword -AsPlainText -Force
$VmCredential = New-Object -typename System.Management.Automation.PSCredential -argumentlist $Fqdn"\"$VmUsername, $SecureVmPassword
Invoke-Command -ConnectionUri $RemoteConnectionUri.ToString() -Credential $VmCredential -ScriptBlock{
}  

But cannot able to validate the Virtual machine credentials while Virtual machines are in shutdown state.

Is there any way to validate Virtual machine credentials even when the Virtual machines are in shutdown state?

like image 635
s p Avatar asked Nov 07 '22 23:11

s p


1 Answers

There's none. You are trying to check credentials over an inactive remote object (a powered off VM). You will either need access to its local drive and SAM database (if it's a non-DC) or NTDS database (if DC), then parse that one in your active computing resources to check the supplied credentials. This is kind of ripping one's intestines out just to check if your food would digest in there. So, if the target VM is shut down, you need to skip credentials validation, or use domain credentials that are sure to be valid for that particular VM, but are able to be verified on some other resource (the domain's DC).

like image 158
Vesper Avatar answered Nov 14 '22 21:11

Vesper