Skip to content

xSmbShare resource does not take into account properties other than Name, Path, Ensure when doing a Test-TargetResource #2

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

Closed
TravisEz13 opened this issue Apr 22, 2015 · 6 comments
Labels
bug The issue is a bug.

Comments

@TravisEz13
Copy link
Contributor

The xSmbShare resource always tests false on our staging server, so the share is re-created every time and configuration drift is always reported.
VERBOSE: [STGWEB1]: LCM: [ Start Resource ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: LCM: [ Start Test ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: LCM: [ End Test ] [[xSmbShare]XX] in 0.0160 seconds.
VERBOSE: [STGWEB1]: LCM: [ Start Set ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: [[xSmbShare]XX] Share with name XX exists
VERBOSE: [STGWEB1]: [[xSmbShare]XX] Setting FullAccess for Everyone
VERBOSE: [STGWEB1]: LCM: [ End Set ] [[xSmbShare]XX] in 0.1870 seconds.
VERBOSE: [STGWEB1]: LCM: [ End Resource ] [[xSmbShare]XX]

There's nothing configuration-specific to investigate (excerpt from function Test-TargetResource):
if ($Ensure -eq "Present")
{
if ($share -eq $null)
{
$testResult = $false
}
elseif ($share -ne $null -and $PSBoundParameters.Count -gt 3)
# This means some other parameter in addition to Name, Path, Ensure could have been specified
# Which means we need to modify something
{
$testResult = $false
}
else
{
$testResult = $true
}
}
Rather than verifying the current configuration, this test assumes $false if parameters other than Name, Path, or Ensure are provided.

@SuperMarioo
Copy link

Test-TargetResource is not testing properly .
I did pull request with my fixes . I'm waiting for the resource to be reviewed .

@TravisEz13
Copy link
Contributor Author

PR #3 was closed without merging for this issue.

@kwirkykat kwirkykat added the bug The issue is a bug. label Apr 26, 2016
@kwirkykat kwirkykat added the help wanted The issue is up for grabs for anyone in the community. label Aug 19, 2016
@daBONDi
Copy link

daBONDi commented Jan 4, 2017

Still not fixed nearly after 2 Years
Maybe Microsoft Abbond Powershell DSC 👎

@stinos
Copy link

stinos commented Jan 31, 2017

Initially I also always got false test result, problem for me was that the usernames I used for the access parameters didn't have a domain prepended. Using (hostname) + 'user' instead of just 'user' did the trick. This should imo be documented though.

@daBONDi
Copy link

daBONDi commented Jan 31, 2017

There are checks missing in the code, thats why, but the hassle microsoft do with this some kind of nda realy ruine the fun to fix it.

@johlju
Copy link
Member

johlju commented Mar 31, 2019

This issue has been resolved in the resource that is pending in PR dsccommunity/ComputerManagementDsc#211.

This resource is moving to ComputerManagementDsc, and the xSmbShare module will be deprecated once the resource has been moved.

Closing this issue at this time.

@johlju johlju closed this as completed Mar 31, 2019
@kwirkykat kwirkykat removed the help wanted The issue is up for grabs for anyone in the community. label Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

No branches or pull requests

6 participants