neutec
Technical User
- Apr 26, 2003
- 343
Hello,
is it poissible to use a varible the can use Windows credentials (SSPI) in a vbscript? I have a login script that maps drives to users at login. Remote user login via VPN and need to pass the Windows Token to login to share domain resoure. I was wondering if this can be integrated into the script below.
is it poissible to use a varible the can use Windows credentials (SSPI) in a vbscript? I have a login script that maps drives to users at login. Remote user login via VPN and need to pass the Windows Token to login to share domain resoure. I was wondering if this can be integrated into the script below.
Code:
Dim fs, d, dc, WshNetwork
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set fs = CreateObject("Scripting.FileSystemObject")
Set dc = fs.Drives
If fs.DriveExists("R") Then
'Drive R has been previously assigned and still is currently assigned.
If dc("R").ShareName = "\\Dc1\American Contractor Data" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive S has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "S:", "\\Dc1\CMCSYNC"
End If
If fs.DriveExists("L") Then
'Drive L has been previously assigned and still is currently assigned.
If dc("L").ShareName = "\\Dc1\Letterlog" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive L has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "L:", "\\Dc1\Letterlog"
End If
If fs.DriveExists("M") Then
'Drive M has been previously assigned and still is currently assigned.
If dc("M").ShareName = "\\Dc1\Company" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive M has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "M:", "\\Dc1\Company"
End If
If fs.DriveExists("N") Then
'Drive N has been previously assigned and still is currently assigned.
If dc("N").ShareName = "\\Dc1\Userdata" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive N has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "N:", "\\Dc1\Userdata"
End If
If fs.DriveExists("O") Then
'Drive O has been previously assigned and still is currently assigned.
If dc("O").ShareName = "\\Dc1\AmericanContractor" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive O has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "O:", "\\Dc1\AmericanContractor"
End If
If fs.DriveExists("T") Then
'Drive T has been previously assigned and still is currently assigned.
If dc("T").ShareName = "\\Dc1\Public" Then
'The sharename is already assigned to the drive letter
Else
'The drive letter is already taken up, but not with the expected sharename.
End If
Else
'Drive T has not been assigned, so we will assign it.
WshNetwork.MapNetworkDrive "T:", "\\Dc1\Public"
End If