Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toggle IIS Feature Delegation with Powershell

Tags:

powershell

iis

How can I change IIS "Feature Delegation" using Powershell. I want to change "Authentication - Anonymous" to read/write . I found this Toggle IIS 7.5 Authentication "Anonymous Authentication" with Powershell 3.0? , but not sure how to do something similar for "Feature Delegation". Thanks.

like image 261
ary Avatar asked Feb 01 '16 22:02

ary


2 Answers

Finally found this link and it helped

http://forums.iis.net/t/1178408.aspx?PowerShell+command+Feature+Delegation+settings

Here are few examples.

Set-WebConfiguration //System.WebServer/Security/Authentication/anonymousAuthentication
-metadata overrideMode -value Allow -PSPath IIS:/

Set-WebConfiguration //System.WebServer/Security/Authentication/windowsAuthentication
-metadata overrideMode -value Deny -PSPath IIS:/
like image 194
ary Avatar answered Oct 14 '22 23:10

ary


In case you need the Get for this set above here is an example of that:

Get-WebConfiguration //System.WebServer/Security/Authentication/anonymousAuthentication -pspath iis:/ | select *

Function Enable-WindowsFeatureDelegation
{
    $delegateSet = (Get-WebConfiguration //System.WebServer/Security/Authentication/windowsAuthentication -pspath iis:/).Overridemode
    if($delegateSet -eq 'Deny')
    {
        Set-WebConfiguration //System.WebServer/Security/Authentication/windowsAuthentication -metadata overrideMode -value Allow -PSPath IIS:/
        Write-Output "Feature Delegation for windowsAuthentication has been set to Allow"
    }
}

Function Disable-WindowsFeatureDelegation
{
    $delegateSet = (Get-WebConfiguration //System.WebServer/Security/Authentication/windowsAuthentication -pspath iis:/).Overridemode
    if($delegateSet -eq 'Allow')
    {
        Set-WebConfiguration //System.WebServer/Security/Authentication/windowsAuthentication -metadata overrideMode -value Deny -PSPath IIS:/
        Write-Output "Feature Delegation for windowsAuthentication has been set to Deny"
    }
}
like image 40
thom schumacher Avatar answered Oct 14 '22 22:10

thom schumacher