• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Troubleshooting Scheduled Task with PS1 on Intune Laptop

Posted on January 23, 2023

A user encountered an issue pushing a PS1 to a remote Intune laptop to create a scheduled task. Suggestions to include code to set the output encoding to ensure non-ASCII characters are captured, and to set the principal for the task to run as system were offered. The user ultimately found success in adding code to set the principal for the task.


Read the entire ‘Troubleshooting Scheduled Task with PS1 on Intune Laptop’ thread below:

Running into an issue trying to push a PS1 to a remote Intune laptop to create a scheduled task with the following error. I am able to run the script locally as long as i set the execution policy to bypass first….i tried throwing that in the script but no luck


Not sure if it will fix it but almost all PS1 scripts in Edge start with the following code.

Set output encoding to ensure non-ASCII characters are captured

[Console]::OutputEncoding = [System.Text.Encoding]::UTF8


i’ll give it a shot! i’m having a similar issue trying to run a start-process script to call an existing exe and its saying the file doesnt exist

damn no luck….i already had that at the beginning


I got nothing… lol. Maybe one of the Powershell wizards can chime in.


no problem! thanks anyways! ya if i run the same command locally it works fine but through Edge DX as a script no luck


Running it in the user context?


custom – system


Can it run as custom – user?

And if you run powershell as system using psexec does it work?


unfortunately not……users of these laptops are not admins (intune autopilot devices) so has to be system


I’d manually test powershell.exe as system by using psexec and see if your code works.


yup that seems to work fine

looks like i just needed to add this to the script so it knew which context to run as $TaskPrincipal = New-ScheduledTaskPrincipal “System”

and then call that of course in the register command


@member From your script it seems it could not reed the account info when trying to schedule the task?


yup thats what it ended up being…..i had to set the principal for the task so it knew to run as system! after that it works great

Continue reading and comment on the thread ‘Troubleshooting Scheduled Task with PS1 on Intune Laptop’.  Not a member? Join Here!


Categories: All Archives, ControlUp for Desktops, ControlUp Scripts & Triggers
Topics: Microsoft Intune, Physical Desktops, PowerShell, Scripts

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..