Issue with window service using Fredi Component - service

I have window service which uses fredi component to generate 810 (Invoices)
I have scheduled window service on server using system credentials. and its
executes on time and giving status OK (Executed Successfully).
But it will not generate 810 invoices.
While i am logged on a server or i will execute manually, then it will work properly and generates 810 (invoices).
Now my Question is why it is not generating 810 (Invoices) while system user is not logged on a server?

the way you describe this screams: 'rights problem'.
check paths (are you using UNC's?)

Related

Methods to wait until DC is fully booted in order to add another server as DC to that domain?

I'm currently trying to create a PowerShell script which is capable of automatically creating Hyper-V VMs, configuring them and installing a AD domain.
Infrastructure: the script is creating 3 VMs: 2x Server 2016 Core (meant for the DCs) and 1x Windows 10 Pro
After creating a new forest with Install-ADDSForest. DC1 will automatically reboot. Directly after that DC2 is trying to execute Install-ADDSDomainController which is failing because it can't contact the domain, because something on DC1 isn't ready.
I've already tried to wait for PowerShell Direct & gpsvc (because the shell is showing "Waiting for gpsvc" for a long time.). I've also tried to ping the domain name and execute Install-ADDSDomainController after ICMP reply.
Now to my question: What service needs to be running in order to add the other server as a DC?
I would then get the status of that service and continue my script if that named service is running.
I would also appreciate if someone could provide a different/better solution!
Thanks in advance.
Edit:
I've found somewhat of a solution for my case:
I'm now catching the error with try catch inside a do while loop.

Can´t execute asp-classic scripts in Windows server 2012 when call them from a client in Delphi-7

I have migrated an application that was running on Windows Server 2008 to one on Windows Server 2012.
It is a desktop application that makes many calls to the server's .asp scripts, and from them calls are made to stored procedures in SQL Server.
The program that makes the calls from the client computer, is a DLL made in Delphi 7.
This mount was working properly on the computer on Windows Server 2008.
But now I have come to the conclusion that scrips are not executed in .asp since I do not receive a response from the server, although I see in the .log file they are called and with the correct parameters.
The following lines are from the .log file
2018-11-27 15:51:20 nn.nnn.nnn.223 GET /soporte/lnk_mnto.asp COD=MFM0010010LRN&APP=MF&cachedisable=FNFAJDNHFIDLELA 80 - nn.nnn.nnn.nnn HTTP/1.0 Mozilla/4.0+(compatible;+Synapse) - www.ikutgroup.com 301 0 0 569 205 62
2018-11-27 15:52:36 nn.nnn.nn.223 GET /soporte/lnk_mnto.asp COD=MNF5369168SB7&APP=MN&cachedisable=IHOLGLANIEKMBJE 80 - 89.128.30.175 HTTP/1.0 Mozilla/4.0+(compatible;+Synapse) - www.ikutgroup.com 301 0 0 569 205 46
As you can see, COD and APP are the parameters that the script lnk_mnto.asp needs, and the call from the Delphi DLL is registered in the log file, but the DLL doesn't receive an answer.
But, if I call the asp script directly from the browser through this call:
http://xxxxxxxx.com/soporte/lnk_mnto.asp?COD=MNF5369168SB7&APP=MN&cachedisable=HNIKNFNMEJMFBDH
I receive the correct answer.
I know that in the first case, the script is not executed, because I added in the first instructions of it the recording of a line in the database, and this does not occur. Instead, when the script is called from the browser, the row is recorded in the table of the database.
I think it's a problem of permissions, but I have no idea what I should look at to correct it.
Do you have any ideas that allow me to try to solve my problem?
No. Is the dll from the Client computer who call to the .asp script in the Server.
But in the end I made a new test program in Delphi, copying the instructions that call the script in .ASP and when I ran it I saw that it returned an error of the type:
<.head><.title>Document Moved<./title><./head>
<.body><.h1>Object Moved<./h1>This document may be found <.a HREF="http://myweb.com/soporte/lnk_mnto?COD=MNF873455SB7&APP=MN&cachedisable=GNDECGBLJBFHBHA">here<./a>
Then I looked for information on the web about this error message and I found the following page that has solved my problem
https://network.convergenceservices.in/forum/68-plesk-panel-hosting/3711-document-moved-or-object-moved-error.html
In short, it says that in the Plesk configuration of the page, you have to put 'none' to the question: 'Preferred domain'.
Login into the plesk control Panel
Click on Websites & Domains
Click on Hosting Settings
Select the “None” drop down list box from “Preferred domain”
Click on OK
Now my problem is solved.
Thank you very much to all.

Difference between running a user as a service vs logging on

I'm running an application that executes Windows Workflows as a service with some custom activities in them. When I run the activities as a logged on user in a shell that invokes the workflows with the activities, the activities have no problems performing as expected. When the activities get invoked while the user is running the service (e.g. not logged on, at least not graphically) the activities fail with "Access Denied" errors. What's the difference between running the code as a logged on user vs running it as a service user ? Is it that when it runs as a service, the user's profile doesn't get loaded ? If so, how can I force the user's profile to get loaded when running as a service ?
Specifically, the activities I'm working with perform remote management with classes in the System.Management.Automation namespace (i.e. powershell).
A bit late answer, but in case someone else is wondering.
I had a similar problem earlier and have done some research. The following is untested, but may be of help to others.
The difference between a process running as "Windows Service" and under a desktop environment is what Window Station it is assigned to. Normally a service runs under a different station than desktop users.
I say normally because a service can have the "SERVICE_INTERACTIVE_PROCESS" flag set. This will give it a desktop window station. See this article and this article for a more detailed explanation. Setting the "SERVICE_INTERACTIVE_PROCESS" can be done in the CreateService (C# use of that) call or manually by checking the "Allow service to interact with desktop" checbox under "LogOn" under properties of the specific service.

Opening Interactive PowerShell GUI script for other logged on users

Hello Folks,
I have a powershell MTA (GUI script using winForms), which works well, lets take the script name to be "ENDUserMTA.ps1" which does invoke certain commands and does something which really needs admin rights. this works fine when run manually or via task scheduler or when set via [registry] RunOnce or Run or whatever when there is admin rights..
The problem is i want to invoke this script on the END users laptop and make them to work with it [interactively]
Options that i have tried so far:
Tried Scheduling the "ENDUserMTA.ps1" in Task Manager SYSTEM account [using When running the task, use the following user account] - this starts and run NOT INTERACTIVE [since system account does not have interactive session]
Tried Scheduling the "ENDUserMTA.ps1" in Task Manager with Different user account which has admin rights [using When running the task, use the following user account] - This again starts but the GUI is not shown to the End User who has logged without admin rights, rather shown to only the user who was set under the option [When running the task, use the following user account]
My situation is not possible to create PSSessions or Delegated Remoting. I am now is middle of forest and no where to go!!!
Not sure how to invoke the script as admin to a user who has logged into a machine without admin rights..
WHat i exactly need or similar solution: When scheduling this script, i schedule the script to start atlogon[any user], after the script completes it will delete the scheduled task
Pls help..
Balaji
Begining on Vista Microsoft has started to separate UI stacks for security reasons.
My advise for your problem is to change the architecture of your code in order to create two scripts.
The first one with no UI will be scheduled with administrative rights
The second one with UI will be started with the user rights and will be a client of the first one.
You can use Inter-Process Communication between the two scripts, but you will met a security issue, you server part vill need particular ACLs to allow the client part to connect.
It exists other way to communicate between scripts, but it's not so easy with an asynchronous UI architecture on one side. It would be simple using managed code (.NET code) or native code(unmanaged code). For me, you are on the limit of the scripting place even if scripting capacities are very large as far as PowerShell is built on the top of .NET.

Running a cgi perl script as an Administrator

I'm writing a perl script for a website, and I need to be able to control VirtualBox via the website. I'm not sure where to start, or if I'm even trying to debug in the right area, but here goes.
My server is running IIS7 on Windows Server 2008 R2. I'm also running 2 virtual machines through the vboxmanage command line interface. These VMs are running under SERVER\administrator.
When I open my website, it requests a login. I login to the website as SERVER\administrator and click a link that calls my script using an xmlhttprequest. Now, normally, it doesn't matter what user I run these as, but with vboxmanage, if I run the command as a different user, the list of VMs is different. I tried whoami, which returned SERVER\administrator, but %DOMAINNAME%\%USERNAME% returns the domain that the server is connected to as dommainname and SERVER$ as the username. The vboxmanage command then fails.
On the website, impersonation is turned on. When I turn impersonation off, the whoami request changes to be iis apppool\website. Any ideas on how to get around this?
As a final note, I've thought about using runas, but since it prompts for a password, there's no way to call it through scripting (and that would be a poor security decision, I'd imagine).
This is an oft recurring, well-known and well-solved problem. Instead of having one big program dealing with requests from the Web and managing the VM (strong coupling), separate the concern and write two programs, each doing exactly one task.
The user facing program running in the Web server context can continue with limited privileges. The VM manager is a stand-alone program running with the necessary admin privileges, either repeatedly from the scheduler or as daemon/service.
Have the first communicate with the second over a message-queue.