Link to home
Start Free TrialLog in
Avatar of InSearchOf
InSearchOfFlag for United States of America

asked on

Login script

We use Trend Micro in our environment. Someone had created a login script that runs a batch file that installs the TM client.  I need to exclude certain computers from this script. The script was added to the default domain policy . We run 2008 R2
Avatar of Wayne88
Wayne88
Flag of Canada image

You will need to create a group and a new GPO, then run the GPO only for that group of users or computers instead of the default domain policy because doing this will run it for everyone in the domain.  I don't recommend changing the default domain policy it contains settings that, by default, apply to all computer and user accounts in the domain such as the domain password policy, parameters associated with user account lock-out, and password policy.  Instead create a new GPO strictly for the TM install.
SOLUTION
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of InSearchOf

ASKER

Thanks for the info. For now It is easier to exclude the devices because the devices are in different locations and mobile. Can I specify a wild card for a group om devices that start with the same name but with different numbers?
I found this solution to a previous EE post, 27438747, who was asking the same thing but for one computer. Is it possible to add a wild card to cover a range of computers?

IF "%COMPUTERNAME%"=="NameofCOmp" GOTO END
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the info. The problem is I need to exclude many devices while including all others. The idea of the batch was to install Trend on new computers as they were joined to the domain. The batch checks see if it is already installed and if it is, it ends. But I see what you mean as far as always running before it aborts but it has to run anyway no matter what so it is easier for me just edit the batch. Unless there is a better way of accomplishing this without running the batch initially.
I know you said the login script run a batch, but what kind of login script is it?
CMD, VBS or PS? (powershell)

In vbs i have to code to check a AD group, where you could put all the users that do not need the software
The problem is I need to exclude many devices while including all others
Exactly, the group will do just that
is you login script in vbscript (vbs, wsh), dos batch (.bat) command or powershell (ps1)?
No matter what the script is, filtering out computers inside the script will require it to execute unnecessary on computers that do not require it to run.
True, and since you posted nice screens shots, i support your solution :)
OK. Let me take a closer look here and see. I can see Shaun's point. Can I target an OU instead of a computername?
Can I target an OU instead of a computername?
Yes, any filtering will work
Trying different combinations to create this but not sure of my choices. Lets say I want this script to run on all computers except for laptops for example. What would be my settings?
Use a WMI filter on the GPO
Type of RAM
Select * from Win32_PhysicalMemory WHERE (FormFactor = 12)

Open in new window

-OR-
Detect for battery
SELECT * FROM Win32_Battery WHERE (BatteryStatus <> 0)

Open in new window

What I tried was:
1. Created a GPO
2. Selected Preferences under Computer Configuration
3. Selected Files under Windows Settings and selected New
4. For Source File I selected the location of the Batch (I put in SYSVOL\domain\scripts)
5. For Destination File I selected CommonAppdataDir (For all users)
6. On the common tab I selected
     a. Remove this item when it is no longer applied
     b. Item-level targeting
7. For Targeting I have
      "the computer's domain is"  and "And the NETBIOS computer name is not "name-name"

I created test OU and attached the GPO to it.
I moved two computers into the test OU and restarted the computers. One should have run the batch and the other not.
None got it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK i will try that. Doesn't a restart accomplish the same thing?
After 15 min the GP should apply
But with microsoft, we use the word "should"
 :)
That did not work.
Not seeing it anywhere
When I run gpresult /r I do not see the GPO I created.
do you have any error when you run:
cmd.exe
gpupdate /force
No.
Does it make a difference where on the server I put the batch file I want computers to pull down and run? I don't want the batch to run on certain computers but I do want it to run on others.