Create FTP Site with remote unc path via PowerShell RRS feed

  • Question

  • I've been looking online to no avail. Using the GUI (in IIS), I can easily create a FTP site that points to a \\sever\share (unc path). However, when scripted in PS, I get the following error "Parameter 'PhysicalPath' must point to an existing path". Does somebody know of a way around this? I'd also need to include in the script- the username & pw of the user with access to the directory that will serve as the FTP root folder, and I'm also not share how to script that. Below is the sample of the code that's yielding the error:

    $FTPSiteName = 'Sample FTP Site'
    $FTPSitePath = '\\SampleServer\SampleShare'
    New-WebFTPSite -Name $FTPSiteName -Port $FTPPort -PhysicalPath $FTPSitePath

    Please advise. Your assistance with this is greatly appreciated.

    Friday, August 9, 2019 2:58 PM

All replies

  • Post IIS questions here:

    That is the MS forum for IIS and PS with IIS.

    Note that a "PhysicalPath" is CANNOT be a UNC.


    Friday, August 9, 2019 3:43 PM
  • To add a VD to an FTP site:

    New-Item "IIS:\sites\$ftpSiteTitle\$fname" -PhysicalPath $fpath -type VirtualDirectory


    Friday, August 9, 2019 3:50 PM