Intune MDM powershell scripts

Mario Veras 41 Reputation points
2021-03-03T17:13:38.003+00:00

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

Accepted answer
  1. Crystal-MSFT 43,721 Reputation points Microsoft Vendor
    2021-03-04T01:23:07.073+00:00

    @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:
    https://deploywindows.com/2018/01/11/want-to-master-troubleshooting-with-intune-and-windows-10/
    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,436 Reputation points
    2021-03-03T21:33:46.99+00:00

    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 https://microsoftintune.uservoice.com/forums/291681-ideas/suggestions/33574702-secure-authentication-within-powershell-scripts-fo

    0 comments No comments

  2. Mario Veras 41 Reputation points
    2021-03-04T04:25:16.343+00:00

    Thank you very much. This is very helpful.