Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - markoczy

Pages: [1]
1
If someone faces the same problem in the Future, here's my Workaround: I create a remote Powershell Session by logging in with another user to localhost. The Script runs from the context of a scheduled task executed by the SYSTEM account (i.e. whether any user is logged in or not), the User that creates the remote Session must have administrator rights:

Code: [Select]
#
# Powershell to run EA Tasks on a "remote Session" on the local Computer
# based on: https://www.faqforge.com/windows/create-powershell-session-remote-computer/
#
# Setup Credentials (Replace "MyUsername" and "MyPassword" with user credentials)
$User = "MyUsername"
$PWord = ConvertTo-SecureString -String "MyPassword" -AsPlainText -Force
Enable-PSRemoting -Force
winrm set winrm/config/client  '@{TrustedHosts=""}'
Restart-Service WinRM
Test-WsMan localhost
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
$sess = New-PSSession -Credential $cred -ComputerName localhost
Enter-PSSession $sess
#
# Inside the remote RPC session
# A C# Program which uses EA.Interop.DLL can be executed here
#
Exit-PSSession
Remove-PSSession $sess

2
Thanks a lot for the feedback.

Ok then I will have to find another way, I will definitely file in a feature request.

Best Regards
Aleistar

3
Hello Everyone,

I have read in several other threads (e.g. https://www.sparxsystems.com/forums/smf/index.php/topic,31187.0.html and https://www.sparxsystems.com/forums/smf/index.php?topic=36053.0) that is not possible to start EA over the EA.Interop.DLL without having an active Windows session, however these threads are quite old, so I wanted to ask: Is this still the case with EA Version 15? Or might there be any known possibilities for a workaround to start EA from the SYSTEM user in the context of a Scheduled Task or Service? (without an active Windows Session)

Background: I work for a company that has strong restrictions on their servers that do not allow to have a permanently active Windows Session and my goal is to create a scheduled task that renders diagrams from an EA Project. Any try to achieve this failed, even creating an interactive Session via impersonation over advapi32.dll (Method CreateProcessAsUser). The program I made works perfectly when started by a logged in User but not in context of a Scheduled Task when the option "Run wether user is logged in or not" is set.

I would be very thankful for any hint of someone who has faced this or a similar problem before.

Best Regards
Aleistar

Pages: [1]