Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify Authorization Rules (URL authorization) in IIS using Powershell

Is there a way to modify the Authorization Rules for URL's in IIS (8.0) using Powershell?

I have seen a lot solutions for .NET and FTP, but not really for IIS. Like for ftp.

Import-Module WebAdministration
Add-WebConfiguration -Filter /System.FtpServer/Security/Authorization -Value (@{AccessType="Allow"; Users="$FTPUsername"; Permissions="Read, Write"}) -PSPath IIS: -Location "Default FTP Site/$FTPUserDir/$FTPUsername"    

Also the help function in powershell is not really helpful.

like image 381
user2587683 Avatar asked Dec 05 '25 20:12

user2587683


1 Answers

Try this:

Add-WebConfiguration -Filter /system.webServer/security/authorization -Value (@{AccessType="Allow"; Users="$IISUsername"; Permissions="Read, Write"}) -PSPath IIS: -Location "Your IIS Site"
like image 186
Raf Avatar answered Dec 08 '25 15:12

Raf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!