Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Windows Service User Account Credentials

Windows Service User Account Credentials

Scheduled Pinned Locked Moved C#
questionsysadminwindows-adminxmlhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ekynox
    wrote on last edited by
    #1

    hi folks, I have been working on a windows service application which monitors a specific mailbox on an exchange server. The application works as intended with one exception. The exception being the storage of the username and password that will be accessing the mailbox. Currently, as a crude method to test my application, I stored the username and password in an encrypted format in an xml file. I had the idea that the user account I specified to run the windows service application can be used to access the mailbox provided the user has been granted access via Active Directory (which I have taken care off). By doing this allows me to ensure that the user account is in sync with AD. The problem is at runtime how do I get the username and password of the account specified to run the windows service application to access the mailbox. I tried the Service Installer Process which has Properties to GET/SET the user name and password but this is only for install time not run time. Any ideas as to how I can tackle this ? Or maybe what is the best practice way of doing this? thanks V

    J 1 Reply Last reply
    0
    • E ekynox

      hi folks, I have been working on a windows service application which monitors a specific mailbox on an exchange server. The application works as intended with one exception. The exception being the storage of the username and password that will be accessing the mailbox. Currently, as a crude method to test my application, I stored the username and password in an encrypted format in an xml file. I had the idea that the user account I specified to run the windows service application can be used to access the mailbox provided the user has been granted access via Active Directory (which I have taken care off). By doing this allows me to ensure that the user account is in sync with AD. The problem is at runtime how do I get the username and password of the account specified to run the windows service application to access the mailbox. I tried the Service Installer Process which has Properties to GET/SET the user name and password but this is only for install time not run time. Any ideas as to how I can tackle this ? Or maybe what is the best practice way of doing this? thanks V

      J Offline
      J Offline
      Johnny 0
      wrote on last edited by
      #2

      The question seems strange, normally, you set the account when you install the service and this account runs the service, thus accesses the mailbox. So there is no reason to put it in the code. You can look at this by looking at the properties of any other service. Usually they run as System or other services, and if you are an administrator of the domain you do not have to enter any password. Make sure that either the server machine or the Domain Controllers group has access to the mailbox.

      E 1 Reply Last reply
      0
      • J Johnny 0

        The question seems strange, normally, you set the account when you install the service and this account runs the service, thus accesses the mailbox. So there is no reason to put it in the code. You can look at this by looking at the properties of any other service. Usually they run as System or other services, and if you are an administrator of the domain you do not have to enter any password. Make sure that either the server machine or the Domain Controllers group has access to the mailbox.

        E Offline
        E Offline
        ekynox
        wrote on last edited by
        #3

        thanks for the response. Well I was not clear when I had initially explained, the code I am using to access the mailbox, you need to explicitly provide the username and password. Hence my original question, how does one extract the username and password of the User Account which is running the service applications.

        J 1 Reply Last reply
        0
        • E ekynox

          thanks for the response. Well I was not clear when I had initially explained, the code I am using to access the mailbox, you need to explicitly provide the username and password. Hence my original question, how does one extract the username and password of the User Account which is running the service applications.

          J Offline
          J Offline
          Johnny 0
          wrote on last edited by
          #4

          This is one of the features of Windows and most other Os's. One cannot extract the password of a user, no need to explain why!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups