PowerShell in Intune - How to Copy file(s) (1/3)

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 76

  • @XianLi-m1z
    @XianLi-m1z ปีที่แล้ว +4

    I am a sysadmin and I must say this is an excellent tutorial on TH-cam, Big thanks and please keep making more video like this!

  • @tyleroconnellt
    @tyleroconnellt ปีที่แล้ว +2

    The faster the better! :) Thank you for creating this videos, they are perfect! :)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      Thank you so much for this nice comment, more videos are coming :)

  • @rashkaViking
    @rashkaViking 2 ปีที่แล้ว +3

    Hi Sir!
    Once again, good content and explained easily. I always learn new things from your tutorials.
    Keep the good job!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว +1

      Thanks @Abdirashid Muhammed for that comment, makes me happy to hear, and the purpose of these videos.

  • @SalissouMayanaAbdoulAziz
    @SalissouMayanaAbdoulAziz ปีที่แล้ว +2

    Excellent video.... Thanks a lot!

  • @Andy_h123
    @Andy_h123 2 ปีที่แล้ว +1

    Thank you so much for responding to my comment and creating this video.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว +1

      @Aniket Chavda, cool you noticed and good question, happy it could be answered with a video :) CMTrace is nearly a must for us who troubleshoot and read Intune logs, thanks a lot for your comment

  • @sangoku2007
    @sangoku2007 ปีที่แล้ว +1

    Thank you very much! Great! I only adapted the copy to environment variables.

  • @ibrahimabdeltawab6418
    @ibrahimabdeltawab6418 ปีที่แล้ว +1

    It’s so informative! Thanks so much

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว

      Thanks you so much for your comment Ibrahim, happy it helps

  • @3143iamsam
    @3143iamsam 2 ปีที่แล้ว +1

    As always great content John! Thank you!

  • @evanwolliston5791
    @evanwolliston5791 6 หลายเดือนก่อน +2

    Awesome tutorial. Thanks.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  6 หลายเดือนก่อน

      Thanks a lot, love to read comments like this one, thanks again

  • @shankhan-xm1yp
    @shankhan-xm1yp 5 หลายเดือนก่อน +2

    Hi another great video. Could you please do one video on network printer deployment through powershell in intune.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  5 หลายเดือนก่อน

      Thanks! would that be printers on-prem, such as \\server\print01 installation?

    • @boyoscar10
      @boyoscar10 2 หลายเดือนก่อน

      @shankhan-xm1yp That will be a good video for network printers. I'm been searching for that (add a printer from a printer server) but I been having a lot of issues trying to add one) Also, Here in our company already have some bat that install network printers but the hard part is that it always asked for admin credentials (install print driver)

  • @adkhan123456
    @adkhan123456 ปีที่แล้ว +1

    Love this video !!. Thanks.

  • @XwolfBane18
    @XwolfBane18 2 ปีที่แล้ว +1

    Great video will follow along on my own intune tenant :)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว +1

      Thanks a lot, so cool you got your own Intune tenant and can follow along :)

  • @ecuasteelo
    @ecuasteelo ปีที่แล้ว +1

    Great video thank you. Question, how do you become aware of all the features available for Intune and products. Are there some resources that you are able to share that I can reference?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      Hi Steevo! thank you so much, some I find while doing my work, which I like the most since I know those could be useful for others. Then I always check what is new in Intune (also a link there showing what is in Development) to follow and see what is coming :)
      learn.microsoft.com/en-us/mem/intune/fundamentals/whats-new

    • @ecuasteelo
      @ecuasteelo ปีที่แล้ว +1

      @@IntuneVitaDoctrina Thank you for sharing. I'm always amazed on how you and other content creators in this space are always quick to new features that are released and create content for it immediately. Much appreciated.

  • @ashwinikumarsccm307
    @ashwinikumarsccm307 ปีที่แล้ว +2

    Very good video

  • @vaigandlakiran
    @vaigandlakiran ปีที่แล้ว +1

    its easy to understand thank you for the excellent content. quick info. can we also deploy Multiple pdf file using Intune

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      Yes you can! thanks for posting.
      You have to add all the PDFs in the package source and then change the command to copy all files instead.

    • @vaigandlakiran
      @vaigandlakiran ปีที่แล้ว +1

      @@IntuneVitaDoctrinaThank you I will try the scrip now.

    • @fedemazza9928
      @fedemazza9928 4 หลายเดือนก่อน +1

      @@IntuneVitaDoctrina
      Hello, your videos are very helpful to me, can I ask you what should be modified to copy everything that is in the source directory? Or, if not the other alternative, would it be like adding more files? Thank you very much from Argentina.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  4 หลายเดือนก่อน

      @@fedemazza9928 thank you so much (cool from Argentina, Messi land! :) ), if you wanted to copy ALL from the source directory, you can just change it to a wildcard, * or as you mentioned add one line per file. If you use wildcard it looks like this (but it will copy the ps1 file also, so if only images you can change to like *.png instead):
      $JBNScriptRoot = Split-Path -Path $MyInvocation.MyCommand.Path
      $JBNCMtraceDir = "C:\Program Files\CMtrace"
      if (!(Test-Path -Path $JBNCMtraceDir)) {
      New-Item -ItemType Directory -Path $JBNCMtraceDir
      }
      Copy-Item -Path "$JBNScriptRoot\*" -Destination $JBNCMtraceDir -Recurse

  • @boyoscar10
    @boyoscar10 2 หลายเดือนก่อน +1

    Hello!,
    Great video, i just have a question related with the Path where you want to copy the file or files.
    If this path needs to be copy in a User folder, Example: (C:\Users\X\Appdata\Roaming) where x is the name of the user, what is the best variable for that? and also in the detection rules?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 หลายเดือนก่อน

      Hi, that is an excellent question, since we are in Powershell lets use this one:
      $JBNRoamingAppData = [System.Environment]::GetFolderPath('ApplicationData')
      Then you have a variable that goes to C:\Users\X\Appdata\Roaming, just remember that now you must run the script as USER and NOT as SYSTEM, and you will be fine

    • @boyoscar10
      @boyoscar10 2 หลายเดือนก่อน +1

      @@IntuneVitaDoctrina Can you show me an example (using the path that i showed you?)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 หลายเดือนก่อน

      if the path is under Roaming, the user profile, maybe a sub folder called Microsoft or Office, then just append that to the variable
      $JBNRoamingAppData = [System.Environment]::GetFolderPath('ApplicationData')
      then the path to the place be $JBNRoamingAppData\Microsoft $JBNRoamingAppData\Office

  • @ml7137
    @ml7137 2 ปีที่แล้ว +1

    Hello, very nice tutorials. Is it possible to copy it directly in a directory without going in the company portal ?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว +1

      Hi @M L, yes, so during Assignment, instead of choosing "Available for enrolled devices" (which goes to Company Portal) you add devices to "Required" and also click on it and hide notification, users are rarely interested in knowing those things.

    • @ml7137
      @ml7137 2 ปีที่แล้ว +1

      @@IntuneVitaDoctrina Ok thanks you i'm going to test it ;)

    • @ml7137
      @ml7137 2 ปีที่แล้ว +1

      @@IntuneVitaDoctrina very nice channel btw it helped me a lot during my practice ;)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว

      very very happy to hear, thanks a lot :)

  • @texddiaz
    @texddiaz ปีที่แล้ว

    thanks for share !! :D

  • @JustFixItGoldCoast
    @JustFixItGoldCoast ปีที่แล้ว +1

    Did I miss the sfc video?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      SFC /Scannow, the System File Checker is in the following video 2/3:
      th-cam.com/video/zzwirfPNZHw/w-d-xo.html&ab_channel=Intune%26VitaDoctrina
      We create a script that create a scheduled task that runs SFC on a regular basis

  • @jojoka74
    @jojoka74 2 หลายเดือนก่อน +1

    I got error when I install on computer from company portal. Where can I find error ?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 หลายเดือนก่อน

      Hi, sad to hear you getting errors, since we package this as a Win32 app, I would troubleshoot the logs for that, got a video for that also :)
      th-cam.com/play/PL1JNh3sw_Qyd0tNx3zwXaG7LamwAvYv3N.html

  • @TanuchiSacin
    @TanuchiSacin 4 หลายเดือนก่อน +1

    I have a question.. is there a way to copy a file located in a Sharepoint hub?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  4 หลายเดือนก่อน

      since the script runs as SYSTEM it got no permission in SharePoint.
      Could be done without Win32 app, and do it only by script alone and use MS Graph to copy from SharePoint.
      You would need an access key and all that setup to use in the script and then use this MS Graph:
      learn.microsoft.com/en-us/graph/api/driveitem-copy?view=graph-rest-1.0&tabs=http

  • @jamesjames601
    @jamesjames601 28 วันที่ผ่านมา +1

    It looks easy but I cannot get it to work, always failed on me. The PS script works locally but it does not work with Intune

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  28 วันที่ผ่านมา

      I would guess it is due to the source of the file. When you run it locally it pick it from a static path but when running in Win32 it has a relative path to the package.
      If you have ALL the files (not the intunewin file) source files and can zip it and share with me, then I can do a video about it and correct it, you get a solution just for you, I get material for a video :)
      if you use a FTP or hosting site or if you can zip it and make it work through email service then please send to john.bryntze@gmail.com

  • @kenlang930
    @kenlang930 ปีที่แล้ว +1

    If you needed to copy a file from a specific location on each InTune device, where would you store these files?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว

      Interesting, so you want to collect files FROM the Intune clients, so the opposite direction?
      You can run a PowerShell script that copy the file and then you need a storage, which is your question basically, you can store it on SharePoint Online as long as you give the script permission there, or Azure Storage.
      Could be a future video, but for now this link got solutions for it:
      www.systanddeploy.com/2021/02/intune-troubleshooting-collect-remotely.html

    • @kenlang930
      @kenlang930 ปีที่แล้ว +1

      @@IntuneVitaDoctrina I have an application that collects data from each device to a standard location on each device. Then I need to collect this data to run some reports. You had mentioned storing these files on SharePoint which looks to be to be the better option. I'll review your suggested video. And thanks!

  • @marvnl
    @marvnl ปีที่แล้ว +1

    Can you also make a video on how to deploy app using winget with powershell scripts? For me it is not working, but maybe it is not possible. I wrote a script that first downloads the latest winget if not installed already, then it installs an app with winget command in the script. Then I deployed it as win32 app (packaged only the ps1 script. But maybe I am missing something so I am wondering how you would do this. If it works, we can then simply install all apps on winget and update then with remediation scripts as well and the app ID for it would then always be the same between install en remediation. perfect automation I would say :)

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      Hi M. Dff, I got a video doing that already: th-cam.com/video/MnFL2FQLjp4/w-d-xo.html
      I use it a lot at my work.
      I already assume winget is on the device. A tricky part which is mention in the video I link is that SYSTEM (the account that Intune installs with) cannot find winget.exe by just simply call winget.exe, you must give the full path to it and since it got a version number you cannot hardcode it.
      If it is ONLY a PS1 script calling winget.exe you don't even have to package it as a win32 app (but you can do) I do a lot of updates with Proactive Remediation scripts (got a video about that also: th-cam.com/video/ea0g1Y1zaek/w-d-xo.html)
      long answer, but 100% you can Win32 app package just a PS1 script calling winget.exe and install :) (watch out for detection script as you will have to call winget.exe there also to verify if locally installed is same version as online winget version for it to be a success)

    • @marvnl
      @marvnl ปีที่แล้ว +1

      @@IntuneVitaDoctrina aah perfect!! Many thanks again ;). It worked for me!
      And now, here is another idea. I am still fighting with it a little, but say a users has a windows device swap, in the app store I want to let him select ''SwapLaptop export apps'' so in the background ''winget export -o %userprofile%\Desktop\MyApps.txt'' will run, and on the new laptop he selects in the appstore ''SwapLaptop Import apps'' so command ''winget import -i %userprofile%\Desktop\MyApps.txt'' runs and than the install command.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      I like that idea!
      You could also package all software in Win32 with winget in script, and then deploy to a user AzureAD group, and then add the user (not device) to the group of software user should have.
      Then when user get new device, since you target user the software will follow the user due to the group membership

    • @marvnl
      @marvnl ปีที่แล้ว +1

      @@IntuneVitaDoctrina no, I have setup standard / basic apps everyone should have and assigned it to all users (1400) and all the rest I made available in the company portal. Our company is just to dynamic for department groups. Only when sso apps licenses that are assigned to a user and a package is needed, then it will be assigned to the user, because he is a member of the license group.
      But the laptop swap app is cool for people that installed multiple apps from Company portal already, but have to swap their laptop for some reason. It saves a lot of time. They only have to manually set up the settings again.

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว

      Yeah you need to have three bases of software:
      1. The software you want everyone to have such as anitvirus, office, your communication tools, maybe 7-Zip etc..
      2. Based on job function (often department) and if you can group these users together with an attribute or script with logic and then deploy for example Sales tools to the sales teams etc..
      3. Software you cannot know who will need it or maybe even licensed software, put in Self Service/Company Portal and have as a la carte
      You seems to have more of group 1 and 3 so your idea makes a lot of sense

  • @mohammedtharwat2361
    @mohammedtharwat2361 ปีที่แล้ว +1

    and if i need to update an existing folder ? i have an existing folder and i need to update its content with a new files weekly , is this effective for my situation ?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว

      It would work, is it the best solution I'm not sure. You have to package in Win32 package with the files each time.
      So yes it works, you could also put a schedule task that runs on the devices and download through FTP or alike every week or from AzureAD storage... but yeah do PowerShell copy with Win32 works fine.

  • @joek2904
    @joek2904 หลายเดือนก่อน +1

    How to u force the app to install automatically?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  หลายเดือนก่อน +1

      That is a good question, under Assignment, instead of putting it under available you put it under Required and then it will install automatically to all the devices you target.
      I got a video explaining what each does under Assignment in this video:
      th-cam.com/video/_MUra5Eh6cw/w-d-xo.html

    • @joek2904
      @joek2904 หลายเดือนก่อน +1

      @@IntuneVitaDoctrina wow thanks for the fast reply. i will look into this asap!!!

    • @joek2904
      @joek2904 หลายเดือนก่อน +1

      @@IntuneVitaDoctrina I see it now. thank you!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  หลายเดือนก่อน

      Well done!

  • @crunchraven000
    @crunchraven000 ปีที่แล้ว +1

    is there anyway i can upload a .intunewin file to intune via a http call?i need to automate the procedure

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว +1

      Not done it myself, but there are PowerShell cmdlets that does the upload automated, such as add-IntuneWin32app, and it has to be HTTP based. Need to include Authentication so probably pretty much to do, but possible, read here:
      github.com/MSEndpointMgr/IntuneWin32App

    • @crunchraven000
      @crunchraven000 ปีที่แล้ว +1

      @@IntuneVitaDoctrina thank you very much for your instant anwer..i have tried and succeeded the authentication, yet the only api tha i have found, expects json so i cannot upload an msi or .intunewin file to intune through http call..i dont know where to look

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  ปีที่แล้ว

      impressive work you have done, hat off, sorry I cannot help more.. yeah .intunewin file in json format is not possible ;)

  • @MrArijitslg1
    @MrArijitslg1 2 ปีที่แล้ว +1

    I am not good in Powershell. So wanted to know if there is any reason why you used "-Path $MyInvocation.MyCommand.Path" instead of the actual path such as "c:\intunewin32\"? In what scenarios should we use this?

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  2 ปีที่แล้ว

      @AriJandro very good question. The reason why using a relative path such as "-Path $MyInvocation.MyCommand.Path" is only because we later in the video deploy this with Intune in a .intunewin file and then it later be downloaded to clients through the cloud.. and there we do not know the path, it is where Intune cache it so we cannot hard code it, so we do a dynamic path, hope that makes sense

  • @Charles-w2f3x
    @Charles-w2f3x หลายเดือนก่อน +1

    I am trying to my script to copy the file but atm it is only creating the folder and NOT copying the file....
    # variables
    $ScriptRoot = Split-Path - Path $MyInvocation.MyCommand.Path
    $XeroxDir = "c:\Xerox"
    if(!(test-path -Path $XeroxDir))
    {
    New-Item -ItemType Directory -Path $XeroxDir
    }
    copy-item $ScriptRoot\XSS_2034.exe -Destination $XeroxDir
    It keeps telling me the file or location doesnt exist even though I'm running it out of that location HELP!!!!

    • @IntuneVitaDoctrina
      @IntuneVitaDoctrina  หลายเดือนก่อน

      Your script looks good, when you run IntuneWinAppUtil.exe to create your .intunewin file, are you sure XSS_2034.exe is in the root of that one? do you use a Source folder and you specify that as the source? so you don't have an extra folder between your ScriptRoot and the actual file?