Hi Team,
I am getting my task via the following code and its working
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$taskName = "Azure VDI Start"
# Connect to the Adaxes service.
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Bind to the task.
$container = $service.Backend.GetConfigurationContainerPath("ScheduledTasks")
$tasksPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" $container
$taskPath = $tasksPathObj.CreateChildPath("CN=$taskName,CN=1 DEV,CN=zTest Area")
$task = $service.OpenObject($taskPath.ToString(), $null, $null, 0)
Now I want to change the attribute of OwnerServiceDnsHostName
with this command
$task.Put("OwnerServiceDnsHostName","<servername>.<domains>.<tld>")
$task.SetInfo()
But getting this
Exception calling "SetInfo" with "0" argument(s): "The parameter is incorrect. "
At line:2 char:1
+ $task.SetInfo()
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DirectoryComException
Is this the wrong approach to update this setting via PowerShell?