I’ve got a really weird issue (according to Google I’m the only one who has this issue with DSC and 2016) and I’m having a really hard time trying to figure out how to diagnose this.
I have a DSC configuration that runs perfectly on Server 2012 R2 (WMF 5.1) but when I run the exact same configuration on Server 2016 and use PsDscRunAsCredential in a resource, I get “Invoke-CimMethod : The filename or extension is too long”. So to summarize.
2012 R2, resources with PsDscRunAsCredential = works
2012 R2, resources without PsDscRunAsCredential = works
2016, resources with PsDscRunAsCredential = fails
2016, resources without PsDscRunAsCredential = works
VERBOSE: [LABSERVER01]: LCM: [ Start Resource ] [[Script]DisableFirewall] VERBOSE: [LABSERVER01]: LCM: [ Start Test ] [[Script]DisableFirewall] VERBOSE: [LABSERVER01]: LCM: [ End Test ] [[Script]DisableFirewall] in 0.0320 seconds. Invoke-CimMethod : The filename or extension is too long At C:\Lab\Invoke-LabTest.ps1:20 char:5 + Invoke-CimMethod -CimSession $ServerName -Name PerformRequiredCon ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (:) [Invoke-CimMethod], CimException + FullyQualifiedErrorId : Win32Error:206,Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand + PSComputerName : LABSERVER01
Even though I do not believe it’s a path length issue I’ve enabled long path support (https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/). This error still persists.
I’ve also tried to diagnose the issue using all the tips from https://msdn.microsoft.com/en-us/powershell/dsc/troubleshooting but I can’t find anything in event logs that would point to what part of DSC is having the issue.
I’m using certificates to encrypt the password as per (https://msdn.microsoft.com/en-us/powershell/dsc/securemof). I double checked my certificate settings against what they should be and everything is 100% correct. I thought maybe the Subject name was over 260 characters but it’s not.
The DSC configuration is using partial configurations.
This is driving me nuts! sorry if this sounds a bit confusing. Happy to clarify anything. Any pointers as to what the issue may be would be greatly appreciated.
Name Value ---- ----- PSVersion 5.1.14393.693 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.693 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1