I have a 2k3 domain and a 2000 server that is in a workgroup due to 3rd party programs/conflicts.
I need to map a share from my domain to the workgroup server.
If I manualy map the drive, it works fine but the when I try the script it doesnt map the drive
Heres the line I am using
WshNetwork.MapNetworkDrive "Q:", "\\192.168.1.244\npc", 2kserver\billuser, passuser
I am not sure if the problem is because I set the strUsername early on. Can I change it to the workgroup username and then change it back the to the domain after the section of script runs.
Here is what i think might be important in the script
strUserName = ""
While strUserName = ""
WScript.Sleep 100 ' 1/10 th of a second
strUserName = WSHNetwork.UserName
Wend
strUserDomain = WSHNetwork.UserDomain
Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName)
' Read the user's account "Member Of" tab info across the network
' once into a dictionary object.
On error resume next
'=========================================================
'=This Section does folder mapping =
'=========================================================
WshNetwork.MapNetworkDrive "Q:", "\\192.168.1.244\npc", 2kserver\billuser, passuser
'*****************************************************************************
'*This ends folder mapping, the following is a function that needs to be here
'*****************************************************************************
Function MemberOf(ObjDict, strKey)
Thanks
I need to map a share from my domain to the workgroup server.
If I manualy map the drive, it works fine but the when I try the script it doesnt map the drive
Heres the line I am using
WshNetwork.MapNetworkDrive "Q:", "\\192.168.1.244\npc", 2kserver\billuser, passuser
I am not sure if the problem is because I set the strUsername early on. Can I change it to the workgroup username and then change it back the to the domain after the section of script runs.
Here is what i think might be important in the script
strUserName = ""
While strUserName = ""
WScript.Sleep 100 ' 1/10 th of a second
strUserName = WSHNetwork.UserName
Wend
strUserDomain = WSHNetwork.UserDomain
Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName)
' Read the user's account "Member Of" tab info across the network
' once into a dictionary object.
On error resume next
'=========================================================
'=This Section does folder mapping =
'=========================================================
WshNetwork.MapNetworkDrive "Q:", "\\192.168.1.244\npc", 2kserver\billuser, passuser
'*****************************************************************************
'*This ends folder mapping, the following is a function that needs to be here
'*****************************************************************************
Function MemberOf(ObjDict, strKey)
Thanks