Author Posts

June 8, 2016 at 3:43 am

Hi guys, I am trying to implement AuthenticationInfo as i create a website using powershell dsc. When I run the script with the AuthenticationInfo included, I get this error:

Write-NodeMOFFile : Invalid MOF definition for node 'localhost': Exception calling "ValidateInstanceText" with "1" argument(s): "Convert property
'AuthenticationInfo' value from type 'INSTANCE[]' to type 'INSTANCE' failed

How do I resolve this one?

Here's the script:

Ensure = "Present"
Name = $WebSiteName
State = "Started"
PhysicalPath = $PhysicalPath
ApplicationPool = $AppPool
BindingInfo = @(
MSFT_xWebBindingInformation
{
Protocol = $Protocol
HostName = $HostName
Port = $Port
IPAddress = $IPAdd
CertificateThumbprint = $CertificateThumbPrint
CertificateStoreName = $CertificateStoreName
})
AuthenticationInfo = @(
MSFT_xWebAuthenticationInformation
{
Anonymous = "True"
Basic = "False"
Digest = "True"
Windows = "False"
})

June 8, 2016 at 6:08 am

Im assuming you have the latest v1.11.0.0 from the Gallery ?

Also, not sure you really need the hash before the values, like in BindingInfo

AuthenticationInfo =  MSFT_xWebAuthenticationInformation
 {
 Anonymous = "True"
 Basic = "False"
 Digest = "True"
 Windows = "False"
 }

Could only find something about a known bug

https://github.com/PowerShell/xWebAdministration/issues/133
https://github.com/PowerShell/xWebAdministration/issues/138

that hopefully will be fixed soon.

If you omit the entire section of AuthenticationInfo, does it all work well ?

Can see changes have been made in May to this
https://github.com/PowerShell/xWebAdministration/commit/9a804ffbea1c90b77581a9a850cba18fa42e3a56

As I cant test this myself, you might want to download the latest dev branch from the xWebAdministration repo on GitHub
and test it.
https://github.com/PowerShell/xWebAdministration

  • This reply was modified 2 years, 3 months ago by  Arie H.

June 8, 2016 at 6:33 am

hi Arie,

Yes it is the latest xWebAdministration module. I also tried changing it to hash but won't work.

Yes, the whole script works if I remove the AuthenticationInfo.

I am still having problems with it.

June 8, 2016 at 8:39 am

Other then trying the latest Dev version as I noted above can only hope
we can have Nitin or someone from the PS team add to this conversation.

June 8, 2016 at 10:17 am

Yup. How can we add them here? Or they should be invited?

June 8, 2016 at 11:00 am

They sometimes visit the forum. You can try to go to the GitHub Repo for xWebAdministration
and open an issue there with all the documentation you have

June 8, 2016 at 9:35 pm

Try this:

Ensure = "Present"
Name = $WebSiteName
State = "Started"
PhysicalPath = $PhysicalPath
ApplicationPool = $AppPool
BindingInfo = @(
MSFT_xWebBindingInformation
{
Protocol = $Protocol
HostName = $HostName
Port = $Port
IPAddress = $IPAdd
CertificateThumbprint = $CertificateThumbPrint
CertificateStoreName = $CertificateStoreName
})
AuthenticationInfo = MSFT_xWebAuthenticationInformation
{
Anonymous = $True
Basic = $False
Digest = $True
Windows = $False
}

June 9, 2016 at 5:37 am

Wow. Thanks Nitin! It Worked like magic. I was wondering why is it declared differently as the BindingInfo?

June 9, 2016 at 5:40 am

BindingInfo is an array while AuthenticationInfo is a single element and has to be declared likewise.

June 9, 2016 at 6:07 am

Oh. I see. Many thanks for the help! 🙂