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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

more logon's 1

Status
Not open for further replies.

terry712

Technical User
Oct 1, 2002
2,175
GB
i use a similar script to below at a site and works no probs but thios site the groups dont work. i cant change the case in groups as it is existing. i dont want to define constants etc if i dont have too - any help apprecaited - site uses kix just now and i want to move to vbs

on error resume next
Set wshNetwork = CreateObject("WScript.Network")

wshNetwork.MapNetworkDrive "o:", "\\shineyserver\shared"
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.getex("MemberOf")))


strComputerName = wshNetwork.ComputerName

If Instr(strGroups, "cn=meadow EGH Ascribe at EGH") Then

WsHNetwork.MapNetworkDrive "l:", "\\egh-ascribe1\live"
End If

If Instr(strGroups, "cn=meadow AAH Ascribe") Then

WsHNetwork.MapNetworkDrive "n:", "\\aah-ascribe2\live"
End If

If InStr(strGroups, "cn=meadow RIE Finance Share") Then

WsHNetwork.MapNetworkDrive "p:", "\\rie-file\FINANCE SHARE"

End If
 
Change this:
If Instr(strGroups, "cn=meadow EGH Ascribe at EGH") Then
with this:
If Instr(strGroups, LCase("cn=meadow EGH Ascribe at EGH")) Then
or this:
If Instr(strGroups, "cn=meadow egh ascribe at egh") Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
thanks - will give it a twhirl and let you know
it's a pain that the groups contains spaces and a mix of characters but hey
 
BTW, we may simplify !
...
strGroups = Join(CurrentUser.getex("MemberOf"))
...
If Instr(1, strGroups, "cn=meadow EGH Ascribe at EGH", 1) Then
...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
what does the 1's mean
still need to have a play but weather too nice to dial in and have a 5 min play that no doubt will turn into 2 hours

the case statements that mark uses in his script - is this a better route or is it just pure individual preference
 
thanks

sorry for stupid question - afraid my programing skills suck - i could muddle through pascal and cobol but basic has always been a mystery to me

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top