[英]azure file share map to folder based on clients?
Hello Every azure file share map to folder based on clients?您好,每个 azure 文件共享 map 到基于客户端的文件夹?
I have 300 clients and each have there own files to upload on ADFS.我有 300 个客户端,每个客户端都有自己的文件要上传到 ADFS。 I want to map drive but folder which is only associated with that client not root folder.
我想要 map 驱动器,但文件夹只与该客户端相关联,而不是根文件夹。
so will this be possible with ADSF or any option?那么这可以通过 ADSF 或任何选项实现吗?
Azure file share map to folder based on clients.
Azure 文件共享 map 到基于客户端的文件夹。
We can do this in two ways.我们可以通过两种方式做到这一点。
Approach 1方法一
One way is to map a drive for each client with their own files on ADFS by creating a folder for each client and has to use the ADFS drive mapping feature to map the client's folder as the root directory for their drive.一种方法是通过为每个客户端创建一个文件夹并将 map 客户端的文件夹作为其驱动器的根目录来使用 map 客户端的文件夹作为其驱动器的根目录,从而为每个客户端在 ADFS 上创建一个文件夹,并且必须使用 ADFS 驱动器映射功能。
And this can be done by using the net use
command in Command Prompt
by specifying the client's folder as the target directory.这可以通过在
Command Prompt
中使用net use
命令将客户端的文件夹指定为目标目录来完成。
net use [drive letter:] [\server name\share name] [password] /user:[username] net use [盘符:] [\服务器名\共享名] [密码] /user:[用户名]
For example, To map the drive letter X to the folder "\adfs-server\client1files" for a user named "client1" with the password "client1password", you would use the following command:例如,要将名为“client1”且密码为“client1password”的用户的驱动器盘符 X 复制到文件夹“\adfs-server\client1files”,您可以使用以下命令:
net use X: \\adfs-server\client1files client1password /user:client1
Approach 2方法二
Another way is to use a script to automate the process, in this way you do not need to manually map the drive for each client.另一种方法是使用脚本来自动执行该过程,这样您就不需要手动为每个客户端驱动 map。
for this you need to create the script into a.bat file and have run based on requirement.为此,您需要将脚本创建到 a.bat 文件中并根据要求运行。
Script Example
net use P: "\\server\foldername\foldername"
@echo off
setlocal
rem Define variables for the server name, share name, and client information
set server=\\adfs-server
set share=clientfiles
set username=client
set password=clientpassword
rem Iterate through the clients and map their drive
for /l %%i in (1,1,300) do (
set clientnum=%%i
set driveletter=%%i
rem Map the drive for the current client
net use %driveletter%: %server%\%share%%clientnum% %password% /user:%username%%clientnum%
rem Confirm the drive mapping
echo Drive %driveletter%: has been mapped to %server%\%share%%clientnum% for %username%%clientnum%
)
References taken from参考资料取自
Thanks @ Ruud for the lazyadmin blog.感谢@Ruud 的 lazyadmin 博客。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.