How to disable login script on specific computers?

Posted on 2012-08-29
Last Modified: 2012-09-17
Hi there,

We have recently created a vbscript file that automatically configures a user's Outlook signature.  We configured each user with a login script in AD, which in turn calls this vbscript file.  The signature is being created just fine with this script, but since this is part of a login script, the script will run every time the user logs in on their computer or on other computers.  It's fine if this script runs every time on the user's computer, but is there a way we can specify what computers this script shouldn't run on?  Specifically, we have a couple of meeting rooms and we don't want users to log on and have Outlook try to configure this signature, when it's not their personal computer.

Any suggestions?

- Christian
Question by:Christian Palacios
    LVL 5

    Accepted Solution

    in script get the computer name and run if name == something

    Set objNetwork = CreateObject("Wscript.Network")
    If objNetwork.ComputerName = "Admin" Then
              Code here
              Code here
    End If

    Or other way, you can create another OU and run different gp on that

    Author Comment

    by:Christian Palacios
    Thanks very much!  I'll give that a try and let you know.

    We actually aren't using GP for this, we just set the login script on each user's AD account properties.

    - Christian
    LVL 7

    Expert Comment

    Rather than having the script assigned to each user in AD why not have it run as a GPO that is assigned to the computers group but excluded from the meeting rooms Group
    LVL 2

    Expert Comment

    Create a new AD group for the computers you don't want Outlook configured on.  Get the logon script to check if that computer is in that group.  If it is, then don't execute the Outlook config part of the script.
    LVL 9

    Expert Comment

    You can use Group Policy to manage logon and startup scripts for Windows
    2000/XP Pro/W2003 Computers. Logon scripts would be part of "user"
    configuration and only apply to users within the scope of influence of the
    Group Policy. You could create Organizational Units with Group Policies that
    apply logon scripts to the users that have their user accounts in the OU.
    LVL 4

    Expert Comment

    Agreed with anyone who says to use a GPO for this.

    A login script works for AD accounts that don't have exceptions--like a roaming profile or something similar. For this, since there are exceptions, you need to take it a step further than a standard script. Create a separate OU that does not have this policy applied and put the computer objects in there.
    LVL 5

    Expert Comment

    1 Click on "Start" button/option on the server running the group policies. Type "gpedit.msc" in the search text box and press "Enter." The Group Policy Editor loads on your server.

    2 Double-click on the "User Configuration" policy in the left panel. Double-click Administrative Templates, the select  System,  Click Logon to view a list of Windows logon policies in the right detail panel.

    3 Double-click on the policy named Run these programs at user logon. A configuration window opens. Click on the "Show" button/option to open a list of scripts running on the users' desktops.

    4 Click the script you want to disable, then click the "Remove" option. The script is removed from the list. Click "OK" to save the settings and close the script editor.

    Author Closing Comment

    by:Christian Palacios
    Worked great!

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    Synchronize a new Active Directory domain with an existing Office 365 tenant
    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…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

    755 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

    24 Experts available now in Live!

    Get 1:1 Help Now