X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=YANmPa/eLqohdC3r IY1Mn2kE0sxgcEatec4cJ+fC3LIdnmOYkCIne8r8fjh9SgSYKFBA3bIMFj4/u7o9 IZbqiPr+K2w6hM9PqlMCEwbiT/yPEtocRU/WxY9ysZeWZEY5QqRWSBh86HcowNaw liVIrqvWa2XEdpY/zWLT0aQYKL4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:mime-version:content-type :content-transfer-encoding; s=default; bh=xd9SxVUEwx52v2BuUcaxTP bFh54=; b=blyRlM8OAq3OkhE6QZ9N78n+7c0F1+k+QQzJ7BJcTgYbXW8pkhn7WT jlmfFd+aKnr+OUf9IG+LbkYLNjqgrf4T0ftn1Txhwyk/Pe8Xtv6QwDw42VZVbnX4 /1etryXM4I+1VkoHg7GF9PtHbrnaXoOJtkBlT5pfPPRNYqG4bhkyY= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=BAYES_00,CYGWIN_OWNER_BODY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=Password, boxes, highest, H*c:alternative X-HELO: mx0a-00082601.pphosted.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=facebook; bh=86eeqx7ns5rWKeKpkffoJlkdez2GfkW01j0gOMAj7U0=; b=AU2v89bj3siyMvOL6KgRE8b8Ys12tHeNAAEAdxplhJ6EmUOmT+lNJXtt1N2ds2JCrRRe wfr19ahGS3l/XFRZt5DIqQDiPPp4/4kjtJ7qEenUoY7KOieKCcMALk1RG6BNKZzYlUxD NF0oH/BXjHPeE8NTmEEvrD32FnAjQjnXkqU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=86eeqx7ns5rWKeKpkffoJlkdez2GfkW01j0gOMAj7U0=; b=g4vn1XEuOLZNxH+mQugoOcLmb6NSqJWGMxCxJkOqAbo0BzjRYIL8MI2MJI3JV3cK3svO/gcEA48SRik1/Rr9Q3fGchtnn0r/rIty16x82QKqLYiCDyR69l63b1RI08paB0OAKCXC1uyv5XiQT1Q4excq6bExRRos4h4RfXaoXm4= From: John Oxley To: "cygwin AT cygwin DOT com" Subject: Re: Can't create scheduled task over ssh as current user Date: Tue, 19 Feb 2019 19:27:50 +0000 Message-ID: References: , In-Reply-To: received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Content-Type: text/plain; charset="iso-8859-1" X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x1JJSdAf010597 ________________________________ From: cygwin-owner AT cygwin DOT com on behalf of Bill Stewart Sent: 19 February 2019 19:15 To: cygwin AT cygwin DOT com Subject: Re: Can't create scheduled task over ssh as current user On Tue, Feb 19, 2019 at 12:02 PM John Oxley wrote: >> I'm running a Windows 10 VM with a fairly recent installation of Cygwin (last month or so). >> If I ssh into the box as the user "foo", I cannot create a scheduled task for the user: >> foo AT host $ schtasks /create /ru foo /rp fooPassword /sc HOURLY /tn foobar /tr 'echo foo' >> ERROR: The user name or password is incorrect. > Regarding schtasks: > The /u and /p parameters mean "credentials for the user that has > permission to create a task," not "credentials for the task itself" > (credentials for the task itself are /ru and /rp). They only work for > a remote machine (/s parameter). Yeah, I figured that out. I was trying to use "/s hostname /u foo /p fooPassword" to try and force a remote setup. > With that said: Why do you need to ssh to the machine to create a > task? Just create the task remotely from the machine you're on. In this case I am on a Linux machine. I have a lot of automation setup from Linux boxes to manage the Windows VMs. > I'd recommend PowerShell anyway for more flexibility (New-ScheduledTask, etc.). I started off with PowerShell but re-wrote to schtasks to make this post shorter. Exactly the same thing happens: > Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -RunLevel Highest -User foo -Password $fooPassword Register-ScheduledTask : The user name or password is incorrect. At line:1 char:1 + Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : AuthenticationError: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-Schedule dTask], CimException + FullyQualifiedErrorId : HRESULT 0x8007052e,Register-ScheduledTask -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple