Re: dsmod utility

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jerold Schulman (Jerry_at_jsiinc.com)
Date: 08/06/04


Date: Fri, 06 Aug 2004 10:42:11 -0400

On Thu, 5 Aug 2004 13:35:26 -0700, "Jeff" <anonymous@discussions.microsoft.com>
wrote:

>I need to find a way to script the dsmod utility to
>automatically remove users from certain groups on logon.
>Everything works except that this utility requires the
>full distinguished name of the user. How can I capture
>this and pass it to the utility?

See tip 7335 in the 'Tips & Tricks' at http://www.jsiinc.com

set DN=N
for /f "Tokens=*" %%u in ('dsquery user -samid %username%') do (
set dn=%%u
)
if "%DN%" EQU "N" goto error

%DN% contains the distinguished name.

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com



Relevant Pages

  • authentication issues
    ... Windows XP), I have both 'Basic authentication' and 'Integrated Windows ... If I try to capture the userid by using ... the Challenge/Response logon box does not show up. ... Capture the userid after the user enters his userid in the appeared logon ...
    (microsoft.public.inetserver.iis.security)
  • Re: help im new using a computer
    ... >Hello, my computer will not allow me to logon at all, it ... >has an error message on the black screen whenever I turn ... Windows: General MVP ...
    (microsoft.public.win2000.new_user)
  • Re: disabled computer objects in AD
    ... logon unless you reset it. ... Windows: General MVP ...
    (microsoft.public.win2000.general)
  • Re: My only Global Catalogue server crashed
    ... Now no user can logon ... Windows: General MVP ...
    (microsoft.public.win2000.active_directory)
  • Re: Users Account
    ... >Is there a way to check when was the last logon of a ... If you have a Windows XP Pro workstation, or a Windows Server 2003 domain ... Jerold Schulman ... Windows: General MVP ...
    (microsoft.public.win2000.active_directory)