locked
Adding Taks Using schtasks.exe in Logon Script Prompts for Password RRS feed

  • Question

  • Hi All,

    I am trying to create a logon script that will run for all domain users to add a defrag task to the task scheduler. The command runs when the users log in, but the problem I'm having is that it asks them to input a password before the entry is created. What I'd like is for the scheduled task to run without prompting the user for a password. The command that I'm issuing is shown below. I'm running Windows Server 2003 with a mixture of XP, Vista and Windows 7 clients. Can anyone offer any suggestions?

    schtasks.exe /create /sc monthly /D 1 /TN MonthlyDefrag /tr "C:\Windows\System32\defrag.exe\”C: -f” /st 00:45:00 /sd 06/01/2009 /ru "SYSTEM"

    Tuesday, June 29, 2010 10:10 PM

Answers

  • Hi Kvanderstarren,

     

    Thank you for posting in Windows Server Forum.

     

    Based on your description, I understand that you want to run defrag scheduled task on your clients without entering the user password.

     

    Generally speaking, you can use the scheduled task extension in the Group policy preference to deploy the defrag tasks.

     

    To deploy Scheduled Task GPP for all users, you can follow the below steps:

     

    1.     Logon the DC as an Domain Admin, open the Group policy management.

    2.     Create a GPO links to your server’s OU.

    3.     Edit the GPO and navigate to [Computer Configuration| Preferences| Control Panel Settings| Scheduled Tasks]

    4.     Create the Scheduled Task which you want to run. You may need to change the Action to Create for the first setup.

    5.     Define all Scheduled Task settings. Click Apply and OK.

    6.     Logon the client computer as administrator, then click start and run “gpupdate /force”

     

    After above configuration, the client computer should be have the Scheduled Task for all users.

     

    If your DC is not Windows 2008 server, you can configure a Group Policy preference item in a Windows Server 2003 environment from either a Windows Server 2008 server or a Windows Vista with Service Pack 1 client with RSAT update installed. If you do not have Windows Server 2008 server, you can download and install Remote Server Administration Tools on Windows Vista with SP1 on a Vista client to manage and configure them. To start to deploy printer to your client, they need the Group Policy Preference Client Side Extensions.

     

    XP GPP’s CSE

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en

    Vista GPP’s CSE

    http://www.microsoft.com/downloads/details.aspx?FamilyID=ab60dc87-884c-46d5-82cd-f3c299dac7cc&displaylang=en

     

    Hope it helps.

     

    Wilson Jia

     

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com

     


    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Wilson Jia Thursday, July 8, 2010 7:28 AM
    Wednesday, June 30, 2010 2:55 AM

All replies

  • Hi Kvanderstarren,

     

    Thank you for posting in Windows Server Forum.

     

    Based on your description, I understand that you want to run defrag scheduled task on your clients without entering the user password.

     

    Generally speaking, you can use the scheduled task extension in the Group policy preference to deploy the defrag tasks.

     

    To deploy Scheduled Task GPP for all users, you can follow the below steps:

     

    1.     Logon the DC as an Domain Admin, open the Group policy management.

    2.     Create a GPO links to your server’s OU.

    3.     Edit the GPO and navigate to [Computer Configuration| Preferences| Control Panel Settings| Scheduled Tasks]

    4.     Create the Scheduled Task which you want to run. You may need to change the Action to Create for the first setup.

    5.     Define all Scheduled Task settings. Click Apply and OK.

    6.     Logon the client computer as administrator, then click start and run “gpupdate /force”

     

    After above configuration, the client computer should be have the Scheduled Task for all users.

     

    If your DC is not Windows 2008 server, you can configure a Group Policy preference item in a Windows Server 2003 environment from either a Windows Server 2008 server or a Windows Vista with Service Pack 1 client with RSAT update installed. If you do not have Windows Server 2008 server, you can download and install Remote Server Administration Tools on Windows Vista with SP1 on a Vista client to manage and configure them. To start to deploy printer to your client, they need the Group Policy Preference Client Side Extensions.

     

    XP GPP’s CSE

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en

    Vista GPP’s CSE

    http://www.microsoft.com/downloads/details.aspx?FamilyID=ab60dc87-884c-46d5-82cd-f3c299dac7cc&displaylang=en

     

    Hope it helps.

     

    Wilson Jia

     

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com

     


    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    • Marked as answer by Wilson Jia Thursday, July 8, 2010 7:28 AM
    Wednesday, June 30, 2010 2:55 AM
  • Hi,

    Any updates?

    Regards,

    Wilson Jia


    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
    Monday, July 5, 2010 6:49 AM