Це відео не доступне.
Перепрошуємо.

S01E17 - Intune PowerShell Scripts - Debugging and Troubleshooting - (I.T)

Поділитися
Вставка
  • Опубліковано 8 сер 2024
  • 00:00 - Intro
    00:32 - Ben Reader's introduction
    01:42 - S01E12 - How to Deploy PowerShell Scripts using Microsoft Intune
    • S01E12 - How to Deploy...
    02:29 - Why you should be logging in your code
    18:01 - Basic PowerShell Script logging
    42:16 - Wrapping up
    Visit our websites and social media for more or to get in touch with us
    Steve Hosking - Microsoft EM+S MVP
    / onpremcloudguy
    steven.hosking.com.au/
    mvp.microsoft.com/en-us/Publi...
    github.com/onpremcloudguy
    Adam Gross
    / adamgrosstx
    www.asquaredozen.com
    mvp.microsoft.com/en-us/Publi...
    github.com/AdamGrossTX
    Ben Reader
    / powers_hell
    www.powers-hell.com/
    github.com/tabs-not-spaces Visit our websites and social media for more or to get in touch with us

КОМЕНТАРІ • 28

  • @michaelwaterman3553
    @michaelwaterman3553 4 роки тому +3

    Nice addition to my knowledge on Powershell! Never seen the transcript option before. Cool and useful stuff. Thanksssss

  • @jamesd2654
    @jamesd2654 2 роки тому

    Learned more about Intune and improved by PowerShell knowledge as a bonus.

  • @shakeelspare7861
    @shakeelspare7861 4 роки тому +3

    You guys are doing awesome work. Very much appreciated.

  • @lltagged
    @lltagged 3 роки тому

    Cool stuff! Thanks for the vid. Greatly enjoying your series.

  • @leonogun100
    @leonogun100 4 роки тому +3

    Thanks Adam/Steve/Ben this is really useful content....much appreciated...could you guys cover App Protection Policies please , if you haven't already done so.

  • @michaelvandensteen7994
    @michaelvandensteen7994 3 роки тому

    This is super helpful. Thanks a lot both of you!

  • @jimcopeland4011
    @jimcopeland4011 4 роки тому +1

    So if I want to know why my script isn't working, I have to add a whole debug script to the script? Great job Microsoft...
    Also, I don't understand. What was changed in Event Viewer to get the log file to generate? I'm unable to replicate these steps. Not even getting the folder to appear, but Intune says the script was run on the client.

  • @aktarhussain2777
    @aktarhussain2777 4 роки тому +1

    Hi, If a PowerShell script has successfully ran on a machine and then it requires a Reset of the device. Would the script run again?

  • @priyanka6666
    @priyanka6666 2 роки тому

    Thanks for the information. Is there a limit to the no of try the script would attempt on the device. The documentation says 3 but i am seeing it attempting on every check in.

    • @IntuneTraining
      @IntuneTraining  2 роки тому

      It's between 3 and 5 attempts. But you should be using Proactive Remediations moving forward.
      - Ben

  • @nitramremoeb4674
    @nitramremoeb4674 4 роки тому

    Hi, i've written some very small scripts running per intune without any problem but the overview shows me that the scripts run into failure. How can i tell intune that the script does it'äs job and run sucessfull?

    • @IntuneTraining
      @IntuneTraining  2 роки тому

      Put your code inside of try / catch blocks and create some transcript logging.
      If *your* script is failing, *you* need to write the code to tell you why it's failing.
      - Ben

  • @pratham0613
    @pratham0613 2 роки тому

    How intune determines successful execution of powershell script ? is it based on exit code 0 for script execution ?

    • @IntuneTraining
      @IntuneTraining  2 роки тому

      Correct. Standard exit of 0 means no errors caused the PowerShell process to bomb out.
      - Ben

  • @seanstephen6082
    @seanstephen6082 Рік тому

    Hi Guys,
    Needing a bit of help. Been using InTune for a while. Getting on reasonably well. Watched a lot of your videos when I first started on it (working for a smaller company so was the one giving the mdm a go!)
    I simply cannot get powershell scripts to work via intune. I''ve managed it for MAC's without a problem (intune and macs... :|)
    I've tried going back to basics - "New-Item -Path 'C:\PowerShellTestFolder' -ItemType Directory". Works locally but cannot deploy from Intune to the same device it worked locally. It shows on the admin console as "Device Status" etc as 0. Its just not finding the device.
    As its such a low risk script I tried pushing it across a wider security group of about 10 devices and it picked up and worked for 1 device of those. What am i missing? I presume theres something stopping it being unable to pick up the devices. The reason I wonder if its this is the device that it did work on is s "BYOD" device so the owner may have certain config on there that allows the scripting to run!
    Fairly confident i tick the prerequisites docs.microsoft.com/en-us/mem/intune/apps/intune-management-extension
    I've had a dig through in Administrative Templates Windows Components > Windows PowerShell as well to see if theres any config in there that would allow the scripting to run but no luck with those either.
    There's nothing in any of the logs etc to indicate the script as even tried to run. I've goggled the issue repeatedly as well and can see others have had the same issue but no real resolution :(
    Any guidance at all for tips on where to look, settings to try/check/play around with. Articles to read, videos to watch all appreciated.

  • @jplewis1452
    @jplewis1452 3 роки тому

    Hi team. I have scripts that say successful via intune however when I look at the machine the registry change didn't happen. Any thoughts

    • @IntuneTraining
      @IntuneTraining  3 роки тому

      The script probably ran, didn't do what you expected it would, but didn't outright fail (returning an exit code of 0 means success, regardless of what the script achieved).
      Run the script manually - use PSTools to validate the experience as system if required. Add logging to the solution and review where it's failing.
      -- Ben

  • @FerYop
    @FerYop 2 роки тому

    Is it possible to deploy PowerShell scripts through Intune that calls a CSV file "not stored in the target computer"? I have a long CSV file I'm using as for my input and further comparing against some queries. So building a huge array in the script is not an option. Very nice material guys!

    • @IntuneTraining
      @IntuneTraining  2 роки тому +1

      You can deploy the content embedded in the script body, or you can use Azure Blob storage, network file share, Win32 app, etc. If you store on a share, you’ll have to handle Auth - AADJ machines won’t be able to Auth to the share - only the user account, so you’ll have to work that into your plan.

    • @FerYop
      @FerYop 2 роки тому

      @@IntuneTraining thanks! I got to managed it through Win32 app but the Azure Blob storage approach sounds much better to me. Thanks once again!

  • @kimblecountylibrary5923
    @kimblecountylibrary5923 2 роки тому

    Ben or Adam (or both), recommended PowerShell learning resources for someone that's wanting to learn?

    • @IntuneTraining
      @IntuneTraining  2 роки тому

      This book is a great resource to get you going. www.amazon.com/Learn-Windows-PowerShell-Month-Lunches/dp/1617294160

  • @skullmore101
    @skullmore101 2 роки тому

    Audio is really annoying, but thanks for the info