|
-
Apr 2nd, 2004, 04:36 AM
#1
Thread Starter
Junior Member
user name and password in VB.NET windows services
hi,
I am writting a windows service in vb.NET.
I want to have the user that is running service. the user name and password as a global variable in my project.
I want to work with ADSI functions so I need the both user name and password to make the function work and connect to domain.
can any one give me a clue how to do that?
any other suggestion beside getting the user name and password from service?
thanks in advance.
roseta.
-
Apr 2nd, 2004, 12:05 PM
#2
Sleep mode
To get information related to users , you maybe need these function
VB Code:
Environment.UserDomainName()
or
VB Code:
SystemInformation.UserDomainName()
and
VB Code:
SystemInformation.UserName
As for the password , I'm afraid you would need a lot of code related to security and permissions and could be some APIs .
-
Apr 2nd, 2004, 01:46 PM
#3
Addicted Member
I may be wrong, but I believe if you do not use a username and Password with ADSI it will pick up the current user's credentials.
If it's a windows service you can edit it's properties in the services manager to use a specific userid & password when it runs.
-Daryl
"Two More Rolls of Duct tape, and the world is mine!"
VB.NET Guru
-
Apr 3rd, 2004, 12:31 PM
#4
Thread Starter
Junior Member
Dmyz,
thanks for your points. but if the service is not logged in what does it use? system account? then what happenes the system account should have privillage of the action.
any other point is appriciated.
roseta
-
Apr 3rd, 2004, 02:04 PM
#5
Addicted Member
By default the service will use the system account, however it can be changed to any account in the service manager.
-Daryl
"Two More Rolls of Duct tape, and the world is mine!"
VB.NET Guru
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|