Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 193504

Scheduled Task - Connect-VIServer

$
0
0

Hi all. I wrote a script to do some work but I am having trouble with authentication. Each time it runs it is running under my accout rather than the one specidied in the script.

 

I have followed this guide so therefore before the below have exported a copy of the scripts user account password (The PSCredentials file)

 

$PowerCLIUserAccount = "DOMAIN\User
$PowerCLIUserPassword = Get-Content PSCredentials | ConvertTo-SecureString
$PowerCLICredentials = New-Object System.Management.Automation.PsCredential $PowerCLIUserAccount, $PowerCLIUserPassword
Connect-VIServer -Server VCSERVER

 

At this point though it is connecting but using my account details rather than the one in the script?


Viewing all articles
Browse latest Browse all 193504

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>