powershell from mdt where does the powershel run?

juan carlos salazar caballero 26 Reputation points
2023-03-03T07:47:32.8833333+00:00

Hello.

I'm triying to run powershell script from the custom setting area in a mdt task sequence, the question is , which powershell run in that moment?, is the powershell install in the deployed cliente, or an another hand is the powershell installed in the windows server 2012 r2 where I have installed the microsoft deployment toolkit?.

All my Powershell scripts are installed in the scripts folder of the deployment share.

Thank you very much.

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-03-03T16:40:07.63+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.

    I have linked an article below that may help solve your issue. Here is what the article has to say:

    In File Explorer (or Windows Explorer), right-click the script file name and then select "Run with PowerShell". The "Run with PowerShell" functionality launches a PowerShell session with the execution policy Bypass, executes the script, and then exits the session.

    REFERENCE: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_run_with_powershell#:\x7e:text=In%20File%20Explorer%20(or%20Windows,script%2C%20and%20closes%20the%20session

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    1 person found this answer helpful.

  2. DaveK 1,871 Reputation points
    2023-03-03T14:22:36.1366667+00:00

    Hi,

    I believe the PowerShell would from the client if its part of a task sequence any given client is running.

    I haven't tried specifically via MDT but I do run PowerShell scripts as part of my task sequence on SCCM OS deployments and the script runs on the client (in my case to remove some AppX packages)

    Hope that helps

    Dave

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.