locked
How could I remove/delete the rules from “FTP Authorization Rules” in Powershell? RRS feed

  • Question

  • I am trying to use Powershell to delete the "FTP Authorization Rules" from IIS7.

    Thought I found the "add-webconfiguration" Cmdlet and can add a new rule in "FTP Authorization Rules" successfully, but can't find any way to delete the rules.

    In the get-help add-webconfiguration, there is a reference to remove-webconfiguration, but this cmdlet does not exist. If I try "get-help Remove-WebConfiguration", system will show 4 item as following but NO "Remove-WebConfiguration":

    Remove-WebConfigurationBackup

    Remove-WebConfigurationLocation

    Remove-WebConfigurationLock

    Remove-WebConfigurationProperty

    Dose anyone know how to remove the specified rule in "FTP Authorization Rules"?

    Monday, August 28, 2017 3:42 AM

Answers

  • Use "Remove-WebConfigurationProperty" can success to delete the rules

    Example as following:

    Remove-WebConfigurationProperty  -pspath 'MACHINE/WEBROOT/APPHOST' -location 'FTP' -filter "system.ftpServer/security/authorization" -name "." -AtElement @{users='';roles='dyk';permissions='1'}


    • Marked as answer by lernshin Tuesday, August 29, 2017 4:16 AM
    • Edited by lernshin Tuesday, August 29, 2017 6:15 AM
    Tuesday, August 29, 2017 4:15 AM

All replies

  • The docs are a bit vague.  The command is "Clear-WebConfiguration"

    https://technet.microsoft.com/en-us/library/ee790569.aspx

    For the best assistance with IIS you should post here: http://forums.iis.net

    Configuration & Scripting


    \_(ツ)_/


    • Edited by jrv Monday, August 28, 2017 8:26 AM
    Monday, August 28, 2017 8:25 AM
  • Hi jrv,

    Thank you so much for your reply!!

    I do find "Clear-WebConfiguration" command but can't try delete rules success....|||

    Do you have any sample for this command to remove FTP Authorization Rules?

    And Thank you for your suggest~~~




    • Edited by lernshin Monday, August 28, 2017 10:00 AM
    Monday, August 28, 2017 9:57 AM
  • As before - post IIS specific issues here: Configuration & Scripting

    Also the help has examples of how to use the commands.


    \_(ツ)_/


    • Edited by jrv Monday, August 28, 2017 10:00 AM
    Monday, August 28, 2017 10:00 AM
  • OK. I will post there, and keep trying....

    thank you/

    Tuesday, August 29, 2017 2:28 AM
  • Use "Remove-WebConfigurationProperty" can success to delete the rules

    Example as following:

    Remove-WebConfigurationProperty  -pspath 'MACHINE/WEBROOT/APPHOST' -location 'FTP' -filter "system.ftpServer/security/authorization" -name "." -AtElement @{users='';roles='dyk';permissions='1'}


    • Marked as answer by lernshin Tuesday, August 29, 2017 4:16 AM
    • Edited by lernshin Tuesday, August 29, 2017 6:15 AM
    Tuesday, August 29, 2017 4:15 AM