Intune MDM powershell scripts

Mario Veras 36 Reputation points

Does anyone know if when you push a powershell script to a Windows 10 machine from Intune MDM, will it leave a copy in a cache somewhere on the target Windows machine? My MDM script contains a password and I don't want someone to find it.

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.
4,884 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
2,687 questions
0 comments No comments
{count} votes

Accepted answer
  1. Crystal-MSFT 24,786 Reputation points Microsoft Vendor

    @Mario Veras , Based on my research, when a new script is deployed, script will be downloaded to the folder %ProgramFiles(x86)%\Microsoft Intune Extension\Policies\Scripts. The script will be run. When the script has run the above files will be cleaned up, so you will not find the scripts in a cache when run. But you will find the whole content of the script in the log file %ProgramData%\Microsoft\IntuneManagementExtension\logs. Find a link for the reference:
    Note: Non-Microsoft link, just for the reference.

    That is to say, if we include any important password in the script, it will cause password leaked. It is not recommended.

    Hope it can help.

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Nick Hogarth 3,426 Reputation points MVP

    It isn't ideal to put the password in the script, and yes I believe through log files someone might be able to see the plain text. See

    0 comments No comments

  2. Mario Veras 36 Reputation points

    Thank you very much. This is very helpful.