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

Hi, I have this Script to check if a condition is met # The condition is met if $Context.ConditionIsMet is set to $True. $Context.ConditionIsMet = $False $inputString = " ... or issue with this match function using in a "if script returns true" condition?

asked Oct 31 by wintec01 (1.5k points)
0 votes
0 answers

We have followed your instructions to set up the password self service and we got it to work on windows 10 but the link does not show up on windows 11. is there something we can do to get the link to show up?

asked May 1 by rechevarria (40 points)
3,541 questions
3,232 answers
8,225 comments
547,802 users