
Owning a console does not necessarily make you a 'peasant'. You can be banned if you conduct yourself like that here. We are not a community where members feign stupidity when posting and commenting because they find it funny. We are a community where many of its members share similar opinions about the main topics, and sometimes end up having private jokes amongst ourselves. This is a normal subreddit with occasional tongue-in-cheek humor elements. This is not a satirical or 'circlejerk subreddit'. It's not about the hardware in your rig, but the software in your heart! You don't necessarily need a PC to be a member of the PCMR. This includes build help, tech support, and any kind of doubt one might have about PC ownership. Every kind of PC related content is welcome here. Everybody is welcome here, even those that have yet to ascend. Begin your ascension today! General Information $Logfile = "C:\Temp\CredentialLog-" + (Get-Date -Format yyyy-MMM-dd-HHmm) + ".Official Subreddit of the PC Master Race We're the largest community of PC enthusiasts on the Internet. I've written a second function what works for the 3 variable option but, having two functions to do basically the same thing seems redundant and i suspect PowerCLI should be able to do this in one ? If the variable has been passed, only check those hosts, if it has not been passed, check all Hosts. I haven't been able to figure out how to change the "Get-VMHost -PipelineVariable esx | ForEach-Object" line so that it checks for the $ESXiHost variable. you can give 3 parameters (username, Password + Hostname) and it will check only that host (or list of hosts). you can give two parameters (username + password) and it will check all Hosts in a VC - you have this working already.
Sorry to be revisiting a thread that's been marked as correct already but, this looks like a really handy bit of code and i was trying (without success) to modify it so that LogWrite "Authenticated host $vmhost using password 2"
LogWrite "Authenticated host $vmhost using password 1"Ĭonnect-VIServer $vmhost -User $username -Password $password2 $Conn = Connect-VIServer -Server $vmhost -User $username -Password $password1
$Logfile = "E:\Scripts\Authentication-Check\ScriptLog-Host-$Date.log" (I understand this is not the secure way to pass the password to variables, i will handle it later though) Also, looking for a better code to validate n (2,3,4 so on.) number of passwords possibly per host. Trying something like this but the code could validate only 2 passwords.
Need to validate at least 3 passwords on each of the host and log the status as we validate. We have esxi hosts with different root passwords spread across.