"Hostnamehere","%windowsuser","%windowspassword" -> when adding the sensor

i pass these in my script:

###
param(
    [string]$ComputerName,
    [string]$username,
    [string]$password
    )


$SecPasswd = ConvertTo-SecureString $password -AsPlainText -Force

$Credentials = New-Object System.Management.Automation.PSCredential ($username, $SecPasswd)


$ret = Invoke-Command -UseSSL -ComputerName $ComputerName -Credential $Credentials -ScriptBlock {

when i manually run it with

Scriptname -Computername "Hostname" -username user -password password

it works... Any ideas ?


Article Comments

Hi there,

Please remove the , in the parameter section when adding the sensor.

Does it work afterwards?


Kind regards,
Birk Guttmann, Tech Support Team


May, 2020 - Permalink

like so ?

%host%windowsuser%windowspassword ?


May, 2020 - Permalink

Hi,

Please try it this way:

"%host" "%windowsuser" "%windowspassword"

Kind regards,
Birk Guttmann, Tech Support Team


May, 2020 - Permalink