Forum Discussion

Brendansmith's avatar
Brendansmith
Copper Contributor
Jun 16, 2022

Copying files to %appdata% with intune

HI All,

 

I have been trying to copy an .ini file though intune to C:\Users\%username%\AppData\Roaming\pyRevit 

 

I have decided to go with PowerShell and below is the following script

 

New-item -itemtype directory -force -path $env:APPDATA\pyRevit

Copy-item -path "$psscriptroot\pyRevit_config.ini" -Destination $env:APPDATA\pyRevit

Return 0

 

below is my Install command in intune

 

powershell.exe -executionpolicy Bypass .\CopyFiles.ps1

 

Now this works outside of intune but I can not get it to work with intune if anyone could help me i would be appreciative 

 

Regards

Brendan 

 

 

  • Brendansmith's avatar
    Brendansmith
    Jun 16, 2022

    @

     

    I figured it out in the program it has to be set to user

     

  • Hey Brendan,
    did you activate the option "Run this script using the logged on credentials"?
      • Jannik_Reinhard's avatar
        Jannik_Reinhard
        Iron Contributor

        Okay sorry I understood that this is a Powershell script not a win32 app. Did you set the install behaviour to the user or to the system?

Resources