I want to delete specified WebDAV Authoring Rules [Answered]RSS

9 replies

Last post Nov 09, 2020 01:59 AM by Brucz

‹ Previous Thread|Next Thread ›
  • I want to delete specified WebDAV Authoring Rules

    Oct 29, 2020 01:16 AM|kawasa19|LINK

    I want to delete specified WebDAV Authoring Rules by user name.

    Concretely, if there was WebDAV Authoring Rule "Default Web Site > WebDAV > folder named by user name" , I would want to delete it specified by user name.

    In this case, should I use Remove-WebConfigurationProperty?

    Do you know the way to solve this problem. Plese tell me if you know.

  • Re: I want to delete specified WebDAV Authoring Rules

    Oct 29, 2020 08:46 AM|Brucz|LINK

    Hi kawasa19,

    What do you mean about user name?

    If you want to delete the rule, just choose it and right click, then remove it.

    Best Regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: I want to delete specified WebDAV Authoring Rules

    Oct 30, 2020 01:02 AM|kawasa19|LINK

    Thank you for your reply, Brucz.

    I want to realize what I received with Powershell.

    And user name is users.

  • Re: I want to delete specified WebDAV Authoring Rules

    Oct 30, 2020 09:41 AM|Brucz|LINK

    Hi kawasa19,

    I am glad that your problem has been resolved. I originally thought you wanted to delete it through IIS manager.

    Best Regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 02, 2020 01:01 AM|kawasa19|LINK

    Sorry.  I can't tell what I said to you.

    I am Japanese, sorry my poor English.

    I want to delete WebDAV Authoring Rules by using PowerShell.

    Do you know?

    I make Virtual directory, Home>Site>WebDAV>user01.

    Then, I add WebDAV Authoring Rules, users = 'user01'.

    I created PowerShell script below.

    Remove-WebConfigurationProperty -Filter "/system.webServer/webdav/authoringRules" -Location "webdav" -Name . -AtElement @{users='user01'}

    Result:

    user01 was delited from WebDAV Authoring Rules that Home>Site>WebDAV.

    Just I want user01 to be deleted from WebDAV Authoring Rules that Home>Site>WebDAV>user01.

    Plese tell me.

  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 03, 2020 09:31 AM|Brucz|LINK

    Hi kawasa19,

    I made a simple example for your reference. You can delete web DAV Authoring Rules through power shell.

    A virtual directory “a” is created under the default website, there are three WebDAV Authoring Rules, their users are user1, user2, user1 and user2. Deleted is the WebDAV Authoring Rules of user1.

    Delete first one and third one by using PowerShell.

    Remove-WebConfigurationProperty  -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site/a' -filter "system.webServer/webdav/authoringRules" -name "." -AtElement @{users='user1';roles='';path='*'}
    
    Remove-WebConfigurationProperty  -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site/a' -filter "system.webServer/webdav/authoringRules" -name "." -AtElement @{users='user1,user2';roles='';path='*'}
    

    Best Regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 04, 2020 08:19 AM|kawasa19|LINK

    Hello Brucz.

    Thank you for your reply, I am happy.

    Actually, I want to do this in remote desktop.

    I made script run like below: 

    Invoke-Command $session -ScriptBlock {Remove-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -Filter "/system.webServer/webdav/authoringRules" -Location "webdav/$($args[0])" -Name "." -AtElement @{users= 'user01';roles='';path='*'}} -ArgumentList $dir_name

    then,apperd this message that I translate Japanese to English:

    Error: The configuration file cannot be read because you do not have permission
    +CategoryInfo:NotSpecified:(:)[Remove-WebconfigurationProperty], UnauthorizedAccessExeption
    +
    FullyQualifiedErroId: System.UnauthorizedAccessExeption,Microsoft.IIs.PowerShell.Provider.RemoveConfigurationPropertyCommand




    And I was not able to delete one.

    Do you know the solution?

  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 05, 2020 07:46 AM|Brucz|LINK

    Hi kawasa19,

    This is because your user authority for executing the powershell statement is insufficient. I suggest you execute it as an administrator or a user with administrator authority.

    Best Regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 06, 2020 01:37 AM|kawasa19|LINK

    Hello Brucz.

    Thank you for your reply.

    In adittion, I was able to delete one writing comand directly in PowerShell, but was not able to do one by usrig batFile.
    And Error is below.

    Error: The configuration file cannot be read because you do not have permission.

    In Japanese PowerShell Question Site, I get Informaition that maybe Remote UAC is in the way.

    Do you have any idea? please.

  • Re: I want to delete specified WebDAV Authoring Rules

    Nov 09, 2020 01:59 AM|Brucz|LINK

    Hi kawasa19,

    Do you mean that you execute a bat file to run powershell command? IIS won't actively execute a bat file, unless with the help of the asp.net application. And for security reasons, by default IIS will block access to the bat file, and you need to set the permissions of the application pool.

    If you can be sure that bat file  was executed successfully, it may caused by remote UAC. You can refer to the document to disable the UAC remote restrictions.

    Best Regards,

    Brucz

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
‹ Previous Thread|Next Thread ›