Hello, I'd like to run the following PS script under a domain\service account which is a local admin on the machine.
The problem, I am having with the below script, that it needs to be logged in ie. load the user profile of the user in order to register all the services etc.
I found one
that Luc has provided, but I can seem to figure out how to make it work.
$script06 = 'Configure_XD_SiteA.ps1'
$ISOpath = 'D:\Deploy\Applications\Citrix\XenDesktop'
$fullpath06 = join-path -path $ISOpath -childpath $script06
$CTXServiceUser = "CTXLAB\Service.vad"
$CTXServicePWord = ConvertTo-SecureString -String "VMware1!" -AsPlainText -Force
$CTXServiceCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $CTXServiceUser, $CTXServicePWord
Write-Verbose -Message "Configure XenDesktop Site." -Verbose
Invoke-VMScript -VM $vm -ScriptText $fullpath06 -GuestCredential $CTXServiceCredential -ScriptType Powershell
Many thanks!
MP