Restart Service As User?

Feb 24, 2011

I would like to know if it's possible to stop | start | restart service as a User with a vb program?

The reason is that for some reason, I have to restart some service for a special application on certain station but the people who use them are log on as Admin and I can't go there each time or use vnc.

View 2 Replies


ADVERTISEMENT

How To Restart A Service

Mar 12, 2009

I'm new to VB.NET and trying to write a program that prompts the user for a server name and then restarts the IIS on that machine. [code]

View 1 Replies

Restart SQL Server Service

Mar 28, 2010

How do I restart an installed SQL Server service? I've used that code for this, but it didn't worked. I think it won't find the exact service name. So it doesn't work.

[Code]...

View 1 Replies

Restart Service When Exception Is Thrown?

Jul 29, 2009

I am writing a windows service that needs to be running 24/7. It is a pretty simple service that monitors a directory where files are dropped into and processes those files. I need to restart the service if an unhandled exception is thrown.

Is there a way for a service to restart itself in the event of an unhandled exception?

View 6 Replies

Restart Service Like Apache Through Command Line?

Jan 2, 2011

restart service like apache through command line or vb.net once in a while apache in my computer hang and I just got to restart that.

View 3 Replies

Can Service Run .exe Without User Logon

Oct 8, 2009

This might seem obvious but I was doing some research and I was wondering if a service application start an executable. I know an .exe cannot start without some sort of logon but I was wondering if it was possible to work around this by having my service call it.

View 3 Replies

.net User Registration With SQL Service Database?

Jun 2, 2011

I want to create a log in and registration form in VB connecting to a sql database.

Databse Name: Users
Table Name: UserDetails
Table Fields: ID, Username, Password

The ID field was specifed as primary and self incrementing by 1 and the table has one username and password (being Id: 1, Username: peter, Password: admin). The Login form works, it checks to see if the user exists, if they do, they gain access, if not a message box is displayed. The Registration form however does not and I have no idea why, its probably something simple but yeah, hence the reason Im here! When I register I can add a user fine, and it wont allow me to add the same user, but when I look at the table, it is not updated :S and I have no idea why!! Even after registering the user closing the application and starting again, say I registered the following:

Username: Fred
Password: 123

Then I login with these credentials, it works. When I close the program and reopen the program, it still works and will not allow me to register a new user being Fred, 123. However after 3 or 4 minutes when I try again, the user no longer exisits and I can re-register with set credentials? The code is shown below (1st the login form that works, second the registration that doesnt).

Public Class Login
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Dim connection As New SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Users.mdf;Integrated Security=True;User Instance=True")

[code]....

View 5 Replies

Detect User Log On From A Windows Service

Jan 28, 2011

Is there for my .Net application to detect if a user has logged on? It is a Windows Service, so it will be running before logon.What I want to do is display a "popup" when a user logs on to tell them the status of the application

View 2 Replies

Optimal Way For A Service To Interact With User

Feb 10, 2011

My application needs to be a service (it needs run regardless of whether a user is logged on), but I also need some sort of client control/oversight over what it is doing. What is the optimal way to do this?Write a separate application to communicate with the service application - I see that as best solution in terms of stability, since the applications will be decoupled somewhat Use callbacks on system events in the service application to load UI forms directly from the service application - I see this as being easier to deploy.

View 2 Replies

.net - WCF Service Hosted In A Managed Windows Service Connect Using A WCF Service Application

Jul 14, 2011

i have a Windows service that is hosting a WCF service through net.tcp and this is working great. I have also created a WCF service application. I am trying to add the net.tcp service reference to the service application. Then I add it to the GAC that goes ok but if I try to RegAsm the WCF service application to allow it to be called from Server.CreateObject I get the error:

Warning: Type library exporter encountered a type that derives from a
generic class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be
exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit
interface as the default interface to COM using the
ComDefaultInterface attribute.

It does not work. I have tried to call it through a class library but this does not work either as the end point is not set correctly.

View 1 Replies

Allow User To Input A Value During The Msi Installation Of A Windows Service?

Feb 1, 2012

I currently have a windows service that is packaged up as an msi installer. However, during the installation i need the user to input their required filepath (to string) location. The filepath variable currently resides in my component class called MyNewService that is inherited from System.ServiceProcess.ServiceBase.

Is there anyway i can allow the user to define the filepath variable during installation?

View 1 Replies

C# - Launch A Process In A User's Session From A Service?

Jun 27, 2010

In Windows Vista/7/2008/2008R2, is it at all possible to launch a process in a user's session from a service? Specifically, the local session would be most useful.Everything I've been reading seems to say this isn't possible, but I figured I'd ask here before giving up completely.My service signs on as Local System.

View 3 Replies

C# - Web Service Do Not Return Current Windows User Name

Jan 26, 2010

This is the function that I use in web service for getting current windows user.

<WebMethod()> _
Function User() As String
Dim p() As String = Split(My.User.Name, "")

[code]....

When I run service on localhost it realy return current windows user name!The problem is when i run service from remote PC, in that case I got nothing from this function. What is problem with this service, and how I can get name of Windows user?

View 4 Replies

Possible To Programmatically Set The User Account For A Windows Service?

Aug 5, 2009

I have created a windows service that has the Account set to user. Which means that when I install the service I need to pass a user name and password. Is there a way to set these maybe in the ProjectInstaller class maybe in the BeforeInstall event? if so HOW?

View 6 Replies

Starting Windows Service As Standard User

Aug 4, 2010

My app (which runs ok as a standard user) requires updates to be installed, but I don't want to have to input the administrator username/password each time nor do I want to increase user privileges to administrator.

I have a windows service which handles the downloading of updates etc (running as Local System) but the start command needs to come from the main app (running as a standard user). This is not permitted and I get Access Denied.

I understand why this is happening but is there an alternative way to achieve this? I want to handle program updates as the standard user without using ClickOnce or installing to a non Program Files folder.

View 3 Replies

VB Web Service - Redirect The User When Their Session Is Active?

Mar 15, 2012

I created a function that allows me to login to my web service. I created a session here and added some values I retrieved from a stored procedure.[code].....

My question is: I have a default.aspx and a master page, how can I redirect the user when their session is active? For example, the default page tells users that access is forbidden untill the login/register.Do I have to use the form load handler for default.aspx or the masterpages' load handler? How do I check weither the usersession is active?

View 1 Replies

VS 2008 Working With A Service - User Form?

Jun 25, 2009

I am jsut adding bits on to a Windows Service we are making here at our company, its an Asset Management tools with a few built in extras. It runs as a service on everyones machines but we can also do things like request a reboot etc through it.At the moment when We send a Reboot/shutdown etc command to it the Service on the machines calls 'C:WindowsSystem32Shutdown.exe' with the appropiate switches. This displays the windows shutdown warning to the users but nothing they can do about it.

What I was wondering if I create a seperate exe (or even better built into the service but I am not sure if this is possible) instead of the Service Calling 'shutdown.exe' it calls this form up to the user which states that we have requested a reboot etc but there is a 'Cancel' option. The Cancel can just end the form/program and nothing more, if the timeout that we specify is reached then that form/program then calls shutdown exe for an instant shutdown.

I know that the Service runs in a different user Space and we have no telling of who is logged on to that machine so I will need a way to just launch the form to any logged on users. Doesn't matter to much if there is no one logged onto the machine but if it does display this form while noone is logged on that is not a big deal.

View 7 Replies

Windows Service Access To User Files?

Aug 1, 2010

I've been developing in .NET (VB, C++, C#) for a number of years, but I am finally creating my first service application (in VB). I need to read/write to a file contained within a user's documents. As a service is not associated with a particular user, would a service have access to a user's documents? ...regardless if that user is signed on or not?

View 2 Replies

Windows Service Detecting User Log Off Event?

Aug 15, 2011

Recently while I was playing with VS 2008(VB), I have created an application for folder sync purpose... which is working fine. Then, I have created a windows service that does the same thing and it is also working fine(from application perspective). But, I have been trying to add some additional functionality to that new service. It keeps on running as long as System is ON.

But I would like to change the functionality to... as soon as user logs off Service should STOP, and should START when user logs into that PC. I tried to find some useful info online(related to my task) and all I could come up with was to add OnSessionChange(...) method to the service. But for some reason it is not working out for me(when I've logged off or other system events such as 'system lock').

[Code]...

View 3 Replies

Xml - Allow User To Input Value During On Start Of A Windows Service?

Feb 2, 2012

I need to get the user input for where they want the files that will be produced by my windows service to be stored.

I was thinking that i could do this by reading in the user's input to a variable in the on start event of my service? this variable is then later used in my xml writer.

View 2 Replies

Restrict Windows Service To Start After User Login?

Apr 20, 2012

I have developed a windows services that Log On As "Local System" account with Statup Type "Automatic". I understand that windows services starts before user logins. But I want my service to start when ever user logs in.

View 3 Replies

Task Scheduler - Logged Off User Call A Web Service?

Aug 23, 2011

If I create a scheduled task for my vb.net program, and run it under another user, and it runs when logged off, as long as the user has full rights, will the winforms application be able to call web services over the web?

View 8 Replies

Windows Service Not Able To Read Current User's Registry?

Sep 9, 2009

I developed a windows service project using vb.net and windows service is installed with logon account as admin's user name and password. Target of windows service is to read the pst file path location from windows registry for currently logged user by accessing the following registry key

"HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesOutlook52a407cf2e436a4d8fe252d1d257465501f6700".

The problem is , windows service can able to read the admin pst file path location if admin is logged in windows. When other user logged in windows, service is not able to read currently logged user's pst file path location from registry because of windows service is configured with admin user name and password. so it always reads admin's pst file location.

View 1 Replies

Windows Service Passing Local User Id And Password

Feb 24, 2009

I'm writing a windows service in VB.Net and set the service process installer's "Account" property set to "User". So when I tried to install the utility using INSTALLUTIL.EXE it is prompting to enter the user id and password. So I wanted to suppress this "Set Service Logon" so added below code to ProjectInstaller.vb and I was able to do what ever I want: [code]

View 2 Replies

C# - Windows Service Installer For Different User Account (other Than Local System)?

May 1, 2012

Set objService = objWMIService.Get("Win32_BaseService")

objService.Create("usb2", "usb test", "c:usb2.exe",
OWN_PROCESS, NORMAL_ERROR_CONTROL, "Automatic", NOT_INTERACTIVE, null

[code].....

View 1 Replies

Returning A User Friendly Error Message To Client / From A Web Service

Oct 27, 2010

I need to return an error message to the client, if they have entered invalid data when calling my web service. So if my code is: [code]Is there a way to display a more user friendly error message (such as a message box or just the words "Invalid Order ID")?

View 2 Replies

Show User Form On A System Service Event Via IPC Remoting?

Jul 7, 2009

I am struggling with this issue for serveral days now.My application needs to work like wsus (windows updates) does. On a certain event triggered by a windows service working under SYSTEM account it needs to show a (second) form under the user context.The IPC Remoting works fine so I think my issue is in the threading.When I use form2.Show() form2 appears but the form freezes.When I use form2.ShowDialog() the form appears but I cannot get the focus on it.

Service running under system account (in this example a simple console application)

Code:Imports ClassLibrary1Module Serv
Sub Main() Dim SDSIPC As Semaphore = CType(Activator.GetObject (GetType(ClientFromServer), "ipc://Client/SreeniRemoteObj"), Semaphore)
SDSIPC.DoSomething()

[Code]...

View 5 Replies

Unable To Start Process Under Different User Context From Windows Service?

Nov 24, 2010

I have a Windows Service that needs to start other processes under a user context other than that used by the service. I've seen other posts related to this but have seen no resolutionI've tried many things and have been unsuccessful in starting the process from a Windows Service when a username, password is supplied. orking as it's a requirement of our system to do this and it worked fine until recently and only fails on Vista and Windows 7 (works on XP).

The following code is used to start the process.
Dim P As New Process
P.StartInfo.Domain = Domain

[code].....

View 2 Replies

Windows Service - When User Connects To The Network Theservice Should Run The Exe File?

Mar 9, 2009

I have to schedule an exe file as windows service.The exe file should be triggered when user connects to the pariticular net work for ex: company network.User can connect/disconnect to the company n/w "n" number of times to the network in a day. so every time when user connects to the network theservice should run the exe file.

View 1 Replies

Load A User Control In An Ajax WCF Service And Access Custom Properties?

Apr 4, 2011

I can load a generic user control just fine in my WCF service doing the following:

UserControl userControl= (UserControl) new Page().LoadControl("~/UserControls/MyControl.ascx");
However i can't seem to find any way to do this

[code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved