Symptoms
When you run a PowerShell script in adTempus, a command in the script fails with the following error message:
Cause
This occurs because a component used by the PowerShell applet was built against an older version of the .NET runtime than the version used by adTempus.
Resolution
To avoid this error you must modify the configuration for the adTempus job host process, which runs PowerShell scripts for adTempus. To do so:
1. Run Notepad or another text editor. Use the "Run as Administrator" command when starting the editor; otherwise you will not be able to save the configuration file.
2. Open the "adtempus.jobhost.exe.config" file found in the adTempus program folder.
3. Locate the section that reads as follows:
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
4. Replace those lines with the following:
<startup useLegacyV2RuntimeActivationPolicy="true" > <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> <supportedRuntime version="v2.0.50727" /> </startup>
The change will take effect the next time a new instance of the adtempus.jobhost.exe process starts. If you have scripts running frequently, you may need to pause job execution or restart the adTempus service so the host processes will be recycled.