Questions tagged [dsquery]
42 questions
1
vote
2 answers
Gathering logged on username on remote computers?
This might be a tricky one that I would like to solve somehow. The company I previously was working for went bankrupt. And during the chaos, a lot of users took their company computers and left.
Now, what they don't know is that we've installed UAG…

Kenny Bones
- 5,017
- 36
- 111
- 174
0
votes
2 answers
Active Directory - list full subgroup dependency of a given group and omit subgroups without any user
I have to list full subgroup dependency of specific group - filter -> only subgroups which contain at least 1 user.
I have tried this approach:
dsquery group -samid | dsget group -members -expand | dsquery * -filter…

Doublementi
- 39
- 5
0
votes
1 answer
dsquery to retrieve multiple operating systems?
To get all operating systems in AD, I run dsquery to select all with "server" in their name:
dsquery * domainroot -filter "(&(objectCategory=Computer)(objectClass=Computer)(operatingSystem=*Server*))"
But...how do I use dsquery to get, for example,…

JeffR
- 765
- 2
- 8
- 23
0
votes
1 answer
Getting Domain for User with DSQuery | DSGet
Using DSQuery and DSGet to get user attributes that are needed to make accounts (not associated with their Windows account). The current command I've got is:
dsquery * -filter "(&(objectCategory=Person)(objectclass=User)(mail=first.last@email.com))"…

Josh Brown
- 47
- 1
- 9
0
votes
1 answer
How to filter out sub groups in DSQUERY?
In DSQUERY when finding AD objects, I want to find a DL (distribution list) or AD security group, and find all it's users (even in sub groups) and then filter out the sub groups. I have this so far
dsquery group -samid YourGroupName | dsget group…

omega
- 40,311
- 81
- 251
- 474
0
votes
1 answer
How to use dsquery to list the members of a distribution list?
I have this command to find a distribution list object
dsquery * -filter "(&(cn=*group))"
but now how can I find the users from that, I want to loop through and get their names and email addresses from it.
Thanks

omega
- 40,311
- 81
- 251
- 474
0
votes
2 answers
Using cmd pipe in the powershell Invoke-Expression
I'm trying to get all the emails and usernames from the Active Directory from the specific Organization Unit using powershell. This is my code:
function Invoke-CmdCommand {
Param(
[parameter(position = 0)]
$Cmd ,
…

Dmitrij Kultasev
- 5,447
- 5
- 44
- 88
0
votes
1 answer
How can I sort and display groups when using dsquery in powershell?
I am using this line of code in powershell and it works but it displays too much. I am trying to find and display where the group that contains "Avecto" in the name.
dsquery user -samid MyUSerName| dsget user -memberof | dsget group -samid
Is there…

Del
- 29
- 7
0
votes
1 answer
LDAP get primary group name of a user in Active Directory
There is a scenario where I need to fetch all the group names for which a particular user is a member of, using LDAP query.
The input will be: users distinguished name
and the output should be: list of groups for whom this user is a member of.
So…

mSatyam
- 531
- 7
- 25
0
votes
1 answer
Use SecureString password object in dsquery command authentication
I have followed the following guide to create a SecureString password.
Now, I need to log on to a foreign Domain Controller with the dsquery options -s (server) -u (user) and -p (password).
dsquery group -name $group -s $rmSrv -u $user -p $pass |…

JayBe
- 3
- 3
0
votes
1 answer
Active Directory - Find Mac OS X workstations
I'm hoping someone can help me with a way to query Active Directory to return just a list of Mac OS X workstations.

r_k_s
- 1
- 1
0
votes
0 answers
Batch File: It will locate a node and provide the username of currently logged into that node
Okay here's another one.
So the idea for this batch uses two loops, but I feel like I lack the proper knowledge but here we go:
Batch code:
(Please be advised, that when user's are assigned computers, they are assigned by the description. Not my…

Jash
- 31
- 2
0
votes
0 answers
winexe execute command on windows with pipe and quotes
1- dsquery user -disabled | dsget user -display -email -dept -title
2- dsquery computer -limit 1000 | sort
3- dsquery user "dc=YOURDOMAINNAME" -inactive 2 | dsget user -display -email -dept -title'
Using WINEXE on Linux, I am trying to execute…

Syed Jahanzaib
- 333
- 6
- 18
0
votes
0 answers
Dsquery accountExpires attribute including that ridiculus large number
I to create the query that will export the following: Account FirstName LastName accountexpires the OU that the user resides in. So I will fetch Account expiry dates or account Never expire (those with no expiration date) for all AD users. its…

Arbelac
- 1,698
- 6
- 37
- 90
0
votes
0 answers
XSLT 1.0 how to do Muenchian grouping?
I am trying to count the number of roles in a list. There are 3 stages, open, offer and filled. There are 2 departments; infrastructure and business. So i want to display a table with the following headings; DEPARTMENT | OPEN | OFFER | FILLED. I…

Aaron C
- 135
- 3
- 12