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.

Avatar of undefined
Last Comment
Santosh Gupta

8/22/2022 - Mon
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Santosh Gupta


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
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

Okay, your servers are too old, to use the esxcli plugin I listed.

you could do this using plink (ssh).
Santosh Gupta

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy