Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > Another DSMOD question

Reply
Thread Tools Display Modes

Another DSMOD question

 
 
Pete Jones
Guest
Posts: n/a

 
      04-20-2010

Hopefully a fairly simple one this.

I am using a script to automate disabling old unused accounts.

@echo off
if {%1}=={} @echo Syntax: disableDNs FileName&goto :EOF
if not exist %1 @echo Syntax: disableDNs %1 not found.&goto :EOF
setlocal ENABLEDELAYEDEXPANSION
set file=%1
@echo.
for /f "Tokens=*" %%u in ('type %file%') do (
set user=%%u
rem set user="!user:"=!"
@echo DSMOD USER !user! -desc Disabled -disabled yes
DSMOD USER !user! -desc Disabled -disabled yes
@echo.
)
endlocal

What I would like to do is have the -desc Disabled append the date the
script is run. That way I can see how long the account has been disabled. So
obviously I need a mm/yy format.

What is the correct syntax? Should I be using quote marks?
--
Pete Jones

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about CSV (Clustered Shared Volumes) Ehren Clustering 6 03-19-2010 06:21 PM
DC and DNS server question Jason Huang Active Directory 4 01-30-2010 11:11 PM
AD Site Question Chris Active Directory 7 01-26-2010 03:14 PM
DNS MX Question ChrisUK Windows Small Business Server 15 01-16-2010 02:53 PM
Question about Upgrade version tsonka Windows Vista Installation 3 12-09-2007 09:07 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59