Hi,
I'm trying to use a logon script to map a network drive for each user that we have in a particular OU. I tried to use:
Set objNetwork = Wscript.CreateObject("WScript.Network"
objNetwork.RemoveNetworkDrive "S:"
objNetwork.MapNetworkDrive "S:", "\\server\documents"
The problem i have is that about half of the users have their drives mapped already - and half don't. If i just use the last line i get errors that it is already mapped, and if i include the penultimate line i get errors where there is no network drive to remove.
I assume i need to use an if statement- although i do not see what I can test. Would appreciate any good scripting - my knowledge of scripting isn't too good
I'm trying to use a logon script to map a network drive for each user that we have in a particular OU. I tried to use:
Set objNetwork = Wscript.CreateObject("WScript.Network"
objNetwork.RemoveNetworkDrive "S:"
objNetwork.MapNetworkDrive "S:", "\\server\documents"
The problem i have is that about half of the users have their drives mapped already - and half don't. If i just use the last line i get errors that it is already mapped, and if i include the penultimate line i get errors where there is no network drive to remove.
I assume i need to use an if statement- although i do not see what I can test. Would appreciate any good scripting - my knowledge of scripting isn't too good