Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 179681

Powershell script logon to Multiple vCenter Servers not working in Windows Server 2012R2 scheduled task.

$
0
0

Hello,

 

First time on here so let me know if there is another forum I should be asking this question to.

 

I have a powershell script to collect datastore information from Multiple vCenter servers (2012r2 and 2008R2). I need this script to run as a scheduled task. The following is general information that may help in answering my question/fixing my problem.

 

The script gathers the datastore information and outputs it to HTML and emails the HTML to a group of system admins.

 

1. When I run the script from an elevated powershell command prompt it works perfectly.

 

2. When I run the script from the Task Scheduler (manually) it runs perfectly.

 

3. After I logout of the server and the task runs from the task scheduler it fails to login to the vCenters and collect the datastore information.

 

I am using a credential file (created using Get-Credential - Export-Clixml - and Import-Clixml) which works for 1 and 2 above.

 

How do I get the authentication working for # 3 above, or is there an entirely different method I should be using?

 

Thanks,

 

SK


Viewing all articles
Browse latest Browse all 179681

Trending Articles