Install software from NetworkShare via Package Ressoruce

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Thorsten Schellschmidt Thorsten Schellschmidt 1 year, 10 months ago.

  • Author
    Posts
  • #22578

    Hi all,

    I´m trying to install Software that is locate on a NetworkShare via the Package Ressource. But I´m getting some strange erros...

    PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or
    common parameter is set to Stop: Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or
    shared resource and try again

    For the NetworkShare access I used custom credentials.
    I dont´t want to download all the software into some temp folders and then executing the installers.

    Package InstallCustomSoftware {
    Name = "CustomSoftware"
    Credential = $Credential
    Path = "\\NetworkShare\setup.exe"
    ProductId = ""
    Ensure = "Present"
    Arguments = ""
    }

  • #22579
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Before I spend too much time troubleshooting this – does it do the same thing after a reboot? If you had an older version of your DSC config that tried to access the share without a Credential parameter, maybe the LCM still has that session loaded. (Also, are you accessing that same server anywhere else from your DSC configuration? Using the same credentials every time?)

  • #22581

    I rebooted the source client ( which starts the DSC Push) and destination client, but it is still not working. The File ressource is able to copy the installer from the NetworkShare to the client. In saw that the client has already mapped the NetworkShare as NetworkDrive, could this be a problem?

  • #22583
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    I'm not sure. Those network connections are maintained on a per-user basis, and the LCM runs as LocalSystem. It doesn't seem like a user's drive mappings should be able to interfere with your configuration, but other connections to that server from inside the DSC configuration might be a problem.

  • #22587

    I removed everything else from the script and it is still a Problem. Maybe I´m doing something totaly wrong. But I´m able to copy files with a File ressource...

    $ConfigurationData = @{
    AllNodes = @(
    @{
    NodeName="***";
    CertificateFile ="C:\temp\*********.cer";
    Thumbprint = "****************************";
    }
    )
    }

    Configuration Setup
    {
    param (
    [PSCredential] $Credential)

    Node $allnodes.NodeName
    {

    Package InstallCustomSoftware {
    Name = "CustomSoftware"
    Credential = $Credential
    Path = "\\NetworkShare\setup.exe"
    ProductId = ""
    Ensure = "Present"
    Arguments = ""
    }

    LocalConfigurationManager
    {
    CertificateId = $allnodes.Thumbprint
    }

    }
    }

    Set-Location -Path C:\temp\dsc
    Remove-Item C:\temp\dsc\Setup -Recurse

    $password = '********' | ConvertTo-SecureString -asPlainText -Force
    $username = "********"
    $cred = New-Object System.Management.Automation.PSCredential($username,$password)

    $MofFile = Setup -Credential $cred

    Start-DscConfiguration -Path C:\temp\dsc\Setup -Verbose -Wait -Force

    VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, "methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfiguration
    Manager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
    VERBOSE: An LCM method call arrived from computer **** with user sid *****.
    VERBOSE: [***]: LCM: [ Start Set ]
    VERBOSE: [***]: LCM: [ Start Resource ] [[Package]InstallCustomSoftware]
    VERBOSE: [***]: LCM: [ Start Test ] [[Package]InstallCustomSoftware]
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Validate-StandardArguments, Path was ******
    VERBOSE: [***]: [[Package]InstallCustomSoftware] The path extension was .exe
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Ensure is Present
    VERBOSE: [***]: [[Package]InstallCustomSoftware] product is
    VERBOSE: [***]: [[Package]InstallCustomSoftware] product as boolean is False
    VERBOSE: [***]: [[Package]InstallCustomSoftware] The package ***** is not installed
    VERBOSE: [***]: LCM: [ End Test ] [[Package]InstallCustomSoftware] in 0.1090 seconds.
    VERBOSE: [***]: LCM: [ Start Set ] [[Package]InstallCustomSoftware]
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Validate-StandardArguments, Path was ****
    VERBOSE: [***]: [[Package]InstallCustomSoftware] The path extension was .exe
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Ensure is Present
    VERBOSE: [***]: [[Package]InstallCustomSoftware] product is
    VERBOSE: [***]: [[Package]InstallCustomSoftware] product as boolean is False
    VERBOSE: [***]: [[Package]InstallCustomSoftware] The package **** is not installed
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Validate-StandardArguments, Path was *****
    VERBOSE: [***]: [[Package]InstallCustomSoftware] The path extension was .exe
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Package configuration starting
    VERBOSE: [***]: [[Package]InstallCustomSoftware] Mount share to get media
    VERBOSE: [***]: LCM: [ End Set ] [[Package]InstallCustomSoftware] in 128.8620 seconds.
    PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The running command stopped
    because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Multiple connections to a server or shared resource by the
    same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again
    + CategoryInfo : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : ProviderOperationExecutionFailure
    + PSComputerName : ****

    The SendConfigurationApply function did not succeed.
    + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName : ****

    VERBOSE: Operation 'Invoke CimMethod' complete.
    VERBOSE: Time taken for configuration job to complete is 129.137 seconds

You must be logged in to reply to this topic.