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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,561 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,081 questions
Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
825 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,266 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,354 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,926 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,846 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