CaseyBlackburn
Gawd
- Joined
- Dec 10, 2006
- Messages
- 540
I am currently working on an addition to my Login Script for Active Directory. I am working on setting up Backup storage. I have a share on Server02 that is at 'backup_storage'. Each user will have a folder under this share.
So the path will be \\server02\backup_storage\user\%User Name%
The problem is I want that folder to be checked to see if it exists, and if not, have it be created. I am not skilled at VBScript that much, so if someone could lend a hand, I would appreciate it. I would also like to know how to only map it if the member is part of the group "Backup User," could someone explain this, I haven't been able to upturn a defiant way to do this. This is the stuff I have that pertains to this:
So the path will be \\server02\backup_storage\user\%User Name%
The problem is I want that folder to be checked to see if it exists, and if not, have it be created. I am not skilled at VBScript that much, so if someone could lend a hand, I would appreciate it. I would also like to know how to only map it if the member is part of the group "Backup User," could someone explain this, I haven't been able to upturn a defiant way to do this. This is the stuff I have that pertains to this:
Code:
Option Explicit
Dim objNetwork, strUserName
Set objNetwork = CreateObject("WScript.Network")
strUserName = objNetwork.UserName
On Error Resume Next
'-- Remove Drives --'
objNetwork.RemoveNetworkDrive "R:"
'-- Map Drives --'
objNetwork.MapNetworkDrive "R:", "\\server02\backup_storage\user\" & strUserName
Wscript.Quit