woody Posted November 28, 2005 Posted November 28, 2005 At the moment, we have several drives mapped through a script that is run through GP. We are testing laptops on the network with a wireless connection. The problem is, if the wireless takes a little too long to connect when logging on, the scripts don't run and the drives don't get mapped. I thought of mapping the drives manually and set them to reconnect at logon, but of couse when I do this, if the script runs as well, you get an error saying that the local drive is already taken. Is there an easy way to edit this script so that it only maps the drive if that letter isn't already taken?? Here is the script I use: ---- Dim pub Set pub = CreateObject("Wscript.Network") pub.MapNetworkDrive "P:","\\Currserv3\public" ---- I want something like, if P: is taken do nothing else continue Make sense? My other alternative is to put all the laptops in a seperate GP where the script doesn't run, but I would like to try the script route first. Thanks
StewartKnight Posted November 28, 2005 Posted November 28, 2005 I map the drives in GP, and it works fine, not a script to map the drives!
Geoff Posted November 28, 2005 Posted November 28, 2005 Disable asynchronous processing with the policy setting "Always wait for the network at computer startup and logon". This is found in the computer configuration/administrative templates/system/logon.
Guest Posted November 28, 2005 Posted November 28, 2005 Agree with the above. Can also help with long logons with wired PCs
StewartKnight Posted November 28, 2005 Posted November 28, 2005 or.... add the script to each machine at: Docs & settings All Users Start Menu Programs Startup Thats what I do for the laptop printers script!
Geoff Posted November 28, 2005 Posted November 28, 2005 Yes but if the script runs before the network connection is there it still wont work.
woody Posted November 28, 2005 Author Posted November 28, 2005 Disable asynchronous processing with the policy setting "Always wait for the network at computer startup and logon". This is found in the computer configuration/administrative templates/system/logon. I have already tried this plus a few other options, but they don't seem to work. I can still log on and not receive the mapped drives. It usualyy takes me a few attempts at logging on depending on the level of signal before it catches up and runs the scripts. I thought if I manually map the drives, they will sit there happily even if not connected wirelessly until the connection becomes live.
Geoff Posted November 28, 2005 Posted November 28, 2005 Lazy way to do it is to stick a delay in the login script. Complicated way is to rewrite it as VBS and let it run in a loop that checks for network avaliability and then sets up the drive mappings after its made sure the network is there.
OverWorked Posted November 28, 2005 Posted November 28, 2005 I've always been plagued by this problem, even (though less frequently) on wired machines. Stewart - how do you map drives in GP without a script? I didn't think this was possible. I have GP set a logon script that maps drives and connects printers, but it doesn't always work. Does anyone have a script then does what Geoff suggests? It seems like the best answer. (I'm pretty hopeless at VBS).
Ric_ Posted November 28, 2005 Posted November 28, 2005 The default in XP is for mapped drives to be synchronised. If this is the case, they will be available for reconnection. If you have disabled synchrnisation, maybe try re-enabling it on one of the drives to see if it helps.
Geoff Posted November 28, 2005 Posted November 28, 2005 You'd have to loop in a while loop constantly querying the Win32_NetworkAdapter WMI object.
DMcCoy Posted November 28, 2005 Posted November 28, 2005 Is windows being allowed to control the wireless connection directly? On some belkin cards I have the utility allows you to specify that you want windows to control it, otherwise things like wep etc are only configured when the card utility is run at login. XP SP2 is a great help, I'm not running any of the client utilities anymore, just install the driver and configure the windows wireless for the rest.
OverWorked Posted November 29, 2005 Posted November 29, 2005 @DMcCoy I had the same problem with Belkin cards, and others. The trouble with the vendor's utilities is that they don't run until the user logs on, so its useless if you're logging on to a domain - you need it to be running when the machine boots up. I quickly gave up using the vendor's utilities for this reason, and just let XP manage the wireless connection.
woody Posted November 29, 2005 Author Posted November 29, 2005 XP manages the wireless before you log on? How do you get it to do this? Every time I log on, it takes a few seconds before the wireless connects. I would love to get them to connect the minute they are switched on.
Geoff Posted November 29, 2005 Posted November 29, 2005 The Windows Zero Configuration Service. You also need a W2k3 server with the appropriate WiFi GPO setup.
OverWorked Posted November 29, 2005 Posted November 29, 2005 On the wireless connection's properties, under the 'Wireless Networks' tab, check the 'Use Windows to configure my wireless network settings' If it's not visible, then the vendor's utility is managing the connection, and you'll have to look there to disable it first, to allow windows to configure the wireless connection. If you're on a domain, this is essential, as the machine has to log on to the domain when it boots up, otherwise domain users won't be able to log on.
Dos_Box Posted November 29, 2005 Posted November 29, 2005 Just to add my tuppence worth. We have found many instances of the Windows Zero Configuration Service actually providing a worse connection rate and causing random disconnects as opposed to the manufacturers own drivers and management software. Intel 2200BG wireless chipsets and Buffalo basestations are a good example of this. If you use the native Windows management yoiu have many connection problems. If you use Intels own management software there are no problems whatsoever. Strange.
Geoff Posted November 29, 2005 Posted November 29, 2005 Do your access points all have the same SSID Dox Box?
jonny_valentine Posted November 30, 2005 Posted November 30, 2005 Some network cards do not initialise until the log on screen appears, this messes startup scripts up, but wont affect logon scripts, i even have this at one school on winXP sp2, not even wireless cards. Mark, surely your map network drive is in the logon script? Anyway, you can simply try: On Error Resume Next Dim NetDrives Dim i Set NetDrives = WSHNetwork.EnumNetworkDrives If NetDrives.Count <> 0 Then For i = 0 To NetDrives.Count - 1 WSHNetwork.RemoveNetworkDrive NetDrives(i) Next End If That should remove your network drives. You could even check for just the P: drive and remove that only. if not then try : CreateObject("WScript.Shell").Run "net.exe use P:" & " /delete", 0, True WScript.Sleep 250 This will delete the mapping first jon
kevinmcaleer Posted November 30, 2005 Posted November 30, 2005 or you could use: net use p: /d net use p: \\server\share in a .bat or .cmd file much more concise! -Kev
DMcCoy Posted November 30, 2005 Posted November 30, 2005 The Windows Zero Configuration Service. You also need a W2k3 server with the appropriate WiFi GPO setup. You don't actually need to use zero config, I only have a handful of wireless machines so it was easier to sort out all the settings on XP. As far as I know all you need is for the gpo set to make windows wait for the network to start up before logon and set up the wireless card with the windows wireless settings. This is all I have done and they work
E1uSiV3 Posted November 30, 2005 Posted November 30, 2005 Just to add my tuppence worth. We have found many instances of the Windows Zero Configuration Service actually providing a worse connection rate and causing random disconnects as opposed to the manufacturers own drivers and management software. Intel 2200BG wireless chipsets and Buffalo basestations are a good example of this. If you use the native Windows management yoiu have many connection problems. If you use Intels own management software there are no problems whatsoever. Strange. Interesting comment there Dos_Box, my old work collegue has problems with his home wifi network (3com tho) and a 2200bg card, ill drop him a line.
nick.steve Posted November 30, 2007 Posted November 30, 2007 Hi everyone, i'm a bit of a newbie and i will offer advice where i can but i have a problem, i might be missing something stupid and obvious but here goes! I have a standalone laptop, it logs on locally, but i want to map a hard drive that is connected to my wireless router (wired). I can map it when the laptop is physically connected to the router but i want to be able to map it when the laptop is wireless. Could someone please help its driving me crazy! I have a belkin 54g router hp dv 6000 laptop and a network storage lan disk from maplins Thank you in advance for your time. nick.steve
link470 Posted December 1, 2007 Posted December 1, 2007 All I did was install the drivers for the wireless network cards that were either in the wireless laptops, or a few wireless desktops which aren't near a wall and don't have a drop down cable line. I didn't install the utility cause I find making Windows manage the connections is easier and one less thing running in your system tray to tinker with and in RAM. Then what I did was just connected to the wireless network and entered any key if neccessary. I then clicked the favorites star type icon next to the option to manage the different wireless connections along the side [this is all under the window to view wireless networks, the one you want should now show as connected], and set it as an automatic network. Click ok, and you're done. Make sure you're logged in as the local administrator of that machine. I haven't had a single problem since.
maniac Posted December 1, 2007 Posted December 1, 2007 Try this VBS script. It features a delay at the start to check the user is properly logged on, and will map drives according to group memberships in AD. Been using it on our network for over a year now with no problems. I can't take credit for it, I found it on a messageboard somewhere ages ago. Option Explicit ' Force explicit declarations Dim WSHNetwork Dim FSO Dim strUserName ' Current user Dim strUserDomain ' Current User's domain name Dim ObjGroupDict ' Dictionary of groups to which the user belongs Set WSHNetwork = WScript.CreateObject("WScript.Network") Set FSO = CreateObject("Scripting.FileSystemObject") ' ' Wait until the user is really logged in... ' strUserName = "" While strUserName = "" WScript.Sleep 100 ' 1/10 th of a second strUserName = WSHNetwork.UserName Wend strUserDomain = WSHNetwork.UserDomain Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName) If MemberOf(ObjGroupDict, "All Students") Then call map("P:", "\\SERVER\share") end if If MemberOf(ObjGroupDict, "All Staff") Then call map("O:", "\\server\share") End If Function MemberOf(ObjDict, strKey) MemberOf = CBool(ObjGroupDict.Exists(strKey)) End Function Function CreateMemberOfObject(strDomain, strUserName) Dim objUser, objGroup Set CreateMemberOfObject = CreateObject("Scripting.Dictionary") CreateMemberOfObject.CompareMode = vbTextCompare Set objUser = GetObject("WinNT://" _ & strDomain & "/" _ & strUserName & ",user") For Each objGroup In objUser.Groups CreateMemberOfObject.Add objGroup.Name, "-" Next Set objUser = Nothing End Function sub map( drive, share ) on error resume next WSHNetwork.removenetworkdrive drive, true WSHNetwork.mapnetworkdrive drive, share end sub If you don't want to use the advanced features of reading the group memberships, you can remove those bits, just retaining the drive mapping and delay at the start. Mike.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now