Query scheduled task on a remote computer with windows 2019

Xavi Sanchez (IT Technician) 0 Reputation points
2024-04-11T13:41:39.3633333+00:00

We are trying to run and query scheduled task fro a remote machine in Windows 2016 to windows 2019. This is not working properly as it only returns tasks created with 2003 version.

Windows for business Windows Server User experience Other
{count} votes

2 answers

Sort by: Most helpful
  1. Marcin Policht 49,640 Reputation points MVP Volunteer Moderator
    2024-04-11T14:29:23.5233333+00:00

    Try the following:

    $ComputerName = "RemoteComputerName"
    $Credential = Get-Credential  # Enter credentials for accessing the remote computer
    $CimSession = New-CimSession -ComputerName $ComputerName -Credential $Credential
    # Query scheduled tasks
    Get-ScheduledTask -CimSession $CimSession
    # Close the remote session
    Remove-CimSession -CimSession $CimSession
    

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

  2. Anonymous
    2024-04-12T03:18:10.09+00:00

    Hi Xavi Sanchez (IT Technician),

    How did you query the scheduled tasks on remote computers? And how did you tell the returns tasks are created with Windows Server 2003?

    To connect to remote computers, you can either select "Action" > "Connect to Another Computer" in the mmc snap-in Task Scheduler or run a PowerShell script that gets the tasks in a remote session.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.