Forum Discussion

AB21805's avatar
AB21805
Bronze Contributor
Apr 21, 2021

Creating a folder containing multiple files and sending to devices via intune

Hi all, 

 

I desperately need some help! And just thought Id post on here to see if someone can help! I need to create a folder on client machines in the c drive (Folder name: Spanish Games) which I then deploy a bunch of files to this folder I create 

 

I have had a look and seems like I need to create a win32 app container with all in, script and files. 

 

What would I need to include in the script to get this to work? I have had a look at docs online but cant find one that deploys a folder and files too. I have found this: https://pariswells.com/blog/intune/copy-file-to-workstations-with-windows-intune but dont really understand some of it. 

 

Any help would be great!! Thanks in advance

  • Hi it would look like this

    c:\intunepackage\
    Inside this folder you need to create a folder "spanishgames"
    Copy everything you have inside this folder
    Create a powershell script (install.ps1) inside the c:\intunepackages\ folder
    Inside the script,

    -first create a new directory where the files need to be copied to (destination)

    New-Item -Path "c:\" -Name "SpanishGames" -ItemType "directory" -force

    -Then create a command to copy everything to the folder you you created

    Copy-Item -Path "spanishgames\*" -Destination "C:\spanishgames" -Recurse -force

    Now we have everything in place... open the intunewinapptool and specify the folder c:\intunepackages and the setup file: install.ps1

    Upload it to intune and specify the c:\spanishgames folder as the detection rule

    That should be it
  • Hi it would look like this

    c:\intunepackage\
    Inside this folder you need to create a folder "spanishgames"
    Copy everything you have inside this folder
    Create a powershell script (install.ps1) inside the c:\intunepackages\ folder
    Inside the script,

    -first create a new directory where the files need to be copied to (destination)

    New-Item -Path "c:\" -Name "SpanishGames" -ItemType "directory" -force

    -Then create a command to copy everything to the folder you you created

    Copy-Item -Path "spanishgames\*" -Destination "C:\spanishgames" -Recurse -force

    Now we have everything in place... open the intunewinapptool and specify the folder c:\intunepackages and the setup file: install.ps1

    Upload it to intune and specify the c:\spanishgames folder as the detection rule

    That should be it
    • motion2082's avatar
      motion2082
      Copper Contributor
      Hi Rudy,

      If I have a ZIP file called Epic.zip (1.4GB) that I want to copy to C:\Temp then Extract on the target machine at C:\Epic would I be able to use this process above?
      • Rudy_Ooms_MVP's avatar
        Rudy_Ooms_MVP
        MVP
        Hi, Yes you could but you need to add a powershell command to extract the zip file...
    • Bapo16's avatar
      Bapo16
      Copper Contributor

      Rudy_Ooms_MVP I tried to follow these steps and i just get a 0x80070001 error in Intune. from my trouble shooting it cant seem to find the files when trying to do the copy. Any ideas if i have missed something?

       
      New-Item -Path "c:\" -Name "AskIT" -ItemType "directory" -force
      Copy-Item -Path "askit\*" -Destination "C:\AskIT" -Recurse -force
       
      Thanks for any help.
      • Hi,

        Did you try to run the copy-item -path askit on the device itself? What happens?
        Looking at the screenshot, could you change the install command to this. (change the scriptname to your scrptname)
        powershell.exe -ExecutionPolicy Bypass -File .\Scriptname.ps1

Resources