The Network resource type is not correct when adding a PS Drive

James Pigott 5 Reputation points
2023-09-16T08:08:29.7766667+00:00

My router failed and I have now rebuilt a new one, but one of the side effects was that the Drives I had created were now corrupted. I removed them using "net use /del", but I am now getting this error when trying to paste in the script from Azure portal. I have not changed any other setting and there is not "" at the end of the folder. I have even double checked to see if the Drives have really been removed, and they have. Any ideas welcome.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,502 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Rich Matheisen 46,636 Reputation points
    2023-09-16T14:53:15.8833333+00:00

    Do you see the drive letter in the results from Get-PSDrive? Is there still a SMB mapping for the share in the results from Get-SMBMapping?

    Use Remove-PSDrive to get rid of the drive letter, and Remove-SMBMapping to remove the mapping.


  2. dashanan13 930 Reputation points
    2023-09-19T11:48:28.4066667+00:00

    Hei James Pigott,

    Thank you for the response to the questions.

    Since you are able to map the drive from another computer, it is safe in my assumption that the command is correct.

    Now this leaves us with 3 possibilities, either you have a network issue between your computer and the storage account or you have a profile issue or powershell issue.

    Starting with the network restrictions,

    On the computer that you want to use to connect the file share (important), goto Azure portal and find the target storage account.

    On the storage account, the left menu has a section for help (last section), click on the sub item: "connectivity check" (screenshot attached below)

    This will check the connectivity from your client computer to the various storage services.

    Making sure in the process the that the router is not the issue and nor is any other restriction on storage account.

    Moving to profile issue,

    On the computer that you want to use to connect the file share (important), login with a different user

    Then try to map the drive with the command from Azure portal.

    If the command works and you have a share, then it may indicate a profile mis configuration.

    Note: the share mapped on another user will NOT be available on your primary logon account.

    If this is the case, the simplest way out is to create a new profile and copy your profile folders like documents and downloads to that profile, start using that profile as your own.

    The not so simple way out is to repair the profile and do advanced profile troubleshooting.

    Finally,

    If the network drive does not map on a different profile (on the same computer), then it may be a Azure module or powershell issue.

    Suggest you to then uninstall and install AZ module and then install (or repair or reinstall) the latest version of powershell. This followed by reinstall of azure powershell module.

    Try the command again after this and hopefully it should work.

    Install powershell on windows Uninstall module Install AZ module

    Let me know how did it go.

    connectivity-check


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.