Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cm5778 opened this issue May 17, 2021 · 4 comments
Open
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.

Comments

@cm5778
Copy link

cm5778 commented May 17, 2021

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.

@johlju
Copy link
Member

johlju commented May 20, 2021

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

@johlju johlju added the waiting for author response The pull request is waiting for the author to respond to comments in the pull request. label May 20, 2021
@cm5778
Copy link
Author

cm5778 commented Jun 10, 2021

@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
Copy link
Author

cm5778 commented Jun 10, 2021

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
Copy link
Author

cm5778 commented Jun 10, 2021

btw I am using PowerShell version 5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.
Projects
None yet
Development

No branches or pull requests

2 participants