VMware Cloud Community
midfield21
Contributor
Contributor
Jump to solution

Adding Connect-VIServer to the Vcheck.ps1 script

Hi,

Can anyone help me with this? Thanks!

Regards,

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You have 2 options:

  • you do a Connect-VIServer before running vCheck.ps1 (which is probably not what you would do with a scheduled task)
  • you hard-code your credentials on that line (and your security officer will get a hearth attack).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

You don't really need to add/edit a Connect-VIServer.

Have a look at Re: run vCheck for mutliple VC  how you can do this.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

midfield21
Contributor
Contributor
Jump to solution

Hi,

I have read through your thread but I cannot find plugins.xml. Though I have the 00 Connection Plugin for vCenter.

pastedImage_0.png

I plan to connect only to one specific esx host and run the vcheck script via scheduled task but I cannot run it if I run the connect-viserver separately.

Sorry, I'm new to all this and all. Thanks very much for the help.

Regards,

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You have to create that plugins.xml file yourself.

You pass it via the Job parameter of the vCheck.ps1 file.

The Connect-VIServer is cmdlet is located in the '00 Connection Plugin.ps1'.

In there, the Server line, you can enter the name of the targetted vCenter.

When running against multiple vCenters, create such a 00-plugin for each vCenter.

Then with the XML file, pass the correct 00-plugin.

The command you schedule is the one with the Job parameter.

But did I read that correctly, you want to run vCheck against an ESXi node, not against a vCenter?

Most of the plugins will fail when run against an ESXi node I'm afraid.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
midfield21
Contributor
Contributor
Jump to solution

Thanks! Is this the one I'm gonna change? Just confirming.

pastedImage_0.png

Can I add my credentials here as well? example I'll add this line -User username -Password password to the connect-viserver line?

I know this is not best practice but this are all just testings on my end to get myself familiarize.

And yes, I'm running it in just one host. I'm filtering my plugins as well. Thanks!! Smiley Happy

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

You have 2 options:

  • you do a Connect-VIServer before running vCheck.ps1 (which is probably not what you would do with a scheduled task)
  • you hard-code your credentials on that line (and your security officer will get a hearth attack).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
midfield21
Contributor
Contributor
Jump to solution

This was just a test and I'm not applying it anyways. Just playing with the UAT environment. Thanks again for all the help I got a quick grasp of how to change the variables now,

Reply
0 Kudos