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. 

On Tuesday, March 25, 2014 12:15:09 AM UTC+8, Josh Cooper wrote:
>
>
>
>
> On Sun, Mar 23, 2014 at 12:46 PM, krish <[email protected]<javascript:>
> > 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 
>> <[email protected]<javascript:>
>> > 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 [email protected] <javascript:>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/puppet-users/91f6c261-4a10-42bd-a428-83e0e20c71bc%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/91f6c261-4a10-42bd-a428-83e0e20c71bc%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/CA%2BVv_Q2r631bYnyApSUuv4XrdemVwfQ7iEXbrFGU78D8VqQ%2BHA%40mail.gmail.com<https://groups.google.com/d/msgid/puppet-users/CA%2BVv_Q2r631bYnyApSUuv4XrdemVwfQ7iEXbrFGU78D8VqQ%2BHA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Josh Cooper
> Developer, Puppet Labs
>
> *Join us at PuppetConf 2014, September 23-24 in San Francisco* -* 
> http://bit.ly/pupconf14 
> <http://bit.ly/pupconf14>*
> Register now and save $350! 
>  

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/35a42d79-c46f-4029-a895-a00a5e88ef61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to