Hallo
I need help with a powercli script to update the logon banner on all ESXi4.1 servers. We have about 60 ESXi hosts and would really appreciate a script to do this once
Thank you
Joseph
That reminds me of a script I wrote a while back, you should be able to adjust it...
http://www.virtu-al.net/2009/09/10/vtip-a-vmware-expert-updating-your-vi/
Alan
I saw this one earlier, but I dont want to updat the MOTD file but rather edit the /etc/inetd.conf file and add the banner path so that when a user ssh to the server he/she get awarning message before they procced with entering password, with ESX we just edited the /etc/ssh/sshd_config file but with ESXi we have to edit /etc/inetd.coonf file
Joseph
That might be a little harder then, I would take a look at the plink.exe examples on this forum as that is the only way I can think of doing it, unless anyone else has a suggestion.
There is William's method (who else would figure this out) as described in How to enable SSH security banner on ESXi
But I don't immediatly see a way to automate this through a script.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm a method now Luc? :smileyplain:
Yes Luc, this is the link am using to to manullay update the ESXi hosts, thoought someone has a script to push the message to all the hosts
Joseph
A method, a concept, a legend, you're all of that
Btw do you have a CLI script for that method ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you Luc,
I am looking for the script myself, please do your magic..
Joseph
haha thanks Luc, it's a great compliment coming from the Master of PowerCLI.
I don't have canned script that does this per se, but there are a few options and it really just depends on how someone's environment is setup (e.g. ssh kesy being available & configured)
Basically I would suggest writing a simple shell script (ash script really for ESXi) and scping that over to the ESXi host, then you could setup a secondary SSH session that would execute the script. You could leverage this "expect" script that allows you to run a command on a host via SSH - http://vghetto.svn.sourceforge.net/viewvc/vghetto/other/sshlogin.exp?view=log
I'm sure you had a similiar idea, but basically either some type of SCP/expect or ssh keys if you have that configured to help you distribute the shell script + executing the script itself.
I banged my head on this for a long time before giving it up. I didn't see any method of readily doing it via a script.
vGeek: Change ssh banner / motd message file on all esxi servers using powercli
noticed this was posted today to enable pre-password warning message.
of course scripting it will a bit more difficult but pushing the file out to all the hosts and recycling the service isn't terribly cumbersome.
http://www.vladan.fr/esxi-5-x-how-to-enable-ssh-pre-login-message-banner/