Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 928
  • Last Modified:

domain controller: not able to map user home folder

I created a bat file and save in netlogon share folder, this is what I have in my batch file:

NET USE Q: /DELETE
NET USE Q: \\ppiser01\users\%username% /y

Before I put the batch in each user's profile "logon script", I tested within the domain admin account. I double clicked the batch, the cmd screen popped up and disappear but no user folder and Q drive created.

But when I put \\ppiser01\users\%username% in user's profile, under "Home folder" -> connect, it will create the folder and map the drive... so what is wrong with the first method?
0
okamon
Asked:
okamon
1 Solution
 
Rsilva98Commented:
Why a batch file  ?


Go to AD users and computers and choose Profile Tab on each account.

there you can give the users the home folder you want

Just choose home folder, connect, choose drive letter and put you share on it

Ex: \\server\share$\%username% (when you apply it a folder will be  createt automatically on home folder root)
0
 
pony10usCommented:
The first method (the batch file) makes the assumption that the Q drive has already been mapped so needs to delete the mapping.  This step is not a show stopper though.

The real issue is that the next command simply attempts to map the Q drive to \\ppiser01\users\%username% which if it doesn't already exist it can't map it and will return:

System error 53 has occurred.

The network path was not found.

If you run the batch file from a command line you will see this.

In the user's profile if the folder doesn't exist it will create the folder however you have no provision in your batch file to do so.


NET USE Q: /DELETE
if NOT EXIST \\ppiser01\users\%username% mkdir \\ppiser01\users\%username%
NET USE Q: \\ppiser01\users\%username% /y
0
 
tmoore1962Commented:
login batch file needs to be in the windows\sysvol\sysvol\"domain"\scripts folder.
The folder /share Users must exist. Then it should create the username folder under the users folder.  However the ownership will be the admin account and not the user account, also you have to have the permissions setup in the users folder, I've always went the extra step and did the individual folder permissions manually and tested that the desired permissions work.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now