Results 1 to 9 of 9
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,435
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts

    Windows Security Model

    Hey Y'all,

    I've been frustrated by this for a while and I think I've finally figured out what is going on but I don't like it one bit!

    Setup: I run with Administrator accounts (don't bother I know) with UAC on.

    I've been in the habit of creating Scheduled Tasks for items that I want to Run as Admin so I don't have to bother with the privilege elevation prompt. I create a shortcut to the Scheduled Task and just click on my shortcut (I have a whole menu system of them).

    Well along comes Win 10 Insiders Preview and I don't want to run with a MS account but I need it to get updates. So I thought I'll create a Local User account and boot to that and just flip over the the MS account when I want to check for updates and apply them.

    But of course while on the MS account side none of my menu items will work because the Scheduled Tasks are tied to the Local Account. What to do....? Well, I thought I'll setup the tasks to run from the Administrators group and place both the Local Account & MS Account logins in the Administrators group and all will be well, or so I thought.

    The tasks run just fine from within the Task Scheduler using the Run on Demand feature. However they will not run from the shortcuts! ... Of course they will run from the shortcuts if I run the Shortcut AsAdmin defeating the whole purpose of avoiding the Elevation Prompts in the first place.

    Am I missing something?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #2
    jwoods
    Guest
    See if Run with highest privileges is checked for the task.

    The location of the item for the shortcut should look like this...

    schtasks /run /tn “TASKNAMEINQUOTES”

    Courtesy of How-To Geek.

  3. #3
    Administrator
    Join Date
    Mar 2001
    Location
    St Louis, Missouri, USA
    Posts
    23,584
    Thanks
    5
    Thanked 1,059 Times in 928 Posts
    Do you have the tasks set to run only when the user is logged in?

    Maybe more details about General, triggers, security would help.

    Joe

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,435
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    jwoods,

    Duh! Did you read the post? The tasks would never had worked if they weren't set up like that.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    jwoods
    Guest
    Quote Originally Posted by RetiredGeek View Post
    jwoods,

    Duh! Did you read the post? The tasks would never had worked if they weren't set up like that.
    No need to get sarcastic Retired Geek...just covering the bases.

    Others who are "less knowledgeable than you" may not know how to do it.

  6. #6
    Super Moderator
    Join Date
    Jun 2011
    Location
    New England
    Posts
    4,748
    Thanks
    171
    Thanked 649 Times in 572 Posts
    Seems like a lot of work just to avoid an occasional extra click.

    But if it helps, why not run Insider Preview with an MS account?

  7. #7
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,435
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Bruce,

    Because I'm just a bit...
    CrazyHomer.gif
    Click on Picture.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  8. #8
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,435
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Quote Originally Posted by JoeP517 View Post
    Do you have the tasks set to run only when the user is logged in?

    Maybe more details about General, triggers, security would help.

    Joe
    Joe,

    Yes they are set to run only if logged in. When I set it to Administrators that option is greyed out.

    These have no triggers just Run on Demand. All the laptop/battery restrictions are turned off.

    Here's the XML export of one of the tasks:
    Code:
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Author>DELLXPS14Z\Bruce</Author>
        <Description>No Description Supplied</Description>
        <URI>\PowerShell ISE 64Bit as Admin</URI>
      </RegistrationInfo>
      <Triggers />
      <Principals>
        <Principal id="Author">
          <GroupId>S-1-5-32-544</GroupId>
          <RunLevel>HighestAvailable</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>false</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>false</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>"C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe"</Command>
          <Arguments>""</Arguments>
        </Exec>
      </Actions>
    </Task>
    Remember the task does work if run from the Task Scheduler but NOT from the Shortcut! Of course it runs fine from the shortcut if the Task is set to my UserId vs Administrators.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  9. #9
    Silver Lounger wavy's Avatar
    Join Date
    Dec 2009
    Location
    ny
    Posts
    2,377
    Thanks
    235
    Thanked 147 Times in 136 Posts
    Good likeness!
    David

    Just because you don't know where you are going doesn't mean any road will get you there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •