Please help with multi-user webdav login credentials prompt


  1. Posts : 2
    Windows 10
       #1

    Please help with multi-user webdav login credentials prompt


    Hi all, I'm a linux guy and a windows beginner sorry.

    At work we have a need to setup a Win10 local user to service a specific client. On occasion we will have different staff login to this same desktop to service that client. The catch is that I want a mapped webdav drive to be connected at logon using that staff members credentials. I created a login powershell script to ask credentials at login then disconnect the drive at logout. It works fine for the admin user, but not a standard user.

    I've reduced the script delay to 0 seconds and can see in logs it does run but the user is never asks for credentials so I can't see why it is failing. If I execute the script manually when logged in as that user it works fine. So why isn't it working at login?

    Here is the script for reference:
    $credential = $host.ui.PromptForCredential("NextCloud credentials", "Please enter your user name and password for my-webdav.com.", "","")
    $username = $credential.UserName
    [String]$WebDAVShare = "\\my-webdav.com@SSL\remote.php\dav\files\$username\"

    New-PSDrive -Name "O" -Root $WebDAVShare -PSProvider FileSystem -Credential $credential -Scope Global
    net use O: $WebDAVShare


    * Secondly is there a way I can remove the option to "Remember my credentials" from mapped drives? This window can be shown if the unmount fails on next login etc.
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #2

    Hello @Bedlore,
    Welcome to TenForums.

    I am NOT a Linux guy, but there are quite a few on this Forum that should be able to help you.

    As for your second question, does this help ? . . .

    How to Automatically Sign in to User Account at Startup in Windows 10

    I hope this helps.
      My Computer


  3. Posts : 2
    Windows 10
    Thread Starter
       #3

    Thanks Paul,

    I may not of explained things well, my questions are all Windows ones. Essentially I'm trying to find a way to connect/map a webdav link by asking the username/password on login. Currently my script only works for admin users.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:25.
Find Us




Windows 10 Forums