how to solve this error MAPI_E_FAILONEPROVIDER when using Redemption - c#

Hi I have a strange problem and am unable to find out the root cause. We build and deployed our application using Redemption things were working fine but suddenly the installation on UAT server has stopped working. But the same is working in production(Thank God).
Our application is of console based and written using .NET 3.5 its not totally down, it is working but when we try to run the same application via scheduler task it didn't work, but when we double click the exe file it works properly, successfully connect to Exchange reads and download the files as per our business logic but not executing when we try to run under scheduler task.
below is small error info might be helpful for you..
2012-06-15 16:05:06,724 EmailProcess.Program - message = Error in
IMAPISession::OpenMsgStore: MAPI_E_FAILONEPROVIDER ulVersion: 0 Error:
Microsoft Exchange is not available. Either there are network
problems or the Exchange computer is down for maintenance. Component:
Microsoft Exchange Information Store ulLowLevelError: 2147746069
ulContext: 1318
Please suggest
Edit 1: More info Windows 2008 Server, a user named SpecialTasksUser is configured on the server to login and has admin rights. Outlook is installed and profile is configured for different user name OutlookSpecialUser, when we login using SpecialTasksUser user and launch the outlook it loads and shows the inbox and private folders...so far so good.
We created the scheduled task and configured to run under user name SpecialTasksUser because this user has admin rights and this is where it gives error. On the other hand, when we go to installation directory and double click the *.exe file the application works and redemption successuflly reads the email and does what it is suppose to do...please help
I hope this information would be helpful .....

Most likely you are using a wrong parent identity of your process - scheduler runs under its own account by default. Make sure you specify the right Windows account.

Related

C# Blazor project running as Windows Service

I'm pretty new to this.
I have a c# blazor project which is using SQLite Database on .Net6.0
I'm trying to turn this into a windows service, so I can run it on a windows server (Win 10).
I followed steps here
but when I try running the service via "Windows Services" on my local computer, I get this error:
Windows could not start the service on Local Computer. Error 5:Access is denied.
and on the windows server it starts and immediately stops.
I checked Event Viewer and there wasn't any details about why that's it.
Do you if I need to do more stuff for it to run? specially DB wise?
I can't find good info on internet :(
I fixed it.
So, follow the link and it should work. I had some other problems with IP and Port.
and just that you don't need to change anything for your DB. You probably need to add an automatic DB migration which you can find it here.

Problem while reading a smartcard in browser

I have been using the PCSC library for years to read smartcards and have never had a problem.
I entered the same code, which I do not report because it is too long and is 100% functional, in an ASPX page. If I run the web application from Visual Studio 2019 on localhost everything is fine, if I run it on the server with Windows server 2019 essential I receive this error:
The Smart card resource manager is not running.
I don't understand why this difference. Thanks to those who can help me.
P.S. I don't know Java, but only c#
UPDATE. The SCardSvr service is started on the server, but when I use the PCSC class the service stops on its own on the server. Strange behaviour.........
UPDATE
Based on the new information the OP wants to connect a Smart Card Reader that resides on a remote computer (the client).
To the best of my knowledge this requires either a VNC or an RDP connection from the client to the server, use of the smart card redirection mechanism, and then opening the ASPX webpage from a web browser session started during the remote desktop connection.
My answer below is not applicable in this scenario at all.
OLD ANSWER
I would first look at the Services list on the server computer. Ensure that both Smart Card service and the Smart Card Device Enumeration Service are running when you attempt the request.
This problem may also occur due to insufficient privileges on behalf of the user account running the application pool for your ASPX page.
When you run the web page from Visual Studio 2019 it executes using derived credentials (most likely your own user account), and this account may have more privileges than the specified application pool user account on the Windows Server 2019. This applies especially if you use Application Pool Identities.
If the problem is caused by lack of privileges, then see this ServerFault answer for details on how to use the sc.exe tool to configure the privileges.
Also note jdweng's comment: if you have not installed the necessary drivers for the smart card reader to the Windows Server 2019 computer then you will need to do so in addition to configuring the privileges. Otherwise even though the ASPX page were able to access the Smart Card Resource Manager, the card reader itself has not registered there-in and thus cannot be used.

What is an event broker? and how do you configure one on windows 2008?

I am trying without complete success to create a wso2 identity server on a windows server 2008 vm. I followed the online instructions and installed the pre-requisits (jre and jdk), downloaded the zip file, setup the environment variables, and ran the wso2server.bat file. There were a lot of errors.
I then realized I needed to add active directory role on the server, which I did. It still wouldn't install. I did some more online research which led me to believe I needed to install wso2 esb as well, which I did. I was able to get that install to work and was able to create a desktop app to consume the web services. All well and good. but then as part of the requirements they wanted to enable passive sts with an asp.net client (not really sure what that is), so I went back to the identity server and am still getting errors while running the bat file, though I an able to run the gui from the browser, but unable to log in.
The exception I am getting is :
TID: [0] [IS] [2013-10-07 10:34:58,746] ERROR {org.wso2.carbon.event.core.internal.builder.EventBrokerHandler} - Can not create the event broker {org.wso2.carbon.event.core.internal.builder.EventBrokerHandler} org.wso2.carbon.event.core.exception.EventBrokerConfigurationException: Can not access the user registry
in addition, I am also getting authentication errors on some of the esb web calls, but not all, and I would also like to know how to change from the default user store (ldap or ad or whatever it is) to sql server.
I have seen a few examples for doing it with mysql and oracle, but not sql server, specific product information is sometimes challenging to find.
Any help would be greatly appreciated.
Thanks. Mike

Exception when running .NET 4.0 application from network share

I have a .NET 4.0 C# console application. The application is deployed to a network file share (which I believe is a Windows 2000 Server file server) like this:
\\server\share\Apps\Beta\Group\JobName\JobName.exe
The agent machine that will execute the application is a Windows 2008 R2 Server, x64. I use a domain user account to run the application from the command line. When run under a certain account we'll call UserBeta, the application throws the following exception when trying to connect to a WCF service:
System.Configuration.ConfigurationErrorsException: Error creating the Web Proxy specified in the 'system.net/defaultProxy' configuration section. ---> System.Net.Sockets.SocketException: An invalid argument was supplied
The user account, UserBeta, has Modify, Read & Execute, List folder contents, Read and Write permissions introduced at the folder Beta and inherited by the child folders in the above path. If I use a second user account, UserStage, which has the same permissions except that they are introduced one folder higher, at the Apps folder, the application runs without exception. Both accounts belong to the local Administrators group on the agent server.
Interestingly enough, if the application is executed as UserBeta within 15 seconds or so of it being executed as UserStage, it will also run successfully.
I should also note that the application runs fine if run from a local drive as the GroupBeta account, so there seems to be some sort of trust issue with the particular account running from the network share.
I need the application to run as the UserBeta account from the network share. ClickOnce is currently not an option. I believe I could solve the problem by adding the permissions for UserBeta at the Apps folder, however I don't like throwing more access at something unless that's really the issue. If anyone has any other ideas or can point me to the reason adjusting permissions is the correct course of action, I'd be much appreciative.

Windows servce won't run if no user logged into server

I created a windows service that's basically a file watcher that wont run unless a user is logged into the machine its on.
The service is running on a Windows Server 2003 machine. It is designed to listen for excel files in a folder. When there is a excel file, it starts to send some information to a web service. When it's done, it copies the processed file to a archive folder.
Can anyone help me?
Best regards
Baris
Run it as a user that has rights to log on as service on the machine. Make sure this user has an access to the directory you watch.
What i always do in a scenario like that is give the user logon as batch job and logon as a service rights. 1 of these 2 will most likely fix your problem.
You can configure this in the local group policy editor as described here
Be aware though that if your computer is in a domain it is possible that the group policy gets pushed to the server every 15 mins so you might have to talk to a system admin to get things sorted.
When you actually only want to run when someone is logged in, do not use a service but an autostart application in that case.
If you have to be a service because of account privileges, the service may detect the current logins itself, but you may combine a service with a client (autostart) application that connects to the service. That way, you can also show tray incos, status informations and enable the user to control your service using the client application.
Using Win7 and higher, services themselves (running in session 0) can no longer display UI interactions on the user's desktop.
Keep in mind that there may be multiple users logged in on current operating systems...

Categories

Resources