jskfan
asked on
Termical Services connection.
Termical Services connection.
I need a script that shows me in which computer a ceratin account has logged on through RDP.
Most of the time a user or myself remote to a computer and forgot to logoff.
Checking my sessions with a script would help to locate the computers my acount is logged on to.
Thanks
I need a script that shows me in which computer a ceratin account has logged on through RDP.
Most of the time a user or myself remote to a computer and forgot to logoff.
Checking my sessions with a script would help to locate the computers my acount is logged on to.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you talking generically about computers or just servers? If servers terminal servers or any old server? If this could be ANY PC on your network you could be there a while depending on the size of your network.
ASKER
I am talking abou just servers.
By the way I used psloggedon.exe from Pstools, and output to the text file, but it showed my account logged on to some computers but when I verified it didn't
By the way I used psloggedon.exe from Pstools, and output to the text file, but it showed my account logged on to some computers but when I verified it didn't
Add the below to the logon bat file of any user you want to track, please note the path variables at the very end of the script.
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "IP Address"') DO FOR %%B IN (%%A) DO SET IPADDR=%%B
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "Host Name"') DO FOR %%B IN (%%A) DO SET netbiosname=%%B
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "Physical Address"') DO FOR %%B IN (%%A) DO SET macaddress=%%B
echo logon,%DATE%,%TIME%,%username%,%COMPUTERNAME%,%CLIENTNAME%,%netbiosname%,%ipaddr%,%macaddress% >> \\<servernamehere>\hiddensharehere$\%USERNAME%.csv
ASKER
do you mean I will create an OU put a user inside the OU then create a new group policy and put the batch file in the policy???
is the batch file I am creating is just copy and paste from the code you have written or there is anything to change?
is the batch file I am creating is just copy and paste from the code you have written or there is anything to change?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
leave the username part.. thats a variable that will write to a file named as the user logon name.csv
ASKER
<<usually i assign the logon script in the ADUC mmc in the profile area, then just drop the bat file in the netlogon share on the DC.>>
If I drop the bat file in the netlogon share on the DC, the script will be ran for every user who logs on.
If I drop the bat file in the netlogon share on the DC, the script will be ran for every user who logs on.
ASKER
the script didn't work....
is psloggedon.exe from PStools good to use in this scenario?
is psloggedon.exe from PStools good to use in this scenario?
ASKER
Correct.