Questions tagged [dsquery]

42 questions
21
votes
5 answers

Where can I get dsquery and other tools useful for debugging Active Directory issues?

The dsquery command line tool is mentioned in the solution to several questions about Active Directory. However, my workstation does not have this command line tool. Where do I get it?
Brandon DuRette
  • 4,810
  • 5
  • 25
  • 31
4
votes
2 answers

How can I query users with an expired password in Active Directory?

I need to query Active Directory for a list of users whose password is about to expire. The obvious (and easy) way to do this is with: dsquery user -stalepwd n The problem is that I need to add additional filters to only look for users who are in…
Geoff Armstrong
3
votes
1 answer

Active Directory referral chasing issue

Maybe someone who has more experience with Active Directory can help me. I need to get info such as OS, name, FQDN from a computer in a different domain. I will explain what I mean. I have root domain: example.com, with 2 subdomains:…
2
votes
1 answer

Get-ADGroup returns different ObjectGUID than dsquery

Can someone explain how to get the ObjectGUID the same as is returned from dsquery except using powershell? As an example. Powershell Get-ADGroup "MyGroup" -Properties ObjectGUID 32359aec-2e77-4b0c-b525-3e9a39083314 dsquery (application uses…
whoisearth
  • 4,080
  • 13
  • 62
  • 130
2
votes
7 answers

Openfiles query to see open files

How can I call the Openfiles.exe (which is on the server 2008 file server) remotely from a computer to see which files are open by the users? I also need to have it login as the domain admin user in the parameters.
user3314399
  • 317
  • 4
  • 9
  • 23
2
votes
2 answers

Issue with trying to pass variable into [adsisearcher]

I apologize in advance if this is something simple, but I've been researching for a few days now and unable to resolve on my own or find another route to explore. Essentially I have the below which works and returns exactly what I…
2
votes
3 answers

How to handle multiple 'for' statements in a batch file?

I am attempting to create a batch file which will take a list of users from a text file, run a dsquery against Active Directory to determine if the account has been disabled or not, and then output the results to a different text file containing the…
Zack H
  • 23
  • 4
2
votes
1 answer

dsmod user title - Value for 'Target object for this command' has incorrect format

I want to edit a large number of users' title field on Active Directory that I have listed in a CSV file. I can get every attribute associated with a user if I run this: dsquery * domainroot -filter…
user3122456
  • 43
  • 1
  • 8
2
votes
1 answer

Add commas to dsquery output

So I'm writing a batch file that will be run by a scheduled task. This file executes a DSQuery for certain attributes of users in AD. Here's my query: dsquery user ou=org_unit,dc=company,dc=local -name * -limit 0 | dsget user -dn -email -tel…
user1681573
  • 893
  • 1
  • 9
  • 13
1
vote
1 answer

Tkinter Checkboxes to change lookup command

hoping someone can help me. I have the working code below that creates a UI for looking up the name of an AD user and Looking up a users AD Groups. It all works fine as IS. import tkinter from tkinter import * from tkinter import messagebox from…
Steve
  • 57
  • 5
1
vote
0 answers

ICommonQuery::OpenQueryWindow. No Administrative context menu in search results

I tried to invoke Active directory search window from my application with administrative and other extended features. For this purpose I'm using such flags: DSQPF_ENABLEADMINFEATURES | DSQPF_ENABLEADVANCEDFEATURES; As described in…
kelzhadant
  • 11
  • 1
  • 1
1
vote
1 answer

How to pipe specific cmd output line to another batch?

How to pipe specific cmd output line to another batch? For example: command DSQUERY USER -samid *loginname* | DSGET USER -loscr It finds what user in AD has in his Logon script field, what is actual login script name. I want to pipe this output to…
AlexSun.dr
  • 61
  • 1
  • 4
1
vote
2 answers

VBS script to report AD groups - Regex pattern not working with multiple matches

Having an issue with getting a regex statement to accept two expressions. The "re.pattern" code here works: If UserChoice = "" Then WScript.Quit 'Detect Cancel re.Pattern = "[^(a-z)^(0,4,5,6,7,8,9)]" re.Global = True re.IgnoreCase = True if…
Kenny
  • 141
  • 1
  • 2
  • 13
1
vote
1 answer

dsquery computer with no description

I'm trying to make a batch script to list all laptops in my domain that doesn't have a computer description. I can't seem to make DSQUERY find computers without descriptions Example: DSQUERY Computer -name [COMPUTERNAMES]* -desc "" -limit 0 | dsget…
1
vote
3 answers

Determining if a given user is in a given global group

I’m trying to search through Active Directory using the AD module in PowerShell. I’m trying to determine whether a given user is in a given global group. The issue is that I’m using -match meaning if there is a username that contains another within…
Richard
  • 6,812
  • 5
  • 45
  • 60
1
2 3