automated login and logout Windows 2008 Server

Posted on 2012-08-30
Last Modified: 2012-09-14
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
Question by:lineonecorp
    LVL 4

    Accepted Solution

    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
    net use \\SERVER\ipc$ /d
    echo Success
    goto :EOF
    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.

    Author Comment

    Thanks for the quick turnaround. Let me try this.

    Author Comment

    Looks good. Thanks.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    We recently had an issue where out of nowhere, end users started indicating that their logins to our terminal server were just showing a "blank screen." After checking the usual suspects -- profiles, shell=explorer.exe in the registry, userinit.exe,…
    I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
    This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now