By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Logon Server

P: n/a
Hi,

I have created an application that works from scheduled tasks and uses the
System.Environment.GetEnvironmentVariable("LOGONSE RVER") to identify which
server should be used form SMTP and Files, this works fine when a user is
logged in or the pc is logged in and locked.

However when the PC is not logged on the LOGONSERVER is a server on our
network but not the desired one. The schelduled task is set to "Run As" the
same user as above.

Can anyone shed any light on this or should i use something other than the
logonserver.

Thanks for any help

Steve Lloyd.
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Steve,
If you are using Active Directory you can get the FQDN of the DC you are
connected to by using the following snippet. Make sure you reference
System.DirectoryServices and use an Imports System.DirectoryServices.

Dim Root As New DirectoryEntry("LDAP://RootDSE")
Dim LogonServer As String = Root.Properties("DNSHostName").Value
"Steve Lloyd" <Re*************@laxeyRemovepartners.com> wrote in message
news:O9**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have created an application that works from scheduled tasks and uses the
System.Environment.GetEnvironmentVariable("LOGONSE RVER") to identify which
server should be used form SMTP and Files, this works fine when a user is
logged in or the pc is logged in and locked.

However when the PC is not logged on the LOGONSERVER is a server on our
network but not the desired one. The schelduled task is set to "Run As"
the
same user as above.

Can anyone shed any light on this or should i use something other than the
logonserver.

Thanks for any help

Steve Lloyd.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.