Enabling Virtual Directory FTP Directory Browsing via powerShell

Posted on 2014-07-11
Last Modified: 2014-07-11
Hey EE,

My co-workers and I are trying to right a powerShell script to enable the Virtual Directories feature under FTP Directory Browsing for an FTP site that we've created.  The concept is obviously to automate our server setup procedure.  I have been looking for quite sometime on how to write the above mentioned script; however, can't really seem to find a way to enable that flag.  I stumbled upon the appcmd exe and thought that might be a way to do it; however, I can't seem to figure that out either.  I thought the following would solve my issue:

c:\Windows\system32\inetsrv\appcmd.exe set config "ftp" /section:directoryBrowse /enabled:true

That enables directory browsing on a virtual directory called test, which isn't what I need...

Please help,

Christopher Medina
Question by:Christopher Medina
    1 Comment

    Accepted Solution

    I've found the answer to my solution using just PowerShell:  

          [string]$siteName = 'test'

    $ErrorActionPreference = "Stop"

    Import-Module WebAdministration
    Set-ItemProperty "IIS:\Sites\$siteName" -Name ftpServer.directoryBrowse.showFlags -Value "DisplayVirtualDirectories"
    Write-Output "FTP Directory Browsing was set for site $siteName"

    This will prompt you to enter the FTP site name and it will make the changes to the specified site.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Every now and then, Microsoft does something that totally impresses me. It doesn't happen often, but in this case I must say I am thoroughly impressed with Windows Server Backup. One of the long time issues with Windows Backup has been the ability t…
    In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
    This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now