Solved

LDAP query across forests

Posted on 2013-12-04
1
31 Views
Last Modified: 2015-05-11
I have two domain forests.  Let's call the 1st mydomain.com and 2nd is otherdomain.com.

I have a script that creates new user accounts, including the SamID from an input file called newusers.csv.  There's already a query to check for duplicate SamID's in mydomain.com, if a match is found the script exits with an a message of 'Duplicate SamID' found'.

I need a script to query for duplicate SamID's in otherdomain.com.  There is a two-way trust between the forests.
0
Comment
Question by:BigmacMc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
BigmacMc earned 0 total points
ID: 39696566
I believe I've answered my own question with the following:

for /f "skip=1 tokens=1,5 delims=," %%a in (%APPDIR%\CreateACcounts.csv) do dsquery user -domain otherdomain.com -samid %%b >>%APPDIR%\UserObjects.txt
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

751 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