• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

A little bit of dsquery/dsmod help

The Keeper

Senior member
I hope we have plenty of people around here who knows their AD scripting. 🙂

Well anyway. I have pretty simple bat file that disables user accounts.
@ECHO OFF
Set INPUT=
SET /P INPUT=Type username: %=%
dsquery user -samid %input% | dsget user -memberof > c:\disabled_userst\%input%.txt
dsquery user -samid %input% | dsmod user -disabled yes
dsquery user -samid %input% | dsmove -newparent ou="Disabled Users"dc=company,dc=com

I'd like to expand that bat file to do more. As it already writes a txt file where there are distinguished names of all groups the user is part of, I'd like to expand on that by removing the user from these groups. But even after an hour of googling, I couldn't figure it out right.

Anybody here who could lend a hand?
 
Back
Top