Install windows service as Local Service without specifying username password.

(2 posts) (1 voice)


Reply to this Topic Start new Topic

Custom Search

  1. C_K
    C_K
    Distinguished
    Moderator
    Score: 157

    HI ALL..

    Recently I came across a situation where I required to install a windows service on remote server. I created a windows service application and tried to install on local machine, when it prompted for user credentials for the service, I entered domainName\CurrentUserName and current user password. this works perfect when your local machine or remote server is in domain. But what if it is in a workgroup ??

    Here I have a solution where where you can install windows service without specifying user credentials.

    Open projectIstaller.vb file in solution explorer. Go to InitializeComponent() method, and write following line to specify your service is a Local System service.

    InitializeComponent()

    Me.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem (in VB.NET)

    this.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem (in C#)

    Now rebuild your application and setup project. Now install setup project. It won't ask for username and password.YOU R DONE !!

    Hope this will resolve your service installation problem.In case of any further problem..fell free to reply me.

    Posted 10 months ago #
  2. C_K
    C_K
    Distinguished
    Moderator
    Score: 157

    A little description regarding above situation:

    I have a web application which accepts excel files from users for online TDS fling which generates txt file from Fileheader, batch header, challan details and deductee details.This file is validated with FVU validator provided by NSDL to generate FVU file which is submitted to NSDL for TDS filing. When user uploads any excel file for form 24Q, 26Q, 27Q or 27EQ (You will know these forms if you are aware of TDS filing or income tax filing with NSDL), the excel records of deductees should gets copied to database.

    When thousands of records are bulk copied to database I need to validate those records according to guideline of NSDL, like whether the PAN of deductee is correct or wrong etc. For this I required a windows service which will run continuously in background to validate records. If it finds any wrong entry it will update that row with appropriate error codes received from NSDL.

    For this my windows service was running properly and validating records properly on local machine. Till here everything was perfect. The headache started when I need to deploy this web application and windows service on production server which was owned by someone else, means it was not in our domain. I had to do this by taking a remote connection of this production server.

    When I tried to install windows service on this server it prompted me for username and password to run this service. Where I didn't know the domain name of that server as it was not our server. So I tried to Install windows service as Local Service without specifying username password on production server. I tried solution mentioned in my above post. It worked properly.

    This might be helpful in case if you come across similar situation.

    THANKS

    Posted 9 months ago #

Post a Comment

You must log in to post.