X-Recipient: archive-cygwin@delorie.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:content-type:content-transfer-encoding
	:mime-version; q=dns; s=default; b=w6U+8nZicM6WDLo89DDDDlBHnJCYG
	NDm5VfXo4fBqDdKFItrOGF1Q628gJXmrjW1DVq6/9Q31mJ+ydwIu6U8bkRKomO5l
	V5IU3wxfSV41j1o4Bp7NMh9PYe6/Vd/G4T5B42M515ipdUcrKcN8KPBJIVcXCx54
	pA1JlKb+3pzQ+k=
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:content-type:content-transfer-encoding
	:mime-version; s=default; bh=I441kT4fWiXULQRlJegUQt0a9qY=; b=A1r
	6xfne51QJ0UbaAXTIjKA/6TZC1oVraycIfG7PSUNTshsryXpLLUjNRSzPRNiDSMC
	ZtqYelfIL4tkPniGP7xiaFGLtTgKRLry6lSEJ6uvv8ZneN8M8M+fzvPb5tmkky06
	XXC2CE9/lgOLD/dH8RriMpgUSrr2X8uot1VNFcgE=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: esa6.dell-outbound.iphmx.com
From: "Gluszczak, Glenn" <Glenn.Gluszczak@dell.com>
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com v9AFEb3U010053
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd03.lss.emc.com v9AFEb3U010053
To: "Fournier, Danny G" <Danny.Fournier@dfo-mpo.gc.ca>,
        "cygwin@cygwin.com"	<cygwin@cygwin.com>
Subject: RE: ERROR: A specified logon session does not exist. It may already have been terminated
Date: Tue, 10 Oct 2017 15:14:12 +0000
Message-ID: <91DCAC3CB99C724EB365BB64677FBE7B1EFC1B90@MX204CL04.corp.emc.com>
References: <513AA0729B894545B2D793D01FFF8B6D4719B909@SVNSBIOMBX01.ENT.dfo-mpo.ca> <91DCAC3CB99C724EB365BB64677FBE7B1EFC1B60@MX204CL04.corp.emc.com> <513AA0729B894545B2D793D01FFF8B6D4719B986@SVNSBIOMBX01.ENT.dfo-mpo.ca>
In-Reply-To: <513AA0729B894545B2D793D01FFF8B6D4719B986@SVNSBIOMBX01.ENT.dfo-mpo.ca>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
X-Sentrion-Hostname: mailusrhubprd02.lss.emc.com
X-RSA-Classifications: public
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v9AFF2A4007593

It may still work but you don't see the other terminal window unless you're on the desktop.
To prove, try this command instead.

runas /noprofile /user:orawin\administrator echo hello > a

Then look for the file "a".

I was just wondering if perhaps the issue was due to spawning a separate window.  Might be unrelated.
I've never used schtasks.

-----------------------------------------------------
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see output indicating that I missed required parameters.

Thanks,

Dan


Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

---------------------------------------------------------------------------


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been terminated.

We will also get the same error by simply invoking schtasks.exe without any parameters, which is supposed to list the jobs currently configured on the server.

What we have done:

-Most articles found state to change the following Local Policy to disabled (which was set already):
Network access: Do not allow storage of passwords and credentials for network authentication

-We have also added the user into the following Local Policy: Log on as a batch job and Log on as a service -The user has permission to read and execute schtasks.exe -We regenerated passwd and group files -Command prompts in Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the same issue.

Dan


--
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


--
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


--
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


