Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xIisFeatureDelegation Failed to invoke DSC Set method: The request is not supported. #588

Open
SylvainMartel opened this issue Nov 13, 2020 · 7 comments
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.

Comments

@SylvainMartel
Copy link

Details of the scenario you tried and the problem that is occurring

Trying to allow override of anonymous authentication setting but it fails saying the request is not supported. The DSC resource is called from ansible

Verbose logs showing the problem

fatal: [stnoy090.intro.techno.local]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"DependsOn": null,
"Filter": "/system.webserver/security/authentication/anonymousAuthentication",
"OverrideMode": "Allow",
"Path": "IIS:\Sites\STNOY090",
"PsDscRunAsCredential_password": null,
"PsDscRunAsCredential_username": null,
"module_version": "latest",
"resource_name": "xIisFeatureDelegation"
}
},
"module_version": "3.2.0",
"msg": "Failed to invoke DSC Set method: The request is not supported. (Exception from HRESULT: 0x80070032)",
"reboot_required": false,
"verbose_set": [
"Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceSet,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.",
"An LCM method call arrived from computer STNOY090 with user sid S-1-5-21-1645522239-583907252-725345543-23430.",
"[STNOY090]: LCM: [ Start Set ] [[xIisFeatureDelegation]DirectResourceAccess]",
"[STNOY090]: [[xIisFeatureDelegation]DirectResourceAccess] Changed overrideMode for '/system.webserver/security/authentication/anonymousAuthentication' to 'Allow'.",
"[STNOY090]: LCM: [ End Set ] [[xIisFeatureDelegation]DirectResourceAccess] in 0.1560 seconds.",
"Operation 'Invoke CimMethod' complete.",
"Time taken for configuration job to complete is 0.377 seconds"
],
"verbose_test": [
"Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = ResourceTest,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.",
"An LCM method call arrived from computer STNOY090 with user sid S-1-5-21-1645522239-583907252-725345543-23430.",
"[STNOY090]: LCM: [ Start Test ] [[xIisFeatureDelegation]DirectResourceAccess]",
"[STNOY090]: [[xIisFeatureDelegation]DirectResourceAccess] Getting override mode for '/system.webserver/security/authentication/anonymousAuthentication'.",
"[STNOY090]: LCM: [ End Test ] [[xIisFeatureDelegation]DirectResourceAccess] False in 0.1090 seconds.",
"[STNOY090]: LCM: [ End Set ] in 0.1710 seconds.",
"Operation 'Invoke CimMethod' complete.",
"Time taken for configuration job to complete is 0.324 seconds"

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

- name: override pour site par defaut. 
  win_dsc:
    resource_name: xIisFeatureDelegation
    Filter: /system.webserver/security/authentication/anonymousAuthentication
    OverrideMode: Allow
    Path: IIS:\Sites\STNOY090

The operating system the target node is running

OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.3986.amd64fre.rs1_release.201002-1707
OsLanguage : en-US
OsMuiLanguages : {en-US, fr-CA}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.14393.3866
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.3866
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

3.2.0

@johlju
Copy link
Member

johlju commented Nov 15, 2020

Is it possible for you to see what line in the code generate this error?

Can you run this manually on the node?

Set-WebConfiguration -Filter '/system.webserver/security/authentication/anonymousAuthentication' -PsPath 'IIS:\Sites\STNOY090' -Metadata 'overrideMode' -Value 'Allow'

@johlju johlju added the waiting for author response The pull request is waiting for the author to respond to comments in the pull request. label Nov 15, 2020
@SylvainMartel
Copy link
Author

Set-WebConfiguration -Filter '/system.webserver/security/authentication/anonymousAuthentication' -PsPath 'IIS:\Sites\STNOY090' -Metadata 'overrideMode' -Value 'Allow'

Set-WebConfiguration : The request is not supported. (Exception from HRESULT: 0x80070032)
At line:1 char:1
+ Set-WebConfiguration -Filter '/system.webserver/security/authenticati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-WebConfiguration], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.SetConfigu
   rationCommand

Same result with a machine path:
Set-WebConfiguration -Filter '/system.webserver/security/authentication/anonymousAuthentication' -PsPath 'MACHINE/WEBROOT/APPHOST/STNOY090' -Metadata 'overrideMode' -Value 'Allow'

@SylvainMartel
Copy link
Author

The Get works though

$a = Get-WebConfiguration -Filter '/system.webserver/security/authentication/anonymousAuthentication' -PsPath 'IIS:\Sites\STNOY090' -Metadata
$a.Metadata.effectiveOverrideMode

Result is: Deny (which is correct at the moment)

@johlju
Copy link
Member

johlju commented Nov 15, 2020

Then the problem is that Set-WebConfiguration does not allow that combination. I’m not familiar with it so can’t help further, but if you get the Set working with some other combination then the resource will work. 🙂

@SylvainMartel
Copy link
Author

I'm no IIS expert either but what I'm trying to do is the same as is listed in the resource examples. The only difference being that the name of the website is stnoy090 instead of the Default website. So I think if this doesn't work, then the resource isn't working anymore for some reason.

What I'm trying to do is allow override in web.config for that website. I might look at xwebsite and see if it couldn't be enhanced to do so with a parameter that tells it to add overrideMode="Allow" to the website definition in applicationHost.config .(IF I find the time. Time... such a sparse little thing..)

@SylvainMartel
Copy link
Author

SylvainMartel commented Nov 18, 2020

This syntax works:
Set-WebConfiguration -Filter '/system.webserver/security/authentication/anonymousAuthentication' -PsPath 'IIS:\Sites' -Metadata 'overrideMode' -Value 'Allow' -Location "STNOY090"

The only diff is the use of the -location parameter and we give it the last part of what was under PSPAth.

@SylvainMartel
Copy link
Author

SylvainMartel commented Nov 18, 2020

@johlju Basic question here: I am coming back to DSC after 18 months away so I am rusty as heck and facing a beginner's problem it seems.. So I am trying to modify the DSC ressource to make it work properly and to do so I need to add a new parameter(WebsiteName)
I add it in the parameter list, like this:

        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [String]
        $WebsiteName

but when I try an invoke-dscresource to test it, it keeps telling me the new parameter is not a valid one. Same thing when I launch it through ansible, it doesn't recognize the new parameter as valid.

"msg": "Unsupported parameters for (ansible.windows.win_dsc) module: WebsiteName. Supported parameters include: Path, PsDscRunAsCredential_username, Filter, module_version, PsDscRunAsCredential_password, resource_name, OverrideMode, DependsOn"

I looked in the code, I do not see a special place to register parameters, beside the usual declaration. What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.
Projects
None yet
Development

No branches or pull requests

2 participants