Solved

LDAP query across forests

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LDAP Server cannot be reached at this time from Xerox Workcentres 2 37
Domain Logon scripts 14 49
Trying to demote an old DC 3 36
Powershell query 1 26
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
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 …

820 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