I am working on a server configuration where the default logpath for the default web site needs to be changed to a custom path using DSC.
Here is the code snippet in DSC .
What you’re describing (changing the log path for a website) isn’t something you’d do with the WindowsFeature DSC resource. The LogPath property on that resource just specifies where to put a log file of the operation of installing or removing a windows feature; it doesn’t do anything related to a website in IIS (other that possibly installing the IIS feature ahead of time so you can set up a website.)
You probably want to be looking into the xWebAdministration module of the DSC resource kit (or possibly the community version, cWebAdministration, depending on your needs.) It has DSC resources such as xWebsite and xWebConfigKeyValue, which might meet your needs.
Thanks for the help. After using the above code when I tried to run the mof file , in the destination server side I found the below details using Get-DSCConfiguration command.
Looking into this , we can easily say that there is a property called ‘LogPath’ is associated with the windowsfeature ‘Web-Http-Logging’. So, I want this path to be set. Below is the code written to set the path using powershell script.
I use the script resource method to execute the task, but for Value if I provide a hardcoded path like D:\SystemData it works fine. If a parameter is passed for the value then I am getting below error.
PowerShell provider MSFT_ScriptResource failed to execute Set-TargetResource functionality with error message: Cannot bind argument to parameter ‘Value’ because it is null.
+ CategoryInfo : InvalidOperation: ( , CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
Any idea why it is not taking the parameter for value. HEre is the code :