| Author |
Message |
justlearnin
Guest
|
Posted:
Thu Oct 27, 2005 8:50 pm Post subject:
Conditional Mapping |
|
|
I am trying to map 3 different drives, but only if the user is of a certain
group. I already have the drives mapped that need to be for all users, but
how do I code the if/else for the conditional drives? |
|
| Back to top |
|
 |
Wendel Hamilton
Guest
|
Posted:
Fri Oct 28, 2005 12:50 pm Post subject:
RE: Conditional Mapping |
|
|
Hi,
VBScript
if isMember("MyDepartment") then
WshNetwork.MapNetworkDrive Drive, Share
end if
"justlearnin" wrote:
| Quote: | I am trying to map 3 different drives, but only if the user is of a certain
group. I already have the drives mapped that need to be for all users, but
how do I code the if/else for the conditional drives? |
|
|
| Back to top |
|
 |
justlearnin
Guest
|
Posted:
Fri Oct 28, 2005 8:50 pm Post subject:
RE: Conditional Mapping |
|
|
Thanks...The other thing i was needing is to map a user to thier own home
drive, I've seen this before like:
user\%username%
but this doesn't work. Any suggestions?
"Wendel Hamilton" wrote:
| Quote: | Hi,
VBScript
if isMember("MyDepartment") then
WshNetwork.MapNetworkDrive Drive, Share
end if
"justlearnin" wrote:
I am trying to map 3 different drives, but only if the user is of a certain
group. I already have the drives mapped that need to be for all users, but
how do I code the if/else for the conditional drives? |
|
|
| Back to top |
|
 |
Wendel Hamilton
Guest
|
Posted:
Sat Oct 29, 2005 5:43 am Post subject:
RE: Conditional Mapping |
|
|
Hi,
User's home drives are mapped by default on Winnt 4 and above.
All you need to do is define them in ADUC on the profiles tab.
If you want to do it manually then
try
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment("Process")
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive WshSysEnv("HOMEDRIVE"), WshSysEnv("HOMESHARE")
or
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "h:", "\\server\home\" & objNetwork.UserName
"justlearnin" wrote:
| Quote: | Thanks...The other thing i was needing is to map a user to thier own home
drive, I've seen this before like:
user\%username%
but this doesn't work. Any suggestions?
"Wendel Hamilton" wrote:
Hi,
VBScript
if isMember("MyDepartment") then
WshNetwork.MapNetworkDrive Drive, Share
end if
"justlearnin" wrote:
I am trying to map 3 different drives, but only if the user is of a certain
group. I already have the drives mapped that need to be for all users, but
how do I code the if/else for the conditional drives? |
|
|
| Back to top |
|
 |
|
|
|
|