Conditional Mapping
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Conditional Mapping

 
Post new topic   Reply to topic    Windows Server Forum Index -> DNS
Author Message
justlearnin
Guest





Posted: Thu Oct 27, 2005 8:50 pm    Post subject: Conditional Mapping Reply with 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
Wendel Hamilton
Guest





Posted: Fri Oct 28, 2005 12:50 pm    Post subject: RE: Conditional Mapping Reply with quote

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 Reply with 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:

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 Reply with quote

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
 
Post new topic   Reply to topic    Windows Server Forum Index -> DNS All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB