Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

login Script with server 2003 and VBS script

Status
Not open for further replies.

keevern

IS-IT--Management
Oct 27, 2006
1
US
Reference thread329-1200699

I would like to do the same login script as mentioned in thread329-1200699. Thanks to who ever created this script? I have been able to successfully run the first part of this script to get a home directory mapped. I am getting an error on line 23 char 1. set CurrentUser = GetObject("LDAP://pways50-fs1" & ADSysInfo.UserName) the error that comes up is the specified domain either does not exist or could not be contacted. Code 8007054B Source (null). Anyone have any ideas why I am getting this error. Posted is the script with my changes.

Thanks

' ======================================================
' DEFINE AD GROUP CONSTANTS
' ======================================================
Const IT = "cn=it"
Const CORPORATE = "cn=corporate"
Const SERVICES = "cn=services"
Const UNIVERSITY = "cn=university"

' ======================================================
' MAP HOME DRIVE H:
' ======================================================

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:", "\\pways50-fs1\Profiles\" & wshNetwork.UserName



' ======================================================
' COMPILE USER GROUP MEMBERSHIPS
' ======================================================

set ADSysInfo = CreateObject("ADSystemInfo")
set CurrentUser = GetObject("LDAP://pways50-fs1" & ADSysInfo.UserName)
if IsArray(CurrentUser.MemberOf) then
strGroups = LCase(Join(CurrentUser.MemberOf))
else
strGroups = LCase(CurrentUser.MemberOf)
end if
set ADSysInfo = nothing
set CurrentUser = nothing

' ======================================================
' MAP DRIVES
' ======================================================
If InStr(strGroups, IT) Then

wshNetwork.MapNetworkDrive "i:", "\\pways50-fs1\IT"


ElseIf InStr(strGroups, CORPORATE) Then

wshNetwork.MapNetworkDrive ":", "\\pways50-fs1\corporate"

ElseIf InStr(strGroups, SERVICES) Then

wshNetwork.MapNetworkDrive "s:", "\\pways50-fs1\services"

ElseIf InStr(strGroups, UNIVERSITY) Then

wshNetwork.MapNetworkDrive "u:", "\\pways50-fs1\university"

End If

WScript.Echo "Script is complete.
 
Did you take a look at using my FAQ FAQ329-5798 ?

My script will programatically determine the domain info rather than having to code it.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top