Hi,
I’m running a server with few clients PCs. I want to restrict users using Text file on their PCs. Hence I created a Batch file which is as follow:
It should restrict the users but don’t know why it gets failed. This is the error message I received while running the same:@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
set user="!user:"=!"
@echo DSMOD USER !user! -desc Disabled -disabled yes
DSMOD USER !user! -desc Disabled -disabled yes
@echo.
)
endlocal
--text file--
"CN=Lastname,CN=Firstname,CN=Users,DC=test,DC=com"
"CN=Madeup,CN=Name,OU=Test,DC=test,DC=com"
etc
“dsmod failed:CN=Lastname,CN=Firstname,CN=Users,DC=test,DC=com\ :A referral was sent from the server.”
Any idea how can I make it work? Please help.
Bookmarks