Link to home
Start Free TrialLog in
Avatar of Santosh Gupta
Santosh Gupta

asked on

Powershell script for ESX

Hi Experts,

I need a Powershell script for ESX to run via ESXCLI for following tasks.

1. read file permission. (ex. /etc/X11/xinit/xinitrc.d/popup.sh) and save it to a file.
2. change the permission on file like chmod 775 /etc/X11/xinit/xinitrc.d/popup.sh
3. delete file

the task need to be run on list of esx servers.

Thanks in Advance.
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Santosh Gupta
Santosh Gupta

ASKER

Hi,

Thanks for prompt response.

it seems its ESXCLI command. can we use it as script to run for  list of servers.

we are using ESX 3.5 and 4.1.

It is prompting me for password every time, can we save it once.

i am getting below error after running the command.

esxcli can only be used with version 4.0 or newer servers
Okay, your servers are too old, to use the esxcli plugin I listed.

you could do this using plink (ssh).
Thanks