Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Scipt execution if computer is part of my domain

Posted on 2005-04-17
Medium Priority
Last Modified: 2010-05-18
I have a pretty basic logon script that executes when a user logs onto the domain.  It is a simple .bat file to map some drives.  But at the end of the script I call a computer audit program to inventory installed software, and hardware.  My problem is that we have a VPN and I will occasionally have a user sit at a machine in another child domain and log onto my domain from this other domain machine.  Works great when people are on travle to our other offices.  But what happens is my audit program ends up auditing this other domain computer.

What I really need is a conditional statement that lets the audit run if the computer is ONLY a member of my domain.  Is this possible?  I don't know the correct syntax or if it can be done in a simple .bat script.  i would think it would be like:

if COMPUTER is Member of Domain X
  then run Audit
end if

Maybe VB?  thanks.

Question by:pammann
  • 2
LVL 97

Expert Comment

by:Lee W, MVP
ID: 13803433
See if this works:

IF "%userdomain%" == "DomainToRunAuditsOn" AuditProgram.exe

Author Comment

ID: 13803483
Well the user is always part of my domain, it is the workstation they logon on from is sometimes a member of another 2K child domain.  is there a test for computer domain membership?  Is member Domain Computers in Domain X?
LVL 97

Accepted Solution

Lee W, MVP earned 500 total points
ID: 13803627
You could change the login scripts to be OU based, only applying them to computers in your domain.
LVL 31

Expert Comment

by:Wayne Barron
ID: 15716958
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
[Accept: leew]

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Herein one will find an aggregate of some of my experience building and deploying virtualization stacks both in standalone, clustered Hyper-V, clustered Hyper-V with a Scale-Out File Server (SOFS) backend, and Storage Spaces Direct (S2D).
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview

579 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