none
The computer running the Configuration Manager console does not have Read permissions to the share fol der, or the share does not exist. RRS feed

  • Question

  • Hi,


    Seems an SCCM issue, but it is a Powershell (dual hop) issue(?)


    I need to remotely (no local sccm module can be installed) create an application and a deployment type via Powershell.
    Everything works fine, BUT creating the deployment type, it says it cannot reach the share, but when I execute the command directly on the SCCM-server it works fine (I did a | clip of the command and pasted it into sscm PS on SCCM Server).
    So I guess it is a dual hop issue. How do I approach this?

    Though I tried to run it via a:

    $PSSessionConfigurationName = "Microsoft.PowerShell32" 
    $Existing = Invoke-Command -ComputerName $sccmserver -ScriptBlock { Get-PSSessionConfiguration | Where-Object name -EQ $using:PSSessionConfigurationName} -Credential $AdminCredentials
    if (! $Existing)
    { Write-Output "Creating a session to $SCCMServer"
     Invoke-Command -ComputerName $SCCMServer -ScriptBlock { Register-PSSessionConfiguration -Name $using:PSSessionConfigurationName -RunAsCredential $using:Admincredentials -Force } -Credential $AdminCredentials
    }

    $sb = "MyCorrectCommand to create the deployment type, it works fine on the server = Add-CMDeploymenType ..."
    Invoke-Command -ComputerName $SCCMServer -ScriptBlock { Invoke-Expression ($using:sb)  } -ConfigurationName $PSSessionConfigurationName -Credential $AdminCredentials
    Please advise
    J


    Jan Hoedt

    Friday, March 20, 2020 4:40 PM

Answers

  • You know that you are supposed to post code correctly with the code posting tool.  Please edit you post and fix this. What you have posted is unreadable and cannot be correctly copied.

    Without the complete error message it is harder to analyze the code.

    When posting in a technical forum please make it easy on those trying to help to understand the issue.  Making people decode a bad post with insufficient information is not helpful.


    \_(ツ)_/

    • Marked as answer by janhoedt Tuesday, May 12, 2020 7:23 AM
    Friday, March 20, 2020 5:31 PM