automated login and logout Windows 2008 Server

How would I create a daily script that would
1) log a guest user into a 2008 server - with or without a password
2) send some notification that login has been successful
3) log the guest user out
lineonecorpAsked:
Who is Participating?
 
MMe12Connect With a Mentor Commented:
If you're not talking about a local (console) login to the server, you could use a simple batch file like this:

::login attempt
net use \\SERVER /user:USERNAME PASSWORD
if errorlevel 1 goto failed

::logoff
net use \\SERVER\ipc$ /d
echo Success
goto :EOF

:failed
echo Failure

Open in new window


Instead of lines 7 and 11 you can insert your code or tool command line to send a notification.
0
 
lineonecorpAuthor Commented:
Thanks for the quick turnaround. Let me try this.
0
 
lineonecorpAuthor Commented:
Looks good. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.