Answer the question
In order to leave comments, you need to log in
Those. Ivanov copies (creates) the file \\comp\share\file.txt and then \\comp\share\Ivanov\ is magically created and file.txt is transferred to it?
Those. Ivanov copies (creates) the file \\comp\share\file.txt and then \\comp\share\Ivanov\ is magically created and file.txt is transferred to it, how to set it up on a network drive?
Answer the question
In order to leave comments, you need to log in
I feel light déjà vu
How to automatically copy/move files? - look at my answer.
On the file server on the shared folder, we enable similar monitoring (the link to the monitoring script is in the answer),
then instead of the code that I gave, we use this:
$newfile=Get-Item ($folder+"\/"+$name)
$fileOwner=((Get-Acl $newfile).owner -replace "^.*\\")
$OwnerFolder=($folder+"\/"+$fileOwner)
if (-Not (Test-Path $OwnerFolder))
{
New-Item -Type directory -Path $OwnerFolder
#Set-Acl устанавливаем нужные acl для папки
}
Move-Item $newfile -Destination $OwnerFolder
#Set-Acl устанавливаем нужные права на файл в случае необходимости
Wave your magic wand and say
And if, in fact, you need to clarify why it was needed at all.
Alternatively, all events in the file system are logged and you can set an action for each of them, including copying to another location. But this is a low-performance crutch. To give a more sensible solution, you need to understand why this is needed.
By standard means - in any way. Unless you can script through all the files once a minute and scatter them into folders.
It's an idiotic situation to give users access to folders by name
, that is, just here \\comp\share\Ivanov\
and let them create it right away
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question