|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 07/27/2009 at 04:21PM PDT, ID: 24604717 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: |
' ########################################################################
' Establishes map drives.
' Assign to OU Group Policy under USER CONFIG, WINDOWS SETTINGS, SCRIPTS, LOGON SCRIPT.
'
' This script will:
' (1) check if the drive is already connected and, if so, disconnect it.
' (2) map the drive.
'
' Arguments are as follows:
' MAPIT DRIVE-LETTER as string, PATH as string, USER as string, PASSWORD as string
' (1) Do not specify colon in drive letter.
' (2) Do not end path with a forward slash.
' (3) If user and password are not required to establish map, then specify a zero-length string as follows: ""
'
' Reference Microsoft info at:
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthmapnetworkdrive.asp
' ########################################################################
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
objShell.Run "xcopy " & chr(34) & "\\climateworks.local\NETLOGON\Template\normal.dotm" & chr(34) & " " & chr(34) & "%USERPROFILE%\Application Data\Microsoft\Templates" & chr(34) & " /Y /I /Q"
' Create the Shell or environment for the commands:
Set WshShell = WScript.CreateObject("WScript.Shell")
' Define objects:
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oDrives = WshNetwork.EnumNetworkDrives()
'Get Username to map to HOME drive
LPHSUser = WshNetwork.UserName
' ====================================
' DEFINE WHO TO CONTACT for pop-up messages:
' ====================================
strContactMessage = "If you require assistance, please contact itsupport@bando.com."
' ==================
' DEFINE DRIVES TO MAP:
' ==================
Mapit "W", "\\FS1\Shared", "", ""
Mapit "U", "\\FS1\Users\" & LPHSUser, "", ""
'TO MAP TO HOME DRIVE USE: Mapit "K", "\\aphrodite\users\" & LPHSUser, "", ""
'ALSO NAME HOME FOLDER TO CORRESPONDING USERNAME
' Your printers somewhere around here...
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\FS1\XeroxPhaser3500"
WshNetwork.AddWindowsPrinterConnection "\\Fs1\ColorXeroxPhaser8560"
WshNetwork.AddWindowsPrinterConnection "\\Fs1\Xerox_7328_MFP"
WshNetwork.AddWindowsPrinterConnection "\\Fs1\XeroxPhaser3600_FAR"
'WshNetwork.SetDefaultPrinter "\\FS1\XeroxPhaser3500"
' ========
' CLEAN UP:
' ========
Set WshShell = Nothing
Set WshNetwork = Nothing
Set oDrives = Nothing
' ##################################
' DO NOT MODIFY ANYTHING BELOW THIS POINT...
' unless you are familiar with the proper settings.
' ##################################
Sub Mapit(strLetter, strPath, strUser, strPass)
' Define the DriveLetter:
DriveLetter = strLetter & ":"
' Define the remote path:
RemotePath = strPath
' Pop-up Notices (set to False to disable notices, otherwise set to True):
bPopReminder = False
' Define known errors to trap:
Dim arrErrCode(1)
Dim arrErrDesc(1)
arrErrCode(0) = -2147023694
arrErrCode(1) = -2147024811
arrErrDesc(0) = "Unable to map drive " & DriveLetter & " to " & RemotePath _
& " due to a previously defined remembered map with the same letter." _
& vbCrLf & vbCrLf & "Please MANUALLY disconnect map drive " & DriveLetter _
& ", then Log Out and Log back in."
arrErrDesc(1) = "Unable to map drive " & DriveLetter & " to " & RemotePath _
& " since " & DriveLetter & ": was previously reserved by your computer." _
& vbCrLf & vbCrLf & "(Refer to Management, Shared Folders, Shares)"
' Define whether the map information should be removed from the current user's profile:
bForceRemoveFromProfile = True
bRemoveFromProfile = True
' Define whether the map information should be stored in the current user's profile:
bStoreInProfile = False
' Check if already connected:
AlreadyConnected = False
For i = 0 To oDrives.Count - 1 Step 2
If LCase(oDrives.Item(i)) = LCase(DriveLetter) Then AlreadyConnected = True
Next
' Attempt to map the drive. If already mapped, first attempt disconnect:
If AlreadyConnected = True then
WshNetwork.RemoveNetworkDrive DriveLetter, bForceRemoveFromProfile, bRemoveFromProfile
If Not strUser = "" Then
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile, strUser, strPass
Else
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile
End If
If bPopReminder Then WshShell.PopUp "Drive " & DriveLetter & " disconnected, then connected successfully to " & RemotePath
Else
On Error Resume Next
If Not strUser = "" Then
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile, strUser, strPass
Else
WshNetwork.MapNetworkDrive DriveLetter, RemotePath, bStoreInProfile
End If
If Err.Number <> 0 Then
bKnownError = False
For I = LBound(arrErrCode) To UBound(arrErrCode)
If Err.Number = arrErrCode(I) Then
bKnownError = True
strPopMessage = arrErrDesc(I)
' Display the Disconnect Network Drives window:
If Err.Number = arrErrCode(0) Then
Set objWSH = Wscript.CreateObject("WScript.Shell")
objWSH.Run "rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL Disconnect", 1, true
End If
Exit For
End If
Next
If Not bKnownError Then
strPopMessage = "Unable to map drive " & DriveLetter & " to " & RemotePath _
& " due to reason stated below."
End If
' Display warning message:
'strPopMessage = "WARNING!! WARNING!! WARNING!! WARNING!!" _
' & vbCrLf & vbCrLf & strPopMessage _
' & vbCrLf & vbCrLf & Err.Description & " (error " & Err.Number & ")" _
' & vbCrLf & vbCrLf & strContactMessage
'WshShell.PopUp strPopMessage
Else
If bPopReminder Then WshShell.PopUp "Drive " & DriveLetter & " connected successfully to " & RemotePath
End If
End If
' Release resources:
Set objWSH = Nothing
' Slight pause to ensure each pass has time to commit:
wscript.sleep 200
End Sub
|
Advertisement