I’m trying to setup vCheck as a scheduled task but it keeps prompting for credentials when running as a batch file.
I’ve added the credential using the following command.
New-VICredentialStoreItem -Host myvc -User firstname.lastname@example.org -Password password – File c:scriptsvcpwd.xml
In the connection plugin for vcenter, I’ve added the following lines to pull the credentials but it’s not working. Am I missing further steps here or what is the cause?
$Credfile = “C:scriptsvcpwd.xml”
$Creds = Get-VICredentialStoreItem -Host $VIServer -File “C:scriptsvcpwd.xml”
The .bat file string is as follows: C:WINDOWSsystem32windowspowershellv1.0powershell.exe -File “C:scriptsvCheck-vSphere-mastervCheck.ps1