ary
ary

Reputation: 959

Toggle IIS Feature Delegation with Powershell

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.

Upvotes: 6

Views: 4425

Answers (2)

Thom Schumacher
Thom Schumacher

Reputation: 1583

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"
    }
}

Upvotes: 1

ary
ary

Reputation: 959

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:/

Upvotes: 11

Related Questions