Forum Discussion
Powershell 7 getting error updating multi-valued attribute using Set-ADUser. PS 5.1 works
Hi LainRobertson, thank you for your reply.
After many tests I realized that is something wrong with my Windows Server 2016 Powershell AD module (1.0), since I've tested the same version on W11 and everything works fine.
So I've tried to put (manually) the same W11 AD Module version (1.0.1.0) in the WS2016 and somehow it got worse.
May be it's a bug that shows up only in certain conditions?
Hi mmussolini ,
It may or may not be something to do with Server 2016 - I can't say for sure as I no longer have access to Server 2016.
My gut feeling, however, is that it isn't an issue with the ActiveDirectory library, as the type mentioned in the error - System.Collections.ArrayList - is a type that is provided natively within .NET Core (which is what PowerShell uses, unlike Windows PowerShell, which uses .NET Framework).
If you open up a new PowerShell session and run the following command, what do you get as the output?
[System.Collections.ArrayList].Assembly;
On PowerShell 7.4.6 on Windows 10 22H2, I get the following output, which confirms that the type exists as well as the version and path to the underpinning library.
If you get an error (such as the one from your opening post), then your real root cause for the error is that something has gone wrong with your PowerShell installation.
Cheers,
Lain