Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AD User Home Share Problem 1

Status
Not open for further replies.

goickle

IS-IT--Management
Jan 9, 2006
17
0
0
US
I have the user home share mapping H: to \\server\share\%username% in AD.
It maps fine. The problem is with laptop users. If I have them map the drive manually as a permanent connection with the full path while online, when they are not on the network it shows up as H: share on server. We have quite a few users and really need it to map directly to their folder for when they VPN in. If I map a permanent connection on any other drive letter it works fine. The Laptops are all XP SP2 and we are running AD on 2003 server. Any ideas on how to get around this?
 
Hi,

We have several laptop users as well... We don't have to make any changes to the system...

They inially log on to the domain and got their homedir at H:. Caching the credentials of Windows XP solves it for us, the homedir automatically synchronizes and is available offline.

I don't know how you set the GPO, but with no settings in the GPO, this is the way it should work.

Regards, Sybje
 
Map the drive letters to H: using login script rather than using the AD property which is there strictly for legacy purposes for use with domains that still have NT4 mixed in.

Refer to my FAQ faq329-5798 on login scripts for help with that and to clear all existing users AD home drive properties use this script:

Code:
'==========================================================================
'
' NAME: ClearHomeDirectory.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE  : 12/11/2006
' COPYRIGHT (C) 2006 The Spiders's Parlor
'
' COMMENT: Removes legacy homeDrive and homeDirectory profile settings from AD.
'
'    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
'    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
'    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'    PARTICULAR PURPOSE.
'
'    IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS 
'    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
'    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
'    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
'    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
'    OF THIS CODE OR INFORMATION.
'==========================================================================

On Error Resume Next
Dim WSHShell,WSHProcess
Const ADS_PROPERTY_CLEAR = 1 

'This section will find the logon server
Set WSHShell = CreateObject("Wscript.Shell")
Set WSHProcess = WSHShell.Environment("Process")
DomainLogonServer = WSHProcess("LogonServer")

'Now we will query user accounts on the logon server
strComputer = Right(DomainLogonServer,Len(DomainLogonServer)-2)
WScript.Echo strComputer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_UserAccount",,48)

'Now we enumerate through the users, find the distinguishedName and clear the home directory
For Each objItem In colItems
   userName = objItem.Name
   userDN = SearchDistinguishedName(userName)
   'Bind to the user object & clear the home directory settings
   Set objUser = GetObject("LDAP://" & userDN)
   objUser.PutEx ADS_PROPERTY_CLEAR, "homeDirectory", 0
   objUser.PutEx ADS_PROPERTY_CLEAR, "homeDrive", 0
   objUser.SetInfo
   Set objUser=Nothing
   Err.Clear   
Next


Public Function SearchDistinguishedName(ByVal vSAN)
    ' Function:     SearchDistinguishedName
    ' Description:  Searches the DistinguishedName for a given SamAccountName
    ' Parameters:   ByVal vSAN - The SamAccountName to search
    ' Returns:      The DistinguishedName Name
    Dim oRootDSE, oConnection, oCommand, oRecordSet

    Set oRootDSE = GetObject("LDAP://rootDSE")
    Set oConnection = CreateObject("ADODB.Connection")
    oConnection.Open "Provider=ADsDSOObject;"
    Set oCommand = CreateObject("ADODB.Command")
    oCommand.ActiveConnection = oConnection
    oCommand.CommandText = "<LDAP://" & oRootDSE.get("defaultNamingContext") & _
        ">;(&(objectCategory=User)(samAccountName=" & vSAN & "));distinguishedName;subtree"
    Set oRecordSet = oCommand.Execute
    On Error Resume Next
    SearchDistinguishedName = oRecordSet.Fields("DistinguishedName")
    On Error GoTo 0
    oConnection.Close
    Set oRecordSet = Nothing
    Set oCommand = Nothing
    Set oConnection = Nothing
    Set oRootDSE = Nothing
End Function

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Actually I tested using your scripts and they are definitely useful and might just work. The only other problem I am having now is with the wireless on the laptops. On XP laptop users authenticate using the stored cache. Because of this they do not get the logon script applied. The wireless connection is established after the logon. Any ideas or workarounds for this problem?
Thanks,
George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top