?
Solved

GPOs & Logon scripts

Posted on 2014-02-19
9
Medium Priority
?
374 Views
Last Modified: 2014-06-11
I'm trying to change the logon script for the users located under a particular OU. They currently have their home directory pointing to U: \\servername\users\%username%. I want to change it to U: \\network\users\%username%. I added the following command lines to the logon script:

net use u: /delete
net use u: \\network\users\%username%

Saved the file and then closed it. But when I logon as a user from this OU or try and force GOP updates by running the gpupdate command. The user's U: drive continues to point to the \\servername\users\%username% instead of \\network\users\%username%

What step am I missing?
0
Comment
Question by:dowhatyoudo22
7 Comments
 
LVL 23

Expert Comment

by:Patrick Bogers
ID: 39871313
If now trying by GPO is there any chance of a logon script given to the user in AD?
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 39871314
how do users have set that \\servername\users\%username%?
also with GPO you unlinked from that OU?
or do they have it set i user account properties as home folder?
0
 

Author Comment

by:dowhatyoudo22
ID: 39871400
there is a logon script configured in the user profile>logon script field under the profile tab in ADUC. How do I find that script?
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 23

Expert Comment

by:Patrick Bogers
ID: 39871415
In sysvol folder
0
 
LVL 38

Expert Comment

by:Mahesh
ID: 39871425
try below
net use * /d /y
net use U: \\network\users\%username%

Just ensure that Home drive is not set in AD user properties with same drive letter as previous, otherwise it will apply 1st on user logon and your batch file is getting ignored.

One another way:
Select all affected users in OU and go to properties.
On profiles tab enter new path with new drive letter with \\network\users\%username% variable for all users and select apply
This will pre create home folders for all affected users in advance

Then add batch file as a user logon script
net use u: /d /y
where U: represents old drive map letter pointing to old path

Mahesh
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 2000 total points
ID: 39872001
A script defined as just "batchfile.cmd" without a path in the user login script setting will be in the NETLOGON share which is in C:\Windows\SYSVOL\sysvol\domain.local\SCRIPTS by default on your DC's.

Probably easiest would be to blank out what that script does, implement it using script in the other OU's and new one in the OU you want.

Or better do without the scripts and use group policy preferences.  You just define a drive, where it maps to and any conditions such as group memberships and it does it for you as part of policy during logon.

Steve
0
 

Author Comment

by:dowhatyoudo22
ID: 39887096
I was able to locate the script, that is assigned under AD for these users. Thanks!! It doesn't really do anything but replace host files. Their home drive's are configured under AD and they have a script via group policy that maps the drive as intended.

adding the delete command and then trying to recreate the mapped drive to another location doesn't still doesnt work. Its only a hand full of users so I'm just making the changes manually. For now....
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question