Solved

LDAP query across forests

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Installing a printer using group policy preferences is not that hard let’s take a look at it. First lets open up your group policy console and edit the policy you want to add it to. I recommend creating a new policy for each printer makes it a l…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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 …

863 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

27 Experts available now in Live!

Get 1:1 Help Now