Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

Use PowerShell to configure Scheduled Task to include 'Configure For' and Description

I have created a Scheduled Task with Powershell 4.0.  I am utilizing a gMSA account to run the Scheduled Task.  The Scheduled Task runs fine.  However, I'd like to add a description and possibly change the 'Configure for' parameter from 'Windows 7, Windows Server 2008 R2' to 'Windows Server 2012 R2'.  Since I'm using a gMSA I cannot do this from the the Task Scheduler app, it must be done via powershell.  After much searching the internet I haven't found a solution for either of these.  The servers are vm's running 2012 R2.  Is there a way of doing this either when creating the scheduled task or after the Scheduled Task has been created?
0
BigmacMc
Asked:
BigmacMc
1 Solution
 
Lionel MMSmall Business IT ConsultantCommented:
Did you try looking on this site-sorry only help I can give. http://blogs.technet.com/b/heyscriptingguy/
0
 
QlemoC++ DeveloperCommented:
I assume you are using the new cmdlets only working with PS4 and W8+.
Then you have to create a configuration setting with
$s = New-ScheduledTaskSettingsSet -Compatibility Win8

Open in new window

and feed that in e.g.
New-ScheduledTask ... -Settings $s -Description 'Blabla'

Open in new window

0
 
BigmacMcAuthor Commented:
Sorry it took so long to get back to this.  This worked fine.  Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now