Hello,
I have written a test configuration to create a local folder, and a share for that folder, on a Windows 2012R2 server.
The configuration gets applied just fine. My question is in regard to “test-dscconfiguration”
When I execute “test-dscconfiguration -verbose” I always get a false return, even though the folder and share are present.
(pre)
VERBOSE: An LCM method call arrived from computer SERVERNAME with user sid S-1-5-21-854245398-1004336348-725345543-165690.
VERBOSE: [PHELDSCDEV001]: LCM: [ Start Test ]
VERBOSE: [PHELDSCDEV001]: LCM: [ Start Resource ] [[File]WebRoot]
VERBOSE: [PHELDSCDEV001]: LCM: [ Start Test ] [[File]WebRoot]
VERBOSE: [PHELDSCDEV001]: [[File]WebRoot] The destination object was found and no action is required.
VERBOSE: [PHELDSCDEV001]: LCM: [ End Test ] [[File]WebRoot] in 0.0000 seconds.
VERBOSE: [PHELDSCDEV001]: LCM: [ End Resource ] [[File]WebRoot]
VERBOSE: [PHELDSCDEV001]: LCM: [ Start Resource ] [[xSmbShare]WebRootShare]
VERBOSE: [PHELDSCDEV001]: LCM: [ Start Test ] [[xSmbShare]WebRootShare]
VERBOSE: [PHELDSCDEV001]: LCM: [ End Test ] [[xSmbShare]WebRootShare] in 0.0160 seconds.
VERBOSE: [PHELDSCDEV001]: LCM: [ End Resource ] [[xSmbShare]WebRootShare]
VERBOSE: [PHELDSCDEV001]: LCM: [ End Test ] Completed processing test operation. The operation returned False.
VERBOSE: [PHELDSCDEV001]: LCM: [ End Test ] in 0.0780 seconds.
False
(/pre)
Here is my configuration, any ideas?
(pre)$configdata = @{
Windows feature “NET-Win-CFAC” not found on WindowsFeature
AllNodes = @(
@{
NodeName= @("localhost");
Environment="lab"
Role="Web"
}
)
}
Configuration MyWebServer
{
param(
[string]$Action=“Present”
)
Import-DscResource -Name MSFT_xSmbShare
Node $AllNodes.NodeName
{
File WebRoot
{
Ensure ="$Action"
DestinationPath="c:\webroot"
Type="Directory"
}
xSmbShare WebRootShare
{
Ensure = "$Action"
Name = "webroot"
Path = "c:\webroot"
FullAccess = @("Administrators")
Description = "Read only share for deployed web site files"
DependsOn = "[File]WebRoot"
}
}
}
MyWebServer -ConfigurationData $configdata(/pre)