Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Discussions
Off Topic
ds command line tool question
Jordus
Im trying to find users with a particular Office attribute (not the application, but one of the account attributes in AD) and then pipe that to be able to add them to a group.
In basic english
Find users with office with XYZ and put them into group XYZGROUP
I can do
dsquery user | dsget user -office
but that only tells me EVERY single office in the whole directory, and i obviously cant pipe that into a group.
I cant seem to make it go the other way, any ideas?
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
Claymoore
Try using Quest's AD Powershell CMDlets instead of the inferior 'ds' tools. Once you start scripting with powershell, you'll wonder how you ever got by without it...
PowerShell Commands (CMDLETs) for Active Directory by Quest Software
Edit:
The command should look something like this:
get-qaduser -offfice xyz | add-qadgroupmember -identity 'CN=group1,OU=companyOU,DC=company,DC=com'
Jordus
I'll check it out, thanks.
Im actually working with ActiveRoles at the moment and trying to sort a lot of the logistics out.
Thanks
Jordus
Wow that worked perfect, thanks!
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS