Questions tagged [dsquery]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
548 views

dsquery results inconsistency

I have a single domain (my.local) with 2 domain controllers: 192.168.3.63 - DC1 192.168.3.64 - DC2 (primary DC) I'm testing request to find if user is a member of a group. Here's a query filter: (&...
mistika's user avatar
  • 111
2 votes
1 answer
2k views

How can I get a list of active directory group members that are not disabled (without using PowerShell?)

I'm trying to get a list of users that are members of an Active Directory group that are not disabled. The best I've been able to find so far is: dsquery group -name "Group name" | dsget group -...
Sean P.'s user avatar
  • 81
1 vote
0 answers
1k views

dsget the users in a group, or member groups

I am using the chain of commands to get a report of the members of group AD_GROUP_NAME. dsquery group domainroot -name AD_GROUP_NAME | dsget group -members | dsget user -display -email And it ...
Tvanover's user avatar
  • 257
5 votes
1 answer
893 views

Listing Windows domain computers without Remote Server Administration Tools (RSAT)

I would like to retrieve a list of computers which are part of the Windows domain my Windows 7 workstation is a member of. I would like to achieve this with little to no extra installations, ...
Charles's user avatar
  • 53
4 votes
1 answer
134 views

Windows Server 2008 R2 functional level - DSQUERY

After executing some queries (dsquery computer domainroot -stalepwd), using dsquery, I was told this command connects to the available DC and for this reason the results might be untruthful because ...
jffalmeida's user avatar
1 vote
1 answer
800 views

Find the users of Active Directory global group?

I am using following command to get the users of Active Directory Global Group. dsquery group -name "Groupname" |dsget group -members But, this is piped command and it's not working in Visual Studio,...
Aishwary Vardhan's user avatar
1 vote
1 answer
1k views

Possible to filter dsquery group?

I am trying to output the members of an AD group in an easy to read format with the following: dsquery group -name "<AD GROUP NAME>" | dsget group -members -expand | dsget user -samid -fn -ln ...
Mark Allison's user avatar
  • 2,198
0 votes
3 answers
9k views

ldap query with nested group

I try to build a ldap query to MS Active Directory. I found that there is a LDAP_MATCHING_RULE_IN_CHAIN type to do so. Which results in the follow syntax: (&(sAMAccountName=Benna)(memberof:1.2....
Thomas's user avatar
  • 187
1 vote
1 answer
554 views

dsget error probably because of users with "-" in their name

I'm trying to run a dsquery/dsget that will result in users that weren't active for a month and that are not disabled: dsquery user -inactive 4 -limit 0 | dsget user -samid -disabled >>desktop\users....
Npv23g's user avatar
  • 320
2 votes
2 answers
2k views

Incomplete results when querying Active Directory for group members in a situation with trust relationships

We are attempting to query Active Directory for a list of all machines that are members of a group, along with information like OperatingSystem attributes. We can't get results for every member of ...
Ale Exc's user avatar
  • 23
2 votes
1 answer
6k views

DSQuery to find systems running Windows XP that have connected to domain within last 26 weeks

I'm trying to write a single dsquery which will tell me what systems have connected to our domain within the last 26 weeks that are running XP so we can figure out what we need to phase out over the ...
Windows Ninja's user avatar
1 vote
1 answer
3k views

How to add a DSQuery script to Excel?

I have to update AD with home users number, etc. I've written the script and imported the usernames and phone numbers into Excel Script: dsquery user -samid "username" "OU=Sys,OU=Prod Services,DC=...
JJJJNR's user avatar
  • 870
0 votes
1 answer
850 views

Bulk Phone number change - DSQUERY

I am investigating a way to update the "telephone field" for a large group of users within Active Directory? I would like to match all users with their new phone number as they have moved offices. I'...
JJJJNR's user avatar
  • 870
1 vote
1 answer
2k views

DSquery user -office unknown parameter

I'm trying to lookup a username from dsquery using the office parameter as we store IDs inside of the office parameter. Any ideas on how to get their username? I tried dsquery user -office "IDHERE" ...
Jamie's user avatar
  • 224
0 votes
1 answer
687 views

dsquery command troubles

I have the following command; its purpose is to list any services which are running under a user account within the domain and output that information into text files within a directory. Each machine ...
Matt's user avatar
  • 85
6 votes
2 answers
70k views

I need to export a list of all users on our domain and I am not familiar with DSQUERY or DSGET?

I am really struggling to create the query that will export the following: Account FirstName LastName the OU that the user resides in Ideally I would like it as a CSV. I do not have access to the ...
Neil's user avatar
  • 307
3 votes
1 answer
717 views

trying to copy security groups to a user using dsmod group utility in AD

I am trying to create a batch file that asks to enter source samid and destination samid. Then using dsquery and dsget find out what security groups source samid is assigned to and assign destination ...
newbie's user avatar
  • 51
1 vote
2 answers
2k views

Piping DSQUERY commands together

Can DSQUERY commands be piped together? eg to return a list of users in each of the groups found within the 'Builtin' container? dsquery groups "cn=Builtin,dc=domain,dc=company" | dsquery groups "cn=...
HaydnWVN's user avatar
  • 425
1 vote
2 answers
4k views

Convert linux ldapsearch to Windows dsquery

I am converting a website fro being hosted on Linux and Apache to Windows and IIS. The pages are currently written in php but new functionality will be in something along the lines of C#.net In the ...
Irukesu's user avatar
  • 13
2 votes
1 answer
3k views

Dsquery nested groups

How would I write a dsquery to get a list of all the members of a d-list, expanding any nested groups to get the members of those groups? I've written this: dsquery * -filter "(&(memberOf=cn=...)...
Simon's user avatar
  • 121
5 votes
1 answer
17k views

How can I find all groups a user belongs to via DSQUERY

How can I find all groups for a specific user (groups for which the user is assigned) using dsquery?
atricapilla's user avatar
9 votes
2 answers
3k views

Active Directory - Bulk Company Update

I was wondering if there is a way to update the 'Company' field for a large group of users within Active Directory? I would like to match all users with a company ending in a certain string. It would ...
JT.WK's user avatar
  • 431