PowerCLI

 View Only
Expand all | Collapse all

Unable to run the vCheck health report

vmk2014

vmk2014Dec 30, 2019 07:20 PM

  • 1.  Unable to run the vCheck health report

    Posted Dec 26, 2019 12:34 PM

    Hi All,

    Im trying to run the vCheck health report but its throwing an error every time. Also, can we restrict to few report like vCenter,Data store, VM and Host etc...

    S D:\vmk\vcheck> .\vCheck.ps1

    Security warning

    Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your

    computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning

    message. Do you want to run D:\vmk\vcheck\Styles\Clarity\Style.ps1?

    [D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R

    WARNING:

    WARNING: Welcome to vCheck by Virtu-Al http://virtu-al.net

    WARNING: =================================================

    WARNING: This is the first time you have run this script or you have re-enabled the setup wizard.

    WARNING:

    WARNING: To re-run this wizard in the future please use vCheck.ps1 -Config

    WARNING: To get usage information, please use Get-Help vCheck.ps1

    WARNING:

    WARNING: Please complete the following questions or hit Enter to accept the current setting

    WARNING: After completing this wizard the vCheck report will be displayed on the screen.

    WARNING:

    WARNING:

    Begin Plugin Processing

    [17:57:32] ..start calculating Connection settings for vCenter by Alan Renouf v1.20 [1 of 116]

    Connect-VIServer : 12/26/2019 5:57:35 PM        Connect-VIServer                Could not resolve the requested VC serve

    r.

    Additional Information: There was no endpoint listening at https://vcsa.local.lab/sdk that could accept the message.

    This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

    At D:\vmk\vcheck\Plugins\00 Initialize\00 Connection Plugin for vCenter.ps1:151 char:20

    +    $VIConnection = Connect-VIServer -Server $VIServer -Port $Port

    +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException

        + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_NameResolutionFailure,VMware.VimAutomation.Vi

       Core.Cmdlets.Commands.ConnectVIServer

    D:\vmk\vcheck\Plugins\00 Initialize\00 Connection Plugin for vCenter.ps1 : Unable to connect to vCenter, please

    ensure you have altered the vCenter server address correctly. To specify a username and password edit the connection

    string in the file $GlobalVariables

    At D:\vmk\vcheck\vCheck.ps1:896 char:56

    + ... = [math]::round((Measure-Command { $Details = @(. $_.FullName)}).Tota ...

    +                                                     ~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,00 Connection Plugin for vCenter.ps1

    Thanks

    vmk



  • 2.  RE: Unable to run the vCheck health report

    Posted Dec 26, 2019 08:09 PM

    Looks like vCheck can't resolve the name of the VCSA?

    Is DNS resolution working from the station where you launch the script?



  • 3.  RE: Unable to run the vCheck health report

    Posted Dec 27, 2019 02:19 PM

    LucD,

    You are right, it seems but i cant find option to change the VCSA name in the script because there are multiple files. Do you have any idea which file need to edit and change VCSA name.

    thanks

    vmk



  • 4.  RE: Unable to run the vCheck health report

    Posted Dec 27, 2019 04:15 PM

    Have a look at Re: run vCheck for mutliple VC

    I explained where to define the vCenter (plugin00) and how to run against multiple vCenters (if needed).



  • 5.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 02:28 PM

    Hi LucD,

    I have changed the vcenter name in connection plugin but still throws an error. Can you share connection plugin format  for Vc ?



  • 6.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 03:29 PM

    What exactly did you change in plugin00 ?
    On line 11 you should update the value assigned to the variable $Server



  • 7.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 04:16 PM

    LucD,

    Thanks for your response, i appreciate it. Yes, line 11, i entered VC server name.

    Also, where the out will generate ? which folder.

    Where i need to edit for sending mailto ?

    Last can we shorten the report ?

    Kindly help me.



  • 8.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 04:54 PM

    The output is stored in $env:TEMP.
    But you can select another location with the -OutputPath parameter.

    The mail settings are defined in the file GlobalVariables.ps1.
    Which you can edit manually or interactively when you run vCheck.ps1 for the 1st time or with the -Config switch.

    The amount of output is controlled by the plugins you select.

    The Select-Plugins.ps1 script is one way of selecting the plugins.

    Another way to select the plugins which should run is through the XML file you pass on the -Job parameter.

    Not sure why the Connect-VIServer does not work for you.
    I assume you see the VCSA name you updated in the error message?



  • 9.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 06:31 PM

    LucD,

    Script its running with error

    $env:TEMP - you mean output will be in temp location ?

    GlobalVariables.ps1. - I was able to trace and done changes for mail settings.

    select another location with the -OutputPath parameter. -  Can you help me ? Where i need to do changes and which file.

    Suppose, i don't need powered-off VM's status,VMware tools, EVC mismatch and many others because it taking time to generate output. How to avoid or skip the report which i don't need actually. which i file need to edit  to skip example - powered-off VM's status,VMware tools, EVC mismatch.

    I have 42 VC and many are in remote sites which are not in Vrops, hence wanted to monitor. Kindly help me to execute successfully.

    Appreciate your help.

    Thanks

    vmk



  • 10.  RE: Unable to run the vCheck health report

    Posted Dec 28, 2019 06:55 PM

    Yes, the Temp folder for the account that is running the script.

    You add the -OutputPath parameter, with a valid location, when you call vCheck.ps1.

    .\vCheck.ps1 -OutputPath '.\MyFolder'

    For the plugins you have two options:

    1. Run .\Select-Plugins.ps1. It will ask for each plugin if you want to have it enabled or not.
    2. Use an XML file on the -Job parameter. In that XML file you can specify which plugins need to run (see my explanation in the thread I linked to earlier).

    Your issue with the vCenter is something I can't fix from here.
    You are apparently using a vCenter FQDN that can't be resolved by the Connect-VIServer.



  • 11.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 02:18 PM

    LucD,

    I will check your recommendations and get back but its seems vcheck report completed but i cant see any output file name ? What will be the name of report in temp folder ?

    Thanks

    vmk



  • 12.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 02:38 PM

    There should be a file with a name like "<VIServerName>_vCheck_<yyyyMMdd_HHmm>.htm" in the folder from $OutputPath.



  • 13.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 03:08 PM

    Ok never mind. I did executed the script again output folder and using 

    .\vCheck.ps1 -OutputPath 'D:\MyFolder'

    Hope this time it generate the report. But i'm unable to find the plugin.xml file and this is best option. can you please help on this ? However, i ran the plugin using 1st option and i was unable to enable/disable. Thank you again. Let see if this time it works.

    Even, i have enabled the mail to but not receiving any mail for report.

    Thanks

    vmk


    .\vCheck.ps1 -OutputPath 'D:\MyFolder'



  • 14.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 03:25 PM

    Not sure what you mean by the plugin.xml file?

    You can create a job.xml file, in which you can specify which plugins shall run.



  • 15.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 03:41 PM

    ok vc1.xml i did created with help of your template. How about the connection plugin ? I see some line is missing in screeshot, will it work ?  It's seems i'm able to closer to getting the report.

    Thanks

    vmk



  • 16.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 03:53 PM

    If you mean the line with the Get-vCheckSetting call, that was something that was added in a later version of vCheck.
    My screenshot was made in 2016.
    You have to use the current layout of plugin00 of course.



  • 17.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 05:32 PM

    LucD,

    You meant to say that i don't have use now ? I need to stick with Get-vCheckSetting  given

    Also, i forgot to ask earlier one question. Do i need to disable the plugin every time whenever i run the vcheck.ps1  using below Cli ?

    Run .\Select-Plugins.ps1. It will ask for each plugin if you want to have it enabled or not.

    Thanks

    vmk



  • 18.  RE: Unable to run the vCheck health report

    Posted Dec 29, 2019 06:04 PM

    You use the one that comes with the vCheck distribution as a template.
    But you make the changes (content and filename) as I showed in the other thread.
    Then in your .xml file, you point to the plgins you want to use.

    For plugin00 that would mean the new filename you have given it.

    And no, if you go for the .xml file, you explictely name the plugins you want to use.

    Then you do not need to use Select-Plugins.ps1.



  • 19.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 04:16 AM

    LucD,

    Sorry, i'm unable to understand. My accept my apologies for asking again. I think, i mixed up with 2 questions.

    Since, i'm planning to use task scheduler, hence please let me know 

    Then in your .xml file, you point to the plugins you want to use.-  How to define ?

    For plugin00 that would mean the new filename you have given it.- is it same you are referring above ?

    And no, if you go for the .xml file, you explicitly name the plugins you want to use. - How to explicitly define ?

    Last, i was able to generate report this time. thank you.

    thanks

    vmk



  • 20.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:46 AM

    LucD,

    You mean to say  use below format and  run the commmand - .\vCheck.ps1 -job job.xml -Outputpath D:\My Folder    ?  Please confirm

    <vCheck>
      <globalVariables>GlobalVariables.ps1</globalVariables>
      <plugins path="plugins-vSphere">
      <plugin>00 Connection Plugin for vCenter.ps1</plugin>
      <plugin>03 Datastore Information.ps1</plugin>
      <plugin>11 VMs with over CPU Count LOL WRONG PATH.ps1</plugin>
      <plugin>99 VeryLastPlugin Used to Disconnect.ps1</plugin>
      </plugins>
    </vCheck>

    2) But each time its prompting to give input Example - R or D input. how to avoid or skip this ? And its keep prompting me in the middle of job to press D/R/S.

    3) How i can run for multiple VC ?

    4) I'm looking for report in mail box. Do i need to set the variable in $global variable to $true ?

    thanks

    vmk



  • 21.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 07:41 AM
    1. Yes
    2. That is your ExecutionPolicy, which is a PowerShell setting. Use Set-ExecutionPolicy, with the correct Scope, to set it once and for all.
    3. That is exactly what I explained in the other thread. Use multiple .xml job files. Each one using a different plugin00, pointing to another vCenter
    4. Not entirely sure which variable you are referring to. But it is the $Sendmail, and related variables, in the GlobalVariables.ps1 file


  • 22.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 03:03 PM

    LucD,

    Thank you for your response. While set execution policy it prompting for execution policy....  What input i need to give here. Also, if run the vcheck from windows tasks scheduler (planning later stage once i get success to execute the report without any errors) still the i need to run the Set execution policy every time ?

    4) I have mentioned the smtp address but still not receiving mail with an attachment. Do i need change variable below ?

    [servername(:port)]

    $SMTPSRV = "smtp.ka.domain.com"

    # Would you like to use SSL to send email?

    $EmailSSL = $false

    #

    Please specify the email address who will send the vCheck report

    $EmailFrom = "Cornex@domain.com"

    # Please specify the email address(es) who will receive the vCheck report (separate multiple addresses with comma)

    $EmailTo = "xyz@domain.com"

    # Please specify the email address(es) who will be CCd to receive the vCheck report (separate multiple addresses with comma)

    $EmailCc = ""

    # Please specify an email subject

    $EmailSubject = "$Server vCheck Report"

    # Send the report by e-mail even if it is empty?

    $EmailReportEvenIfEmpty = $true

    # If you would prefer the HTML file as an attachment then enable the following:

    $SendAttachment = $false

    #

    Thanks

    vmk



  • 23.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 03:23 PM

    You have to provide the parameter.

    Note that, depending on the Scope, you will have to do this from a PS session started "as Administrator"

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Confirm:$false


    Not sure why your email doesn't arrive.

    Might be a permission to use the SMTP server that is missing.


    Can you test with Send-MailMessage?

    $sMail = @{

        SmtpServer = 'smtp.ka.domain.com'

        From = 'Cornex@domain.com'

        To = 'xyz@domain.com'

        Subject = 'Test email'

    }


    Send-MailMessage @sMail



  • 24.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:02 PM

    LucD,

    when i tried your test mail script, its failing to send mail but when i did some changes in global variable i.e. changed to true $SendEmail = $false?

    Report is showing 0KB size though its successfully executing. Any idea why ?

    Did this Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Confirm:$false  done any changes to my report ?

    It's wiered

    Thanks

    vmk



  • 25.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:17 PM

    That could mean that the script is not connecting or unable to retrieve data.

    You could try adding the -Verbose switch when calling vCheck.ps1.
    Perhaps that gives some clues what is going on.



  • 26.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:23 PM

    LucD,

    I missed out info to share with you. When i changed the global variable for $email to $true, i have received mail but 0 KB output. Not sure what went wrong now. Earlier atleast i was getting report generated in output folder.

    Thanks

    vmk



  • 27.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:30 PM

    That is hard to diagnose like that.
    Do you still receive the report on screen?
    Does that have any content?
    What does the plugin report show? Have the plugins run at all?

    You will need to have a look at the .xml file (if you are using that) and the GlobalVariables.ps1 file.
    Also, check if all plugins are enabled.



  • 28.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 05:38 PM

    LucD,

    Ok, i reverted back the global variable, since i kept backup copy. I have screen shot using verbose switch. It's all hard work will go in vain. I was getting report.

    Also, xml job attached for ref.

    Do you still receive the report on screen?  - Yes
    Does that have any content?  No content in html file. 0 KB size
    What does the plugin report show? Have the plugins run at all? - Yes run all

    Thanks

    vmk



  • 29.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 06:06 PM

    The Get-ReportHtml function is defined in each of the styles.
    What do you have as value for the $Style variable in the GlobalVariables.ps1 file?
    That should be one of the following: Clarity,CleanGreen or VMware



  • 30.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 06:38 PM

    Are the <CR><LF> actually misisng from that file?



  • 31.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 06:48 PM

    LucD,

    Sorry, which file you are referring  ? <CR><LF>  ? please brief

    is Global variable file ?  Please confirm

    or is it because set execution policy i ran ?

    Set-ExecutionPolicy - PowerShell - SS64.com

    Thanks

    vmk



  • 32.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 06:52 PM

    Yes. that file looked like one long string in your previous screenshot.
    Attach the file.



  • 33.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 07:06 PM

    Ok, that sets indeed the $Style variable.
    Are you missinnng the Styles folder or any of the folders/files in there?

    Perhaps try using one of the other available styles, like VMware or CleanGreen.



  • 34.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 07:20 PM

    Yes, all the three folder are there.



  • 35.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 07:28 PM

    Did you try any of the other available styles as I suggested?

    I assume all vCheck related files are unblocked?
    See How to Unblock a File Downloaded from an Email or the Internet – Support Center

    I also noticed that $email is again set to $False.
    Was that on purpose?



  • 36.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 07:39 PM

    Did you try any of the other available styles as I suggested? - Ok i changed the style to VMware and running again

    I assume all vCheck related files are unblocked?  - yes it will not allow to execute.
    See How to Unblock a File Downloaded from an Email or the Internet – Support Center

    I also noticed that $email is again set to $False. - No purposefully. Do want me to change to true ? Please confirm. which line need to change,
    Was that on purpose?  No

    Screen display  shows after changing the style also-

    00:43:47] ..finished calculating VM Tools Not Up to Date by Alan Renouf, Shawn Masterson v1.1 [26 of 26]

    et-ReportHTML : The term 'Get-ReportHTML' is not recognized as the name of a cmdlet, function, script file, or

    perable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try

    gain.

    t D:\vmk\vcheck\vCheck.ps1:989 char:14

         $MyReport = Get-ReportHTML

                     ~~~~~~~~~~~~~~

       + CategoryInfo          : ObjectNotFound: (Get-ReportHTML:String) [], CommandNotFoundException

       + FullyQualifiedErrorId : CommandNotFoundException

    thanks

    vmk



  • 37.  RE: Unable to run the vCheck health report

    Posted Dec 30, 2019 08:07 PM

    There must be something wrong with the loading of the style file (Style.ps1).

    Since other files, like plugins, seem to load fine, I don't have an immediate explanation why that happens.

    Setting $Email to $true won't help a lot, since the HTML file empty.
    And that is because the Get-ReportHtml function is not found.

    You could try using a transcript, to check if that shows any further clues.

    Add the following just before line 71 in vCheck.ps1

    Start-Transcript -Path .\transcript.txt



  • 38.  RE: Unable to run the vCheck health report

    Posted Dec 31, 2019 05:41 AM

    LucD,

    It appears it working. I unblocked all the files under styles folder after seeing the styles file showing unable to load and not trusted. I have called the job.xml file

    and tried but its prompting me window for credential and earlier it never prompted for credential window but its generating the report. Please help me to fix or skip the credential window because i'll be running scheuler tasks later. Also, i'll try with maximum plugin now and will let you know.

    thanks

    vmk



  • 39.  RE: Unable to run the vCheck health report

    Posted Dec 31, 2019 05:59 AM

    If you are running this from a Windows station, you might use the New-VICredentialStoreItem.

    Create an entry for each vCenter you want to run vCheck against.
    Then the Connect-VIServer cmdlet will pick up the credentials from there.

    Make sure that the VICredentialStoreItem entries are created with the same account that will run vCheck and on the same station.

    The cmdlet uses DPAPI, and the encryption is unique to the user and station.



  • 40.  RE: Unable to run the vCheck health report

    Posted Dec 31, 2019 11:11 AM

    LucD,

    Finally back on track everything, now i wanted to know if change the password after 90 days do i need to run the store command again ? (New-VICredentialStoreItem.) Please confirm

    And password will be safe right ?

    Also, two more steps left

    1) Now again i want to try to send the report from mail. Let me know where i need to changes. I will take the backup of this script this time.

    2) Want to schedule the report from windows task. Do i need to schedule xml job from scheduler or  vCheck.ps1 ? I'll run against multiple vc.

    thanks

    vmk



  • 41.  RE: Unable to run the vCheck health report

    Posted Dec 31, 2019 01:10 PM

    If the password for an account is changed, you will need to do a Remove-VICRedentialStoreItem and then a New-VICredentilaStoreItem.

    In the GlobalVariables.ps1 file you will need to set $SendEmail to $true.

    And provide valid values to all variables starting with $Email in that same file.

    Exception, $EmailCc can be set to "" if not needed.

    For the Windows Task Scheduler you need to schedule the same command you entered manually, including all the parameters like -Job.
    For an example, see Ken Umemoto's vReality: How To Schedule the vCheck Report



  • 42.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 10:30 AM

    LucD,

    Email issue is fixed. I'm receiving the mail for report. Now schedule tasks i ran with the following link shared by you but its keep failing with

    ask Scheduler failed to start  task for user. Additional Data: Error Value: 2147942667.

    Hence, i decided to execute through batch file and its gives following error.

     

    still same error. ( see above screens shot)

    Do i need run store item credential each time whenever i login to power cli.  because its prompting me credential next day when executed the script again.

    thanks

    vmk



  • 43.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 01:03 PM

    Where is that Add-PSSnapin cmdlet coming from?

    That is not needed, provided you are running at least PowerCLI version 5.8R1.
    Which PowerCLI version are you using?

    No, those VICredentialStoreItems are stored in an external file, and you shouldn't need to re-enter the credentials.



  • 44.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 01:13 PM

    LucD,

    Thank you for help. Only Task scheduler left now which will make my job easy

    Where is that Add-PSSnapin cmdlet coming from?  Tasks scheduler cant see any error, hence I tried to test via batch file.(bat file)

    Through task scheduler i get the error

    That is not needed, provided you are running at least PowerCLI version 5.8R1.


    Which PowerCLI version are you using? 11.3

    Also, add-pssnapin VMware.VimAutomation.Core where i need add ? do i need add to all plugin ? or only vCheck.s1 only ? I have added to multi-vc.ps1 which is calling vc.1xml file.

    thanks

    vmk



  • 45.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 01:35 PM

    With your version of PowerCLI 11.3, you do not need a Add-PSSnapin line.


    I can't tell from that error code what goes wrong with the Task Scheduler.
    I would need to see the Task Scheduler job definition.



  • 46.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 01:50 PM

    LucD,

    Ok i have attached screen for task scheduler definition. Also, i'm running against vCenter 5.5, hope that doesn't make any issue.

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe

    After your suggestion, i have removed add-pssnapin from multi-vc.ps1

    Start in - D:\vmk\vCheck\multi-vc.ps1



  • 47.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 02:02 PM

    What is in the General tab? User account?
    There don't seem to be any arguments.



  • 48.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 02:08 PM

    Sorry, forgot to share. Also, i have enabled log on as a batch job from local security. User is part of admin group.

    Any other way to automate the report ? in case if task scheduler is not working. I'm not giving up.



  • 49.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 02:38 PM
    • Did you create the VICredentialStoreItem with that same user you specified in the Scheduled Task? Remember, these entries only work for the same user on the same station where they were created
    • You didn't seem to specifiy an argument for the powershell.exe. That is where you normally would provide the script and it's parameters (as the post I pointed to earlier explains).
    • That return code from Task Scheduler (0x8007010B) might be caused by the value in the Start in field. See https://stackoverflow.com/questions/13618945/why-windows-7-task-scheduler-task-fails-with-error-2147942667


  • 50.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 03:05 PM

    LucD,

    • Did you create the VICredentialStoreItem with that same user you specified in the Scheduled Task? Remember, these entries only work for the same user on the same station where they were created  -Yes, i'm using the same id.
    • You didn't seem to specifiy an argument for the powershell.exe. That is where you normally would provide the script and it's parameters (as the post I pointed to earlier explains).

            I have added now - C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe “& ‘D:\vmk\vCheck\multi-vc.ps1′”  See below

    • That return code from Task Scheduler (0x8007010B) might be caused by the value in the Start in field. See - Yes, i have removed the double quotes from Start(optional)

    thanks

    vmk



  • 51.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 03:09 PM

    And what is the result?



  • 52.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 03:18 PM

    t's same result.

    In fact i have never faced this issue. I tried all option and searched in internet, but no clue. Can we see by running the command in power cli console  to see error code ?

    thanks

    vmk



  • 53.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 03:42 PM

    Is it the same exit code?

    Can you eventually export the task and attach the file?

    Make sure the taskname is the correct one.

    Get-ScheduledTask -TaskName vCheck_Job | Export-ScheduledTask |

    Out-File -FilePath .\task.xml



  • 54.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 04:37 PM

    LucD,

    PFA task xml file.

    thanks

    vmk



  • 55.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 05:07 PM

    Can you try with the argument just as

    “D:\vmk\vCheck\multi-vc.ps1”



  • 56.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 05:30 PM

    No luck. It's same error.

    Task Scheduler failed to start "\vCheck_Job" task for user "xyz\vmkxyz". Additional Data: Error Value: 2147942667.

    thanks

    vmk



  • 57.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 06:04 PM

    Also replace the value in Start in with

    D:\vmk\vCheck\

    No quotes, no file, just the folder



  • 58.  RE: Unable to run the vCheck health report

    Posted Jan 01, 2020 06:57 PM

    LucD,

    At last something moving, but still some more challenges its seems. There was no error this time and the task completed successfully without any errors, but no report generated  :smileysad:.  I did check in folder reports but no report file. Any idea ?

    thanks

    vmk



  • 59.  RE: Unable to run the vCheck health report
    Best Answer

    Posted Jan 01, 2020 07:59 PM

    No, not really.
    This thread seems to be going on forever



  • 60.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 03:59 AM

    LucD,

    I agree with you. My apologies. Also, without you, it was not possible to make this script success. Meanwhile i will try to troubleshoot further offline. Thank you once again.

    Thank you.

    vmk



  • 61.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 05:52 AM

    One tip, perhaps try using a transcript to get some further info.
    Use a Start-Transcript at the beginning of the script.



  • 62.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 01:49 PM

    Sure, Do i need add this line to vCheck.ps1 or multi-vc.ps1 (call vc.xml) ?



  • 63.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 01:58 PM

    As early as possible, try in multi-vc.ps1



  • 64.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 02:18 PM

    ok i did and i didnt see any output. Does it mean its not running ? But tasks scheduler not giving any error.

    Start-Transcript -Path D:\vmk\reports\Transcript.txt -Append



  • 65.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 02:36 PM

    There can be many reasons why the scheduled task is not running correctly.
    Does it still return an error code?
    There are a number of fiagnostic steps described in https://stackoverflow.com/questions/865653/how-to-troubleshoot-windows-scheduled-task-not-running



  • 66.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 02:44 PM

    you might be right, one thing  i noticed when i ran the script from power cli console, it keep prompting for password after couple of seconds though i have stored password using New-VICredentialStoreItem. Note - I'm running job.xml which have report for 2 vc and it prompting always for 2nd vc. Does it mean job parameter we can call only one job at a time ?

    I'll still your link for schedule tasks troubleshooting. right no error code showing. I'm really feeling bad that the thread is going forever.

    Task Scheduler successfully completed task "\vCheck_Job" , instance "{957ea9b2-e76c-4da5-9ed3-3e2444d08c7a}" , action "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" with return code 0.

    thanks

    vmk.



  • 67.  RE: Unable to run the vCheck health report

    Posted Jan 02, 2020 03:04 PM

    Yes, since you can only point to 1 plugin00 in the .xml file, you need a job .xml per vCenter.
    You can have multiple VICredentialStoreItems, one per vCenter  (via the Host parameter).



  • 68.  RE: Unable to run the vCheck health report

    Posted Jan 04, 2020 12:19 PM

    LucD,

    Finally, i was able to fix the vCheck report through Task scheduler. Your earlier thread helped me not sure its exact reason

    vim.psc1 missing from 6.5 install?

    so Add Arguments just shows: -File "Location of your scirpt \vCheck.ps1"

    After the -File and removing the job.xml it working and sending report. It's seems xml parameter doesn't work with Task scheduler.

    thanks

    v



  • 69.  RE: Unable to run the vCheck health report

    Posted Jan 04, 2020 02:07 PM

    There is also an open issue on the vCheck repo mentioning issues with Task Scheduler.
    I'll add that to the list of new features for new version we are preparing.