Powershell script for SCCM package module is not working

Question

Dear Friends, we are creating package via Powershell script but this script is not running for only one user rest of them its working even the user has full rights to SCCM server, , the below error message is showing when the one user tried to create the package via Powershell module

Error Message is:

New-CMPackage : The ‘New-CMPackage’ command was found in the module ‘ConfigurationManager’, but the module could not be loaded. For more information, run ‘Import-Module
ConfigurationManager’.
At C:Program FilesWindowsPowerShellModulesPkgModulefunctionPkgModulefunction.psm1:40 char:1
+ New-CMPackage –Name $Pkgname –Description $Description –Language English –Manufa …
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-CMPackage:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

Answers ( 4 )

    0
    2020-12-23T06:15:35+05:30

    Sorry for the delayed response and thanks for all of your response

    I figured out the issue, the issue happened for the remote machine users, after importing the SCCM PowerShell module for the user profile, the issue has resolved

    0
    2020-05-27T18:11:35+05:30

    Hi,

    Please share the powershell script error to assist.

    Thanks
    Karthikeyan

    0
    2020-05-27T09:38:42+05:30

    Hello Siva, Had you tried to import module by running powershell as administrator.

    + https://snipboard.io/4SW8PJ.jpg

    If you already tried, Please provide the more details with screenshots by hiding sensitive info, How are you executing!

    Best answer
    0
    2020-05-27T06:34:03+05:30

    First thing what I do is :

    1. Launch the SCCM console. In the upper-left corner, there’s a blue rectangle. Select the white arrow in the blue rectangle, and “choose Connect via Windows PowerShell”.
    2. Check whether that user can see the following prompt – HMD is your side code
    “PS HMD:\>”

    Or you can try following

    Import-Module ConfigurationManager command is working for that user?

    If so, try to run the following command

    Get-CMSite

    to check whether the connectivity is ok or not?

Leave an answer

Sorry, you do not have permission to answer to this question .