Hey Guys im new to StackOverflow and I'm here to ask a Question about my Powershell Script for the Automation of a Script on my mgmt Server to all XENAPP Servers im hosting. I want to execute with one click the Citrix Optimizer to every XENAPP. This is my Code... btw i am a complete beginner to PowerShell.
#Citrix Optimizer for every Server
$templates= "\\xxx\xxx\xxx\templates"
$Program= "\\xxx\xxx\xxx\CtxOptimizerEngine.ps1"
$computer= Get-ADComputer -LDAPFilter "(name=*xxxxxxxxxxxx*)" -SearchBase "OU=Test Server,OU=CVAD1912,OU=Server,DC=xxxxxxxxxxx,DC=xx"
$computername=$computer.name
foreach ($server in $computername){
Invoke-Command -ComputerName $server -ScriptBlock{
$using:Program} -Source AutoSelect from $templates -Mode Analyze
}
My error Code is:
Invoke-Command : Es wurde kein Parameter gefunden, der dem Parameternamen "Source" entspricht.
In C:\xxxxxx\xxxxxx\xxxxxx\xxxxxx\CitrixOptimizer.ps1:14 Zeichen:17
+ $using:Program} -Source AutoSelect from $templates -Mode Analyze
+ ~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeCommandCommand
I know... My Visual Code is in German but i hope you can help me.
FYI: in the code are some things just filled up with x, this is just not to leak something personal. I guess it should not affect your help.
Appreciate the Help!
Best cosmo_