Questions tagged [dsquery]

22 questions
9
votes
2 answers

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 take way too long to change this for each user…
JT.WK
  • 431
  • 6
  • 18
6
votes
2 answers

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 domain controller, but can run DSQUERY/DSGET/etc.…
Neil
  • 307
  • 3
  • 4
  • 11
5
votes
1 answer

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, especially not the 230MB Remote Server Administration…
Charles
  • 53
  • 4
5
votes
1 answer

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
  • 615
  • 6
  • 12
  • 15
4
votes
1 answer

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 the DC's do not replicate computer accounts…
jffalmeida
  • 53
  • 2
3
votes
1 answer

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 samid to those security groups using dsmod.…
newbie
  • 51
  • 3
2
votes
2 answers

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 the group. Environment details: Multiple domain…
Ale Exc
  • 23
  • 5
2
votes
1 answer

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 next two months. The problem I'm currently facing…
Windows Ninja
  • 2,586
  • 19
  • 46
  • 70
2
votes
1 answer

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 -members -expand | dsget user -samid -disabled -c |…
1
vote
0 answers

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 works great, unless the group has a group as a…
Tvanover
  • 257
  • 1
  • 3
  • 13
1
vote
1 answer

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, Please suggest me any alternative DOS command…
1
vote
1 answer

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 "" | dsget group -members -expand | dsget user -samid -fn -ln If I just do dsquery group -name "" |…
Mark Allison
  • 2,188
  • 7
  • 26
  • 45
1
vote
1 answer

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.txt This results in an error: dsget failed:'-' is…
Npv23g
  • 320
  • 4
  • 6
  • 12
1
vote
1 answer

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=win,DC=ite,DC=com" | dsmod user -mobile "999"…
JJJJNR
  • 870
  • 6
  • 20
  • 32
1
vote
1 answer

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" but I got an unknown parameter error.
Jamie
  • 214
  • 1
  • 2
  • 12
1
2