WebAdministrationDsc icon indicating copy to clipboard operation
WebAdministrationDsc copied to clipboard

Parameter 'PhysicalPath' should point to existing path, on Azure File Share

Open cm5778 opened this issue 3 years ago • 4 comments

I am trying to create a webApplication on IIS pointing to Azure File share using PowerShell DSC xWebApplication as below xWebApplication AppName { DependsOn = "[xWebSite]xWebSiteName" Name = "appname" PhysicalPath = "\azurefileshare\etc" WebAppPool = $AppPoolName Website = $WebSiteName } I am getting "Parameter 'PhysicalPath' should point to existing path." error where the mentioned path can be accessed manually and able to set to IIS application manually. All the user accounts involved in the process have full control access on file share Also observed in Process Monitor that PowerShell DSC kicks off "C:\windows\system32\wbem\wmiprvse.exe" running as NT AUTHORITY\SYSTEM and not sure how to change user when running th PowerShell DSC.

image

Can someone help in this regard please.

cm5778 avatar May 17 '21 18:05 cm5778

Consider using built-in parameter PSDscRunAsCredential to change what user the resource is run as.

johlju avatar May 20 '21 17:05 johlju

@johlju apologies for not getting back sooner, I am having issue including PSDscRunAsCredential which I am trying to figure out, besides just to trim down the issue, I tried creating an application using Invoke-Command with credentials which giving Bad network error.

I will update on PSDscRunAsCredential

cm5778 avatar Jun 10 '21 13:06 cm5778

after adding below scripts $ConfigData = @{ AllNodes = @(
@{
# The name of the node we are describing NodeName = "$Computer" PSDscAllowDomainUser = $true }; );
} and below in configuration Registry CmdPath { Key = 'HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor' ValueName = 'DefaultColor' ValueData = '1F' ValueType = 'DWORD' Ensure = 'Present' Force = $true Hex = $true PsDscRunAsCredential = Get-Credential } I am getting this error: image

going through : https://docs.microsoft.com/en-us/powershell/scripting/dsc/pull-server/securemof?view=powershell-7.1

which suggesting to have encrypt mof using certs, except it seems a bit complicated, am I in right path

cm5778 avatar Jun 10 '21 18:06 cm5778

btw I am using PowerShell version 5.1

cm5778 avatar Jun 10 '21 18:06 cm5778