I'm working on a script to get my ACLs for all of the shares in my network. I have three separate UNC paths that I am running this on. Two of the three are working perfectly, returning all child items and permissions and such. However, the third UNC path is returning the following error:
Get-ChildItem : Cannot find path '\\storagesrvr' because it does not exist.
I have verified that the location is available by using Explorer. What I find interesting is that if I use GCI on any of the sub-shares of that path, it works. What could possibly be preventing GCI from detecting the root of the share?
EDIT (as requested from comments): The other two shares that I had no issues with were named like \\networkpath\share. But because I was only looking at the root, GCI was not working.
\\computeris not even a fully valid UNC path according to the spec. Retrieve share names from theWin32_Sharewmi class on the remote machine and runtGet-ChildItemagainst them one by one