Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remotely Determine Logon Server

Status
Not open for further replies.

keithja

MIS
Sep 12, 2003
88
US
Hi,

I'm looking for a way to remotely determine which Win2K3 AD DC authenticated users on particular machines.

I have tried executing "psexec \\<PC> cmd /c echo %LogonServer%"
and it doesnt see the variable.

I have tried a bat with a redirect (ie psexec \\ilc987 echo %LogonServer% >c:\logonserver.txt in a bat file) and remotely executing the bat with:

psexec \\<pc> /c /f getlogonserver.bat
and it still thinks its a null variable (the file contains "echo on")

I am having trouble with some Profiles being recreated on just certain machines and I wish to determine if which server authenticates them plays a part. But I don't want to go around to each PC every day to check.

Since the group policy has fallen under suspicion, I also don't want to use a login script or anything that requires changing group policies.

Thanks for your help.
k
 
Hi Wchull,

I tried the script and was unable to get it to work via PSexec. It did work fine when I ran it directly. Scripting Guys intro leads me to suspect this is intended for use in a login script and may suffer the same limitations that using psexec does for a simple "echo %logonserver% >file.txt - that is, it doesn't have access to the authenticated user's info.

However, I have found a way to do it using OWexec - a free tool from officewarfare. It is similar to PSexec except it runs in the authenticated users account. The basic command is:
owexec -c (pc name) -k "cmd.exe" -p "/c set |findstr /I "LogonServer" > C:\lognserver.txt

Then read the file from the user's harddrive.

and, of course, with a few modifications, it could be stuck in a for loop to read a list of PCs from a file, echo the PCname, and then the logonserver results into a network share, to create a list of everyone's logon server.

I mention it here because owexec offers the possibility of doing a lot of other little task that used to be difficult (net use for example).

Thanks for your reply,
k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top