Ideally, I'd like to create a script that checks if a vCenter is already joined to a specific Active Directory domain (and if not, the script should join the vCenter to said domain).
The reason for this is I have a lab environment with several nested VCSAs which get reset to a snapshot on a weekly basis (allowing people to run whatever tests they want each week).
However, I've noticed that the VCSAs eventually stop authenticating with Active Directory (used for Windows session authentication) which requires me to manually rejoin each one. I assume this has to do with restoring them from a snapshot, but since manually rejoining them seems to work fine so ideally I'd just like a way to automate this process.
I found KB50112055 which shows how this can be done via SSH, I just wanted to validate whether or not there is a cmdlet / method of doing this in PowerShell / PowerCLI natively.
Thanks, I suspected as much but just wanted to be sure.
I've been using the Posh-SSH but sadly it still doesn't support PowerShell Core / PowerShell 7.
I guess I'll just stick with PowerShell 5.1 for now since most of my scripts tend to have SSH commands as part of them.
Funny you mention that, I was actually the most recent commenter on that GitHub issue, lol.
Definitely looking forward to Posh-SSH working with PowerShell 7, hopefully the SSH.net library is updated soon with the necessary changes.