0
votes

We have a WebDAV site that runs on IIS. From PowerShell we try to download a folder info

Get-ChildItem \\webserver@SSL\davwwwroot\webdav\Folder1\Folder2 -Name

It says

'\\webserver@SSL\davwwwroot\webdav\Folder1\Folder2' because it does not exist.
At GetWebDAVFolderContents.ps1:33 char:10
+ $items = Get-ChildItem $url -Name
+          ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (\\webserver@SSL\...der1\Folder2:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

The folder does exist. The very strange things: we start the File Explorer on that client PC, enter an URL like https://inside.mycompany.com/it/site which is a WebDAV site on our company's SharePoint site, then it asks for a login. After successful login to this site, the PowerShell script begins to work, drops no error anymore, and can download the Folder1\Folder2 info from our WebDAV site.

Why? How can I avoid to manually enter a login information to another site to get this script work? Is it because our WebDAV site is not correctly configured under the IIS?

1
Your webserver is named "SSL"?Mathias R. Jessen
No, it's name is "webserver".Zoltan Hernyak
Then change the target path to \\webserver\davwwwroot\webdav\Folder1\Folder2Mathias R. Jessen
It says "cannot find path because it does not exists". Using my url (@ssl in it) it is still working.Zoltan Hernyak

1 Answers

0
votes

It happens that a local service named "WebClient" is needed to be started. By default it is "manually" start with "trigger". It seems that the powershell way it won't trigger the service start, but the explorer thing will. As it remains started the powershell script suddenly works. The solution is to change the service start to automated, and 'till now it works.