Powershell error 80040154, import-module, set-webconfigurationproperty

434 views
Skip to first unread message

Choon Ming Goh

unread,
Mar 23, 2014, 11:01:32 AM3/23/14
to puppet...@googlegroups.com
Hi all,

I'm currently trying to set some web configuration properties through powershell using puppet but it is throwing me error. If I were to run the commands directly on the powershell it works. I'm running this on a Windows 2008 R2 server with WebServerRole. Please enlighten

  exec { 'SEMS disable Basis Authentication':
    command => 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false"',
  }
Notice: Compiled catalog for win-uej5ngs6bua.docomointertouch.net in environment production in 1.80 seconds
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: Set-WebConfigurationProperty : Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-BE1-6AF00DC944A6} failed due to the following error: 80040154.
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: At line:1 char:62
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: + Import-Module WebAdministration; Set-WebConfigurationProperty <<<<  -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:     + CategoryInfo          : NotSpecified: (:) [Set-WebConfigurationProperty], COMException
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:     + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.SetConfigurationPropertyCommand
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:
Error: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false" returned 1 instead of one of [0]
Error: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: change from notrun to 0 failed: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false" returned 1 instead of one of [0] 

krish

unread,
Mar 23, 2014, 3:46:15 PM3/23/14
to puppet...@googlegroups.com
Just a hunch.... Windows 2008 R2 is 64 bit...
http://docs.puppetlabs.com/windows/running.html#file-system-redirection-in-64-bit-windows-versions

and another small check... wondering if puppet run is invoking a case-sensitive powershell? (less likely though)






--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/91f6c261-4a10-42bd-a428-83e0e20c71bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Have a Power-Up Day!
--
Krish
I lives in a cave(facebook.com/toonheart) nd writes me games.
DOWNLOAD Hoppu Now on Blackberry!
http://appworld.blackberry.com/webstore/content/49832892/

Josh Cooper

unread,
Mar 24, 2014, 12:15:09 PM3/24/14
to puppet...@googlegroups.com
On Sun, Mar 23, 2014 at 12:46 PM, krish <das.sri...@gmail.com> wrote:
Just a hunch.... Windows 2008 R2 is 64 bit...
http://docs.puppetlabs.com/windows/running.html#file-system-redirection-in-64-bit-windows-versions

and another small check... wondering if puppet run is invoking a case-sensitive powershell? (less likely though)






On Sun, Mar 23, 2014 at 8:31 PM, Choon Ming Goh <choonm...@gmail.com> wrote:
Hi all,

I'm currently trying to set some web configuration properties through powershell using puppet but it is throwing me error. If I were to run the commands directly on the powershell it works. I'm running this on a Windows 2008 R2 server with WebServerRole. Please enlighten

  exec { 'SEMS disable Basis Authentication':
    command => 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false"',

The "SysWOW64" will force puppet to execute the 32-bit version of powershell. I am guessing that you wanted to use "sysnative" so that the 64-bit version of powershell is executed?

That said there is a powershell module on the forge that handles the 32/64 file system redirection issue: http://forge.puppetlabs.com/joshcooper/powershell
 
  }
Notice: Compiled catalog for win-uej5ngs6bua.docomointertouch.net in environment production in 1.80 seconds
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: Set-WebConfigurationProperty : Retrieving the COM class factory for component with CLSID {688EEEE5-6A7E-422F-BE1-6AF00DC944A6} failed due to the following error: 80040154.
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: At line:1 char:62
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: + Import-Module WebAdministration; Set-WebConfigurationProperty <<<<  -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:     + CategoryInfo          : NotSpecified: (:) [Set-WebConfigurationProperty], COMException
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:     + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.SetConfigurationPropertyCommand
Notice: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns:
Error: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false" returned 1 instead of one of [0]
Error: /Stage[main]/Profile::Iis::Sems/Exec[SEMS disable Basis Authentication]/returns: change from notrun to 0 failed: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -Command "Import-Module WebAdministration; Set-WebConfigurationProperty -filter /system.webServer/security/authentication/AnonymousAuthentication -name enabled -location SEMS -value false" returned 1 instead of one of [0] 

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/91f6c261-4a10-42bd-a428-83e0e20c71bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Have a Power-Up Day!
--
Krish
I lives in a cave(facebook.com/toonheart) nd writes me games.
DOWNLOAD Hoppu Now on Blackberry!
http://appworld.blackberry.com/webstore/content/49832892/

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Josh Cooper
Developer, Puppet Labs

Join us at PuppetConf 2014September 23-24 in San Francisco - http://bit.ly/pupconf14
Register now and save $350! 

Choon Ming Goh

unread,
Mar 24, 2014, 11:31:18 PM3/24/14
to puppet...@googlegroups.com
I did try to use the path C:\Windows\sysnative but Puppet complains the path does not exist. I'll give the poweshell module a go and see what is the outcome. 
Reply all
Reply to author
Forward
0 new messages