On Wed, 01 May 2013 19:43:18 +0200, Herbert Kleebauer <
kl...@unibwm.de> wrote:
>On 01.05.2013 18:39, Jürgen Meyer wrote:
>
>>>> The following works on a German Win7 System:
>>>> Net Share Memories=C:\ProgramData\Memories /Grant:Jeder,Change
>>>>
>>>> Jeder means Everyone
>>>> But Everyone doesn't work on a German system.
>
>>> Did you actually try "Everyone" instead of "Jeder"?
>>
>> Yes, of course.
>> Same error 1322
>> Some items are translated in the German version, some not.
>
>Are you sure that "/Grant:Jeder" simple means a user with the name
>"Jeder"? From the German Microsoft Book "Windows-Administration – Die
>technische Referenz":
>
> Da beim Erstellen von Freigaben mit den Werkzeugen der
> Benutzeroberfläche standardmäßig nur die Zulassungsberechtigung
> Lesen für Jeder gewährt wird, sollten Sie Freigaben stattdessen
> mit dem Befehl net share und der Option /grant:everyone, full
> anlegen und gleichzeitig die Berechtigungen zuweisen.
Hello Herbert,
Tnx for the answer.
Not all what you find in a book is correct.
Do you ever have tried that example on a German system yourself?
'Everyone' definitely won't work.
The first problem is that Everyone or Jeder is treated as a normal name like
Peter, John etc.
So the entry differs in every language.
This also applies to other expressions like User=Benutzer etc.
The second problem it that Net Share does not accept a SID after /Grant:
A command like this will not work:
Net Share Memories=C:\ProgramData\Memeories /Grant:'S-1-1-0',Change
But I now found a solution.
At first one need to resolve the name from the SID.
A list of the most important SIDs you will find here:
http://support.microsoft.com/kb/243330
The batch now looks like this:
set MySid=S-1-1-0
for /f "delims= " %%a in ('"wmic path win32_account where SID='%MySid%' get
name"') do (
if not "%%a"=="Name" (
set myvar=%%a
goto :loop_end
)
)
:loop_end
net share Memories /Delete
net share Memories=C:\ProgramData\Memories /grant:%myvar%,change
If someone knows a shorter way to get the name from the SID, please let me
know.
Juergen