Get-ChildItem : The specified network name is no longer available.

Good afternoon-

I have a script that tries to run Get-ChildItem with a specified path, but receives a “The specified network name is no longer available.” error. However, if I paste the exact path in a Run dialog, the destination opens without issue. Is there something different with how Windows handles this request versus my Powershell command?

Thank you!
Brian

How are you defining the path - is it a mapped drive or UNC?

Regular UNC. For troubleshooting purposes, I tried running just the Get-ChildItem command in a Powershell window to eliminate anything else in my script that might be causing an issue, but this returned the same error.
Get-ChildItem \[FQDN][SHARE]

Get-ChildItem relies on the .NET Framework under the hood; that’s definitely a bit different, in terms of APIs, than what Windows Explorer would use. But it still ought to work. FWIW, it worked great in my lab:

Dir \\DC\C$ 

Which could easily mean it’s a permission issue or something. For example, if I don’t explicitly run the shell “As Administrator,” the command fails due to permissions on the C$ share on my DC.

Works fine for me. Try dir \FQDN\Share at a normal command prompt, and see if you get the same problem (just to try to see if the problem is limited to PowerShell.)

@Don: I tried a similar test using the C$ share on one of my DCs and it worked without issue, even from a non-administrator shell (my account is a member of the Domain Admins group, just as a point of information).

@Dave: When I try \FQDN\Share from both a normal and elevated command prompt, I receive a “The network name cannot be found.” error.

Given this new information, I’m starting to believe that this isn’t a Powershell issue, but rather something else with my configuration.

Ah. Subtle point I missed. But FQDN works for me in addition to NetBIOS name. So it’s pointing more toward your environment or configuration, as you suggested.

Thank you all for your assistance. It turns out that this was a Group Policy issue. For anyone who might see this and have a similar setup, this is what I had to do in order to access my Synology NAS:

Computer Configuration –> Policies –> Windows Settings –> Security Settings –> Local Policies –> Security Options –> Microsoft Network Client: Digitally sign communications (always): Disabled

Computer Configuration –> Policies –> Windows Settings –> Security Settings –> Local Policies –> Security Options –> Network security: LAN Manager authentication level: Send NTLMv2 response only

Thank you!
Brian

Ah, I didn’t realize we were talking about a non-Windows device. We’ve had to make similar changes in the past to access shares on Linux servers with Samba.