Hello,
After migrating OneIM from 9.2 version to 9.3, we had to change some process steps from PowerShellComponent - ExecuteScript to PowerShellComponentNet4 - ExecuteScript.
After this change was made, we are getting the following error in that process step:
(2025-05-23 08:05:34.443) [System.Management.Automation.CmdletInvocationException] The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception.
[System.TypeInitializationException] The type initializer for 'System.ServiceModel.Diagnostics.TraceUtility' threw an exception.
[System.Configuration.ConfigurationErrorsException] The 'system.serviceModel/diagnostics' configuration section cannot be created. The machine.config file is missing information. Verify that this configuration section is properly registered and that you have correctly spelled the section name. For Windows Communication Foundation sections, run ServiceModelReg.exe -i to fix this error.
at StdioProcessor.StdioProcessor._Execute(Job job)
at VI.Jobservice.JobComponents.PowershellComponentNet4.Activate(String task)
at VI.Jobservice.JobComponents.PoshBaseTask.Execute()
This is the code in the script parameter that is executed by the process step:
Dim sbScript As New StringBuilder()
sbScript.AppendLine("import-module ActiveDirectory")
sbScript.AppendLine(CStr(Values("startscript")))
sbScript.AppendLine("set-aduser -Identity """ & $SAMAccountName$ & """ -Replace @{msExchHideFromAddressLists=$True} -Credential $credential -server $server")
Value = sbScript.ToString()
And this is the actual powershell script:
$credential = New-Object System.Management.Automation.PsCredential -ArgumentList "MY USER ACCOUNT",(ConvertTo-SecureString "MY PASSWORD" -AsPlainText -force)
$server = "MY SERVER"
Script set-aduser -Identity "MYSAMACCOUNTNAME" -Replace @{msExchHideFromAddressLists=$True} -Credential $credential -server $server
Any Ideas what are we missing?
Thanks in advance