0 votes

Hi all,

We had patches installed on our Adaxes 2018.2, 2008 R2 server the other night. As part of that, Windows Management Framework 5.1 (KB319566) was installed.

This patch seemed to break Adaxes powershell scripting in our environment. When attempting to run a custom command or scheduled task we got the following error:

The following error occurred while loading the extended type data file:
Microsoft.PowerShell.Core,
C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(260): Error in type "System.IO.DirectoryInfo": The member BaseName is already present.
Microsoft.PowerShell.Core,
C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(253): Error in type "System.IO.DirectoryInfo": The member BaseName is already present.
[Repeat a bunch more times for different lines in the file]

Copying the full error out of the output log we got:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(260) : Error in type "System.IO.DirectoryInfo": The member BaseName is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(253) : Error in type "System.IO.DirectoryInfo": The member Mode is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(269) : Error in type "System.IO.DirectoryInfo": Exception: Cannot convert the "Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods" value of type "System.String" to type "System.Type". Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(276) : Error in type "System.IO.DirectoryInfo": Exception: Cannot convert the "Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods" value of type "System.String" to type "System.Type". Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(280) : Error in type "System.IO.DirectoryInfo": The member PSStandardMembers is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(301) : Error in type "System.IO.FileInfo": The member VersionInfo is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(307) : Error in type "System.IO.FileInfo": The member BaseName is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(294) : Error in type "System.IO.FileInfo": The member Mode is already present. Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(316) : Error in type "System.IO.FileInfo": Exception: Cannot convert the "Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods" value of type "System.String" to type "System.Type". Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(323) : Error in type "System.IO.FileInfo": Exception: Cannot convert the "Microsoft.PowerShell.Commands.InternalSymbolicLinkLinkCodeMethods" value of type "System.String" to type "System.Type". Microsoft.PowerShell.Core, C:\Windows\System32\WindowsPowerShell\v1.0\typesv3.ps1xml(327) : Error in type "System.IO.FileInfo": The member PSStandardMembers is already present. Stack trace: at <ScriptBlock>, <No file>: line 1

To fix;

  • We first had to uninstall Windows Management Framework 5.1 and restarted.
  • Powershell seemed to be a little broken after the restart so we also removed Window Management Framework 4 and restarted.
  • Re-installed Window Management Framework 4 and restarted.
  • Got the error "Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified." so rebooted again.
  • Adaxes is now happy again.

Just though I would share in case anyone else encounters this issue or has anything else to add.

EDIT: We found a workaround to allow Adaxes to work with WMF 5.1 installed:

create powershell.exe.config with following: <?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0.30319"/> <supportedRuntime version="v2.0.50727"/> </startup> </configuration>

Copy the file into powershell root directory.[C:\Windows\System32\WindowsPowerShell\v1.0]

  1. Run following from command line

reg add hklm\software\microsoft.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1 reg add hklm\software\wow6432node\microsoft.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1

Ref: https://social.technet.microsoft.com/Forums/lync/en-US/0a7c1c22-6817-44db-b83c-3a0696611ddd/could-not-load-file-or-assembly-systemmanagementautomation-version3000?forum=virtualmachinemanager

by (130 points)
edited by

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Hello, we have a forest with two trees that hold one domain each. There is a default tree-root trust (transitive, two-way) between the top domains. Since both trees are in ... Sid S-1-5-10 were found". Any help would be appreciated, thank you! Regards HarryNew

asked Oct 8, 2020 by HarryNew (270 points)
0 votes
1 answer

Hi all, We currently have a bunch of dial plans that we assign to new users via Adaxes. We updated Adaxes to the latest version, and moved it to a new server before ... value - perhaps this value has been removed/broken in new versions of adaxes? Cheers all.

asked Jan 22 by TheLexicon (200 points)
0 votes
1 answer

Dear Support, is it possible to manage rule-based groups through console or this feature is only available via web? Thanks!

asked Jun 19, 2020 by Dmytro.Rudyi (920 points)
0 votes
1 answer

Hello, I have few business rules for AD account rename to validate input data and make sure username selected is unique in AD, but sometimes it fails with very non-explaining error " ... a "Before updating a User" rule BR14 - is a "Before renaming a User" rule

asked May 14, 2018 by DLe (760 points)
0 votes
1 answer

Is there a way to pass parameters to a script run through Adaxes? I tried placing it in the Script text box under Action Parameters as shown in the attached screenshot but it seems to completely ignore the parameter.

asked Jan 5, 2017 by rbeu (100 points)
3,347 questions
3,047 answers
7,784 comments
545,030 users