Popular blog tags

How to install webdav server iis on windows 10

Published

Server

使用IIS搭建WebDAV

Install webdav server via IIS on Windows 10(GUI)

Install webdav server iis on windows 10

https://juejin.cn/post/7403165140718125075

step 1.打开自己电脑上的 控制面板/程序 页面,然后点击“启用和关闭Windows功能

step 2.在我的电脑管理开始菜单里找到安装的Internet Information Services (IIS) 管理器

选择要共享的目录(如 C:\WebDAV\HomeAssistant)

允许 IIS WebDAV 端口通过防火墙

# 允许 WebDAV 端口通过防火墙
New-NetFirewallRule -DisplayName "WebDAV Home Assistant" -Direction Inbound -Protocol TCP -LocalPort 7070 -Action Allow

 

认证

IIS WebDAV使用基本认证(Basic Authentication)

创建 Windows 用户账户

# 以管理员身份运行 PowerShell
# 创建新用户
New-LocalUser -Name "ha_webdav" -Description "Home Assistant WebDAV User" -Password (ConvertTo-SecureString "YourSecurePassword123!" -AsPlainText -Force)

# 设置密码永不过期
Set-LocalUser -Name "ha_webdav" -PasswordNeverExpires $true

 

设置文件夹权限

右键点击共享文件夹 → 属性-安全,add ha_webdav

 

Install webdav server via IIS on Windows 10(PowerShell)

# Enable-WebDAV.ps1 - IIS WebDAV配置
param(
    [string]$SiteName = "PhoneWebDAV",
    [string]$PhysicalPath = "C:\PhoneShare",
    [int]$Port = 8080,
    [string]$Username = "webdavuser",
    [string]$Password = "WebDav@123"
)

# 启用WebDAV功能
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebDAV
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ManagementConsole

# 导入IIS模块
Import-Module WebAdministration

# 创建网站目录
if (-not (Test-Path $PhysicalPath)) {
    New-Item -Path $PhysicalPath -ItemType Directory -Force
}

# 创建网站
New-Website -Name $SiteName -Port $Port -PhysicalPath $PhysicalPath -Force

# 启用WebDAV创作规则
Add-WebConfigurationProperty -Filter "/system.webServer/webdav/authoringRules" `
    -Name "." -Value @{users="*"; path="*"; access="Read,Write,Source"}

# 设置WebDAV设置
Set-WebConfigurationProperty -Filter "/system.webServer/webdav/authoring" `
    -Name "enabled" -Value "True"

Set-WebConfigurationProperty -Filter "/system.webServer/webdav/authoring" `
    -Name "requireSsl" -Value "False"

# 禁用匿名访问
Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/anonymousAuthentication" `
    -Name "enabled" -Value "False"

# 启用基本认证
Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/basicAuthentication" `
    -Name "enabled" -Value "True"

# 创建应用程序池用户
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
try {
    New-LocalUser -Name $Username -Password $securePassword -Description "WebDAV用户" | Out-Null
    Add-LocalGroupMember -Group "Users" -Member $Username
}
catch {
    Write-Host "用户已存在或创建失败: $_" -ForegroundColor Yellow
}

# 设置目录权限
$acl = Get-Acl $PhysicalPath
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
    $Username, 
    "FullControl", 
    "ContainerInherit,ObjectInherit", 
    "None", 
    "Allow"
)
$acl.SetAccessRule($rule)
Set-Acl -Path $PhysicalPath -AclObject $acl

# 配置防火墙
New-NetFirewallRule -DisplayName "WebDAV Server" -Direction Inbound `
    -LocalPort $Port -Protocol TCP -Action Allow

# 启动网站
Start-Website -Name $SiteName

Write-Host "`n=== WebDAV配置完成 ===" -ForegroundColor Green
Write-Host "访问地址: http://$env:COMPUTERNAME:$Port/" -ForegroundColor Cyan
Write-Host "或: http://$(Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -notlike "*Loopback*"}).IPAddress[0]:$Port/" -ForegroundColor Cyan
Write-Host "用户名: $Username" -ForegroundColor Yellow
Write-Host "密码: $Password" -ForegroundColor Yellow

Client

手机通过Webdav 挂载网盘(Android )

webdav client app

ES文件浏览器  - ES文件浏览器是由北京亿思创世信息技术有限公司开发

https://github.com/zhao-pf/Android-WebDav

 

webdav client app for android open source

 

WebDAV Clients for Windows

https://github.com/filecxx/FileCentipede  10k star  only pc