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=f6fLBEcoVeeyCwIjZ2sAp/S8OQxLv
	YFqINh776B+jq0E6xVMT7S+KtV8ptSq5GCIFtYt0QpeczkWq+H9v+v37Z5RRqjKy
	/kdYng9OhcFM7C3qV58WeXrmTeil45n62YKg0hXGwfsm4KVaeUCrvcWXWaYmV+g5
	mLSwHNNG5Ky9Nk=
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=fRe2xzJadLGwIcEV+mZwfIsL7AM=; b=gRz
	0aoQv9B8XMZZVLJ1XgxB3LMsGK72Ub/AUJZhb1022V+vN0oU/NmPVmrclQrpNw9e
	aou0H0c7OX2NEs8/UWnAG0pQBcsMcEGmZXsGZCMeaTxDTXAdTywEwoEYdIQgesMs
	8fd9M+CFG3MLnKqOBANUJrZWKFMwIylD6l6q1sPk=
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=-0.7 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=exchanged, dan, Network, Command
X-HELO: esa7.dell-outbound.iphmx.com
From: "Gluszczak, Glenn" <Glenn.Gluszczak@dell.com>
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd52.lss.emc.com v9AElqfg021397
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd52.lss.emc.com v9AElqfg021397
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 14:47:31 +0000
Message-ID: <91DCAC3CB99C724EB365BB64677FBE7B1EFC1B60@MX204CL04.corp.emc.com>
References: <513AA0729B894545B2D793D01FFF8B6D4719B909@SVNSBIOMBX01.ENT.dfo-mpo.ca>
In-Reply-To: <513AA0729B894545B2D793D01FFF8B6D4719B909@SVNSBIOMBX01.ENT.dfo-mpo.ca>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
X-Sentrion-Hostname: mailusrhubprd51.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 v9AEmlgf006037

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


