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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Issue + Home folder doesn't show sometimes!

Status
Not open for further replies.

rflora

Technical User
Nov 26, 2003
80
CA
Hello, I posted the below in Windows 2003 Server Forum, but they have asked me to post it here.

I have a Windows 2003 Server and about 30 XP Clients. I've configured user profile to map a home folder, drive H: What happens is that sometimes the H: drive shows up and sometimes it doesn't. I'm not quite sure why. I also use a login script through group policy. The script i use is from tek-tips Everythings is working, except for the H: not showing at times. I've tried to comment out, Disconnect all drives from the login script, i thot maybe it's being disconnected by the script. But the problem remains. Sorry for the long post.

Thanks for the help in advance.

Below are three problems I can't seem to reslove.

1)I still have the same problem where H: drive doesn't show up "somtimes", which is mapped through User Profile in AD.

2) The links that are mapped through the script below are sometimes not accessible. I get the the following message. "The referenced account is currently locked out and may not be logged on to." To make them work, i have to restart the computer. This problem was only on my computer initially and today one other user had the same prob.

3) Sometime H: (mapped through User Profiles) and K: (mapped using the script below) point to the same directories!!

All these problems are random. Please HELP, what the hell is going on, what am i doing wrong?!?! Below is the script I use.

'==========================================================
' NAME: LogonScript.vbs
'
' AUTHOR:
'
'COMPANY:
'==========================================================
'
'
ON ERROR RESUME NEXT
'
Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path
'
'
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")
'
UserString = WSHNetwork.UserName
'Bind to the user object to get user name and check for group memberships later
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
'
'==========================================================
'Synchronizes the time with Server our NTP Server
'WSHShell.Run "NET TIME \\FLSHQ /set /y"
'==========================================================
'
'
'
'==========================================================
'Disconnect any drive mappings as needed.
'WSHNetwork.RemoveNetworkDrive "G:"
'WSHNetwork.RemoveNetworkDrive "J:"
'WSHNetwork.RemoveNetworkDrive "K:"
'WSHNetwork.RemoveNetworkDrive "L:"
'WSHNetwork.RemoveNetworkDrive "M:"
'WSHNetwork.RemoveNetworkDrive "N:"
'WSHNetwork.RemoveNetworkDrive "O:"
'WSHNetwork.RemoveNetworkDrive "P:"
'WSHNetwork.RemoveNetworkDrive "R:"
'WSHNetwork.RemoveNetworkDrive "S:"
'WSHNetwork.RemoveNetworkDrive "T:"
'WSHNetwork.RemoveNetworkDrive "W:"
'WSHNetwork.RemoveNetworkDrive "X:"
'WSHNetwork.RemoveNetworkDrive "Y:"
'==========================================================
'
'
'==========================================================
'Disconnect ALL mapped drives
Set clDrives = WshNetwork.EnumNetworkDrives
For i = 0 to clDrives.Count -1 Step 2
WSHNetwork.RemoveNetworkDrive clDrives.Item(i)
Next
'
'Give the PC time to do the disconnect, wait 300 milliseconds
wscript.sleep 300
'==========================================================
'
'
'
'==========================================================
'Map drives needed by all
WSHNetwork.MapNetworkDrive "K:", "\\Flcluster\HomeFolders",True
WSHNetwork.MapNetworkDrive "R:", "\\Flcluster\Research",True
WSHNetwork.MapNetworkDrive "G:", "\\Flcluster\General Share",True
WSHNetwork.MapNetworkDrive "P:", "\\Flcluster\Pictures",True
'==========================================================
'
'
'
'==========================================================
'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups
Select Case GroupObj.Name
'Check for group memberships and take needed action
'In this example below, IT Admin and Accounting are groups.
'
Case "IT Admin"
WSHNetwork.MapNetworkDrive "N:", "\\cluster\Information Technology",True
WSHNetwork.MapNetworkDrive "W:", "\\cluster\Software",True
Case "Accounting"
WSHNetwork.MapNetworkDrive "J:", "\\cluster\Accounting",True
WSHNetwork.MapNetworkDrive "T:", "\\cluster\data",True
Case "Marketing"
WSHNetwork.MapNetworkDrive "M:", "\\cluster\Marketing",True
Case "Sales"
WSHNetwork.MapNetworkDrive "S:", "\\cluster\Sales",True
Case "Human Resources"
WSHNetwork.MapNetworkDrive "X:", "\\cluster\Human Resources",True
Case "Administration"
WSHNetwork.MapNetworkDrive "Y:", "\\cluster\Administration",True
WSHNetwork.MapNetworkDrive "N:", "\\cluster\Information Technology",True
Case "Legal"
WSHNetwork.MapNetworkDrive "L:", "\\cluster\Partnerships & Corporations",True
Case "FLWMS"
WSHNetwork.MapNetworkDrive "O:", "\\cluster\FLWMS",True
End Select
'
Next
'==========================================================
'
'
'
'==========================================================
'Remove ALL old printers
'Enumerate all printers first, after that you can select the printers you want by performing some string checks
'Set WSHPrinters = WSHNetwork.EnumPrinterConnections
'For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2
'To remove only networked printers use this If Statement
' If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then
' WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
' End If
'==========================================================
'
'
'
'
'==========================================================
'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above
'WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True
'Next
'==========================================================
'
'
'
'==========================================================
'Remove a specific printer
'WSHNetwork.RemovePrinterConnection "\\ServerOld\HP5si",True,True
'==========================================================
'
'
'
'==========================================================
'Install Printers
'WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"
'WSHNetwork.AddWindowsPrinterConnection "\\Flcluster\HP LaserJet 1200 Series PCL"
'==========================================================
'
'
'
'==========================================================
' This section of script will prevent the baloon window that appears when printing
' to a network shared printer after XP Service Pack 2 is installed.
'
Path = "HKCU\Printers\Settings\EnableBalloonNotificationsRemote"
WshShell.RegWrite Path, 0 ,"REG_DWORD"
'
'Clean Up Memory We Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
Set WSHPrinters = Nothing
'==========================================================
'
'
'
'==========================================================
'Quit the Script
wscript.quit
'==========================================================
 
Is anyone there? I need to fix this prob ASAP. Please Help!
 
Ah, but you made me sad by removing my name from the script. [sadeyes]
Setting the home directory via the user profile is still in the user properties page for compatibility with NT4. Assuming you are no longer using NT4, you should map the user drive via the script. An example is in the original FAQ.

Your issues lead me to believe you have a syncronization problem between domain controllers and not a problem with the script. refer to my FAQ faq96-4733 for some troubleshooting steps, after you have thoroughly reviewed your server DNS, System and replication logs.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Hi Mark,

Thanks so much for the reply, sorry about your name, no hurt feelings.

No I have two DC's and they're both 2003. I had replication issue, but now I don't really get any error's or warnings in the event viewer, and I have checked to see that things get replicated, and they have been. So this led me to believe that I've resolved the replication issue. Last month (8/9/20006) I got this warning under File Replication Service on both servers at the same time.

"The File Replication Service is having trouble enabling replication from R1 to B1 for c:\windows\sysvol\domain using the DNS name r1.HQ.local. FRS will keep retrying.
Following are some of the reasons you would see this warning.
[1] FRS can not correctly resolve the DNS name r1.HQ.local from this computer.
[2] FRS is not running on r1.HQ.local.
[3] The topology information in the Active Directory for this replica has not yet replicated to all the Domain Controllers

There hasn't been any warning since. I get this Information message

The File Replication Service is no longer preventing the computer ROADRUNNER from becoming a domain controller. The system volume has been successfully initialized and the Netlogon service has been notified that the system volume is now ready to be shared as SYSVOL.

Please help in understand if I have a replication issue or not. I just made a change in B1's DNS, and it successfully got replicated on R1 as well. So what does all this mean?

I really appriciate your help.
 
Most replication issues are from DNS misconfiguration.

Verify DNS setup on each DC.

DNS Settings:

Configure the server NIC to only list itself or other DCs, no ISP DNS gets configured on the NIC TCP/IP properties.

In DHCP, set the DNS scope option to only provide the IP of your local DNS server

For any statically configured IPs, make sure the DNS only lists local DNS servers and not ISP DNS.

In the DNS snap-in on the forwarders tab enter your ISP DNS.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Hey Mark,

Thanks again for the quick response. Here's what my current config looks like.

1)
R1 DNS settings: Primary: B1's ip address
Secondary: R1 local ip address

B1 DNS settings: Primary: R1's ip address
Secondary: B1's ip address

2)
B1 is also acting as the DHCP Server
DHCP Scope Options
DNS Server: R1's ip, B1's ip
DNS Domain Name: hq

3) Any PC with a static ip has only R1 as Primary DNS and B1 as Secondary.

4) DNS Snap-in
Forwarders Tab: has only ISP DNS Server IPs


 
Here are some of the logs .. Other than these, i don't have any other serious ones. Thanks for helping me out.

Application
Warning 9/21/2006 @ 8:58pm:
Event ID: 1202 Source: SceCli
Desc: Security policies were propagated with warning. 0x534 : No mapping between account names and security IDs was done.

System
Error 9/24/2006: Event ID: 10005 Source: DCOM
Desc. DCOM got error "The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. " attempting to start the service ntmssvc with arguments "-Service" in order to run the server:
{D61A27C6

Warning
Event id: 36 Source: W32Time
Desc: DCOM got error "The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. " attempting to start the service ntmssvc with arguments "-Service" in order to run the server:
{D61A27C6

DNS Server
Error: 9/9/2006
Event ID: 4004 Source: DNS
Desc: The DNS server was unable to complete directory service enumeration of zone flshq.local. This DNS server is configured to use information obtained from Active Directory for this zone and is unable to load the zone without it. Check that the Active Directory is functioning properly and repeat enumeration of the zone. The extended error debug information (which may be empty) is "". The event data contains the error.
 
I think you need to focus on this error right now.
DNS Server
Error: 9/9/2006
Event ID: 4004 Source: DNS
Desc: The DNS server was unable to complete directory service enumeration of zone flshq.local. This DNS server is configured to use information obtained from Active Directory for this zone and is unable to load the zone without it. Check that the Active Directory is functioning properly and repeat enumeration of the zone. The extended error debug information (which may be empty) is "". The event data contains the error.

Take a look here:

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top