Batch file / script to change the user limit on a share

  • Thread starter Thread starter Robb Bloomfield
  • Start date Start date
R

Robb Bloomfield

Hi,

We have 1500 users here, and we would like to set the user limit on
the user directories to 1, ideally without having to do it 1 by 1!

Does anyone have any idea of how i could do this with a batch file or
a script?

And before anyone suggests cconnect to track logons, we've tried it,
and it isn't practical :)

Thanks
 
We have 1500 users here, and we would like to set the
user limit on
the user directories to 1, ideally without having to do
it 1 by 1!

What the heck is a "user directory", what do you mean
with "user limit" and what do you mean with "1"? One
apple? One Kilobyte?
The more details you give ...
Does anyone have any idea of how i could do this with a
batch file or
a script?

Please ...
And before anyone suggests cconnect to track logons,
we've tried it,
and it isn't practical :)

You tried *what* and *why* it isn't practical to you?

Ciao, Walter (really hating things like "computer doesn't
work", "something is going wrong", "tried everything but
it doesn't help" and really, really hating it to hear from
an admin)
 
Hi Robb,

What does the "user directories" mean?

What's the "user limit"?

Would you please explain this first?

Thanks for using Microsoft News Group!

Sincerely,

Steven Liu

Microsoft Online Partner Support

MCSE 2000

Get Secure! - www.microsoft.com/security

This posting is provided "as is" with no warranties and confers no rights.
 
Robb said:
We have 1500 users here, and we would like to set the user limit on
the user directories to 1, ideally without having to do it 1 by 1!

Does anyone have any idea of how i could do this with a batch file or
a script?

Hi

If the share exists already:

net.exe share sharename /USERS:1

If the share does not exists already:

net.exe share sharename=drive:path /USERS:1


Create a batch file that loops through a text file with the user names and feed
the user names into the net.exe command.

Note that the group microsoft.public.win2000.cmdprompt.admin is the ultimate
group for command line/batch questions :-)
 
We have 1500 users here, and we would like to set the user limit on
net.exe share sharename /USERS:1

This would be the answer to his posting, yes.
But I would like to know what his problem is all about.
It sounds something weird to me.

Ciao, Walter
 
Walter said:
This would be the answer to his posting, yes.
But I would like to know what his problem is all about.
It sounds something weird to me.

He wants to limit the users to only be able to be logged on to one computer at
a time (he has tried to use the Win2k Resource Kit utility cconnect to do this
and given it up).
 
Thanks Guys, just to share, this is what i did in the end:

Directory file obtained with:

dir /a /b > users.txt

This is loaded into excel, and then exported as a .csv file. (Done
because I couldn't find the delimter for new line to use in the batch
file).

Batch file itself contains the single line:

for /f "delims=," %%A in (users.csv) do (set dollar=$& set share=%%A&
net.exe share %%A%dollar% /USERS:1)

It's a bit crude, but it does the job :)
 
Back
Top