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

This topic contains 8 replies, has 4 voices, and was last updated by Profile photo of Dave Wyatt Dave Wyatt 3 years, 8 months ago.

  • Author
    Posts
  • #9859
    Profile photo of Brian Rupnick
    Brian Rupnick
    Participant

    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

  • #9860
    Profile photo of Richard Siddaway
    Richard Siddaway
    Moderator

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

  • #9861
    Profile photo of Brian Rupnick
    Brian Rupnick
    Participant

    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]

  • #9862
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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.

  • #9863
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    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.)

  • #9864
    Profile photo of Brian Rupnick
    Brian Rupnick
    Participant

    @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.

  • #9865
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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.

  • #9869
    Profile photo of Brian Rupnick
    Brian Rupnick
    Participant

    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

  • #9870
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    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.

You must be logged in to reply to this topic.