Solved

LDAP query across forests

Posted on 2013-12-04
1
24 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
1 Comment
 

Accepted Solution

by:
BigmacMc earned 0 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I know all systems administrator at some time or another has had to create a script to copy file from a server share to a desktop. Well now there is an easy way to do this in Group Policy. Using Group policy preferences is not hard. The first thing …
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
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…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

771 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

12 Experts available now in Live!

Get 1:1 Help Now