ds command line tool question
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?
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?
Comments
-
Claymoore Member Posts: 1,637Try 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 Banned Posts: 336I'll check it out, thanks.
Im actually working with ActiveRoles at the moment and trying to sort a lot of the logistics out.
Thanks