none
Can't connect to "root\ccm\clientSDK\CCM_Program" on remote computers with powershell RRS feed

  • Question

  • I'm trying to run the ps command below but have issues withe connection and output from CCM_Program when connecting to remote computer.

    $Computername = "MyTestComputerName"
    
    # OSD Task Sequence #
    $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" })
    $OSD = $OSDTS.Name
    Write-Output "OSD: $OSD"
    
    # Application #
    $Application = (Get-CimInstance -ClassName CCM_Application -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.InstallState -like "NotInstalled" })
    $AppName = $Application.Name
    Write-Output "Apps: $AppName"
    
    # Software Updates #
    $SUPEvalState0 = "0"
    $SUPEvalState1 = "1"
    $SUPClass = [WmiClass]"root\ccm\clientSDK:CCM_SoftwareUpdatesManager"
    $SUPs = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computername | Where-Object { $_.EvaluationState -like "*$($SUPEvalState0)*" -or $_.EvaluationState -like "*$($SUPEvalState1)*" })
    $SUPName = $SUPs.Name
    Write-Output "Updates: $SUPName"

    Running that command against remote computer I get output for Apps & Updates but not TS. When I run the same code localy on the same computer, then I get output for TS as well.

    It seems like I for some reason can't connect to CCM_Program on remote computers but it works localy. One more strange thing is that it only seems to work localy if I run the command as logged on user. If I elevate ISE and run then I get the same result as for remote computer. Then I only get output for Applications & Updates but not for OSD Task Sequence.

    Thursday, January 19, 2017 10:00 AM

All replies

  • My Primery site server runs on Server 2012:
    ConfigMgr: CB 1606
    ADK: 1607
    MDT: 2013 Update 1 (Integrated with CM)
    Powershell version: 3.0

    Tested clients:
    Windows 10 (1607)
    Powershell version: 5.1.14.393.576

    Windows 7
    Powershell version: 2.0

    Tested running script from:
    CM Primery site server
    Server 2012
    Powershell: 3.0

    Server 2008 R2
    Powershell: 3.0 & Powershell
    5.0.10586.117

    Thursday, January 19, 2017 11:20 AM
  • Hey, 

    CIM cmdlets won't work on Powershell 2.0, needs at least 3.0. Try the following from your server to client win 10 and see what results you get.  

    Test if WSman protocol works (should work since you get one of 2 CIMinstances)

    test-wsman -computername sd010 -authentication default

    This will run over DCOM protocol instead of WSMan, interested to see if this gives you any result back. 

    $Computername = "SD011" $so = New-CimSessionOption -Protocol DCOM New-CimSession -ComputerName $Computername -SessionOption $so $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" }) $OSD = $OSDTS.Name Write-Output "OSD: $OSD"

    Remove-CimSession -ComputerName $Computername


    Friday, January 20, 2017 7:14 AM
  • Hey, 

    CIM cmdlets won't work on Powershell 2.0, needs at least 3.0. Try the following from your server to client win 10 and see what results you get.  

    Test if WSman protocol works (should work since you get one of 2 CIMinstances)

    test-wsman -computername sd010 -authentication default

    This will run over DCOM protocol instead of WSMan, interested to see if this gives you any result back. 

    $Computername = "SD011" $so = New-CimSessionOption -Protocol DCOM New-CimSession -ComputerName $Computername -SessionOption $so $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm\clientSDK" -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" }) $OSD = $OSDTS.Name Write-Output "OSD: $OSD"

    Remove-CimSession -ComputerName $Computername


    Thanks!

    The first command returns:

    Win10 Client

    wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
    ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor   : Microsoft Corporation
    ProductVersion  : OS: 10.0.14393 SP: 0.0 Stack: 3.0

    Win7 Client

    wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
    ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
    ProductVendor   : Microsoft Corporation
    ProductVersion  : OS: 6.1.7601 SP: 1.0 Stack: 2.0

    Second command returns:

    Win7 Client

    Id           : 1
    Name         : CimSession1
    InstanceId   : ed7f4e6b-cee3-47dc-b570-b7184fef7ed6
    ComputerName : MyTestClient01
    Protocol     : DCOM
    
    Get-CimInstance : Tjänsten WS Management kan inte behandla begäran. En URI för en DMTF-resurs användes för att komma åt en klass som inte är DMTF. Försök igen med en URI
     som inte är en DMTF-resurs.
    At line:5 char:11
    + $OSDTS = (Get-CimInstance -ClassName CCM_Program -Namespace "root\ccm ...
    +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (root\ccm\clientSDK:CCM_Program:String) [Get-CimInstance], CimException
        + FullyQualifiedErrorId : HRESULT 0x80338139,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
        + PSComputerName        : MyTestClient01
     
    OSD: 

    Win10 Client

    Id           : 2
    Name         : CimSession2
    InstanceId   : 3d23f7b8-db5d-48ea-8f53-920db90d81f3
    ComputerName : MyTestClient01
    Protocol     : DCOM
    
    OSD: 
    So it seems like the connection works against win10 (PS 5.1) but it still dosn't return any TS.



    Friday, January 20, 2017 7:51 AM
  • Okay lets try WMI instead of CIM,  

    $Computername = "SD010"
    
    $OSD = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Program -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" })
    $OSD = $OSDTS.Name
    Write-Output "OSD: $OSD"


    Friday, January 20, 2017 8:00 AM
  • Okay lets try WMI instead of CIM,  

    $Computername = "SD010"
    
    $OSD = (Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Program -ComputerName $Computername | Where-Object { $_.TaskSequence -like "True" })
    $OSD = $OSDTS.Name
    Write-Output "OSD: $OSD"


    Same result on Win7 and Win10, No errors but no TS output.
    Friday, January 20, 2017 8:04 AM
  • Next thing would be to check the permissions on ClientSDK namespace

    https://technet.microsoft.com/en-us/library/cc771551%28v=ws.11%29.aspx?f=255&MSPPError=-2147217396

    Friday, January 20, 2017 10:27 AM
  • Next thing would be to check the permissions on ClientSDK namespace

    https://technet.microsoft.com/en-us/library/cc771551%28v=ws.11%29.aspx?f=255&MSPPError=-2147217396

    Systems and Administrators have Full permissions and Interactive has Run methods and Activate accounts. But it works for CCM_Applications and that one is under the same namespce.
    • Edited by Glida Friday, January 20, 2017 10:59 AM
    Friday, January 20, 2017 10:58 AM
  • I am having the same issue.  I'm trying to use powershell to kick off a USMT restore task sequence on a remote machine.  The only way you can see "ROOT\ccm\ClientSDK\CCM_Program" is if you are running the script with the same credentials as the logged in user.
    Monday, January 30, 2017 3:41 PM
  • I am having the same issue.  I'm trying to use powershell to kick off a USMT restore task sequence on a remote machine.  The only way you can see "ROOT\ccm\ClientSDK\CCM_Program" is if you are running the script with the same credentials as the logged in user.
    In a way it's nice to hear that you are not alone :) To me it makes no difference if I am connected with the same user as the logged on or not. Even if it is a Domain Admin user.
    Tuesday, January 31, 2017 9:26 AM