Login | |
|
 |
Script Not Detecting User In Group - 3/9/2005 10:01:53 PM
|
|
 |
|
| |
cjwallace
Posts: 491
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
|
Guys, below is a copy of my login script. Myself and 3 other guys are part of the London Systems NT group which should map the following drives MapDrive "I:", "\\Hyperion\itstuff" MapDrive "Y:", "\\poseidon\home$" MapDrive "Z:", "\\zeus\zenapps" Only the vbs script does not think that they are part of the London Systems NT Group and does not map the drives. It maps them ok for me! We are running Windows NT4 Domain Any ideas why it would not think they are part of the Group? ----------------------- On Error Resume Next Dim WshNetwork, asdPath, User Dim strMappedDrives, strStatus Dim IE Dim objFSO set shell = createobject("wscript.shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Const ADS_READONLY_SERVER = 100 ' Display IE status window Call CreateIE() strStatus = "Please call x6440 with any Login issues " & Date() ie.document.all.wstatus.InnerText = strMsg3 ' Get the User ID Set WSHNetwork = WScript.CreateObject("WScript.Network") strUser = "" While strUser = "" strUser = WSHNetwork.UserName Wend ie.document.all.Msg1.InnerText = strUser call main() strStatus = strStatus & vbCRLF & "Withers LLP London Network Logon Complete..." ie.document.all.wstatus.InnerText = strStatus ' Close IE status window If not ie.document.all.holdit.checked then ie.quit() End if ' End of logon script Public Sub Main() 'Main loop to detect group that user belongs to adsPath = "WinNT://London/" & strUser Set dso = GetObject("WinNT:") Set objUser = dso.OpenDSObject(adsPath,"","", ADS_READONLY_SERVER) For Each Prop In objUser.groups Select Case Prop.Name Case "Domain Users" Call DomainUsers() Case "Photos" Call Photos() Case "DigitalPhotos" Call DigitalPhotos() Case "Helpdesk" Call Helpdesk() Case "London Systems" Call LondonSystems() 'etc End Select Next 'Prop End Sub Sub DomainUsers() strStatus = strStatus & vbCRLF & "Member of London Domain Users..." ie.document.all.wstatus.InnerText = strStatus shell.run ("net time \\atlas /set /yes") MapDrive "S:", "\\poseidon\data" MapDrive "V:", "\\poseidon\apps" shell.run ("net use \\zeus\zenapps") shell.run ("net use \\atlas\crispdata") objFSO.CopyFile "\\zeus\zenapps\nav\grc.dat", "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\" shell.run ("cmd /c attrib -h c:\program files\Microsoft Office\office\startup\*.*"),0,true End Sub Sub Photos() strStatus = strStatus & vbCRLF & "Member of Photos Group on HEBE..." ie.document.all.wstatus.InnerText = strStatus MapDrive "P:", "\\hebe\photos" End Sub Sub DigitalPhotos() strStatus = strStatus & vbCRLF & "Member of JDM DigitalPhotos on HEBE..." ie.document.all.wstatus.InnerText = strStatus MapDrive "Q:", "\\hebe\digitalphotos" End Sub Sub Helpdesk() strStatus = strStatus & vbCRLF & "Member of ITSTUFF on HYPERION..." ie.document.all.wstatus.InnerText = strStatus MapDrive "I:", "\\Hyperion\itstuff" MapDrive "Y:", "\\poseidon\home$" MapDrive "Z:", "\\zeus\zenapps\withersdocs.ini" End Sub Sub LondonSystems() strStatus = strStatus & vbCRLF & "Member of London Systems Team..." ie.document.all.wstatus.InnerText = strStatus MapDrive "I:", "\\Hyperion\itstuff" MapDrive "Y:", "\\poseidon\home$" MapDrive "Z:", "\\zeus\zenapps" End Sub Sub CreateIE() On Error Resume Next Set IE = CreateObject("InternetExplorer.Application") With IE .navigate "\\atlas\netlogon\uk\logon.htm" .resizable=0 .height=470 .width=350 .menubar=0 .toolbar=0 .statusBar=0 .visible=1 End With SecondsToDelay = "2" Wscript.Sleep(SecondsToDelay * 2000) End Sub Sub MapDrive(strDrive,strShare) On Error Resume Next WSHNetwork.MapNetworkDrive strDrive, strShare If Err.Number Then WSHNetwork.RemoveNetworkDrive strDrive WSHNetwork.MapNetworkDrive strDrive, strShare End If strMappedDrives = strMappedDrives & strDrive & " " ie.document.all.Msg2.InnerText = strMappedDrives End Sub
|
|
| |
|
|
|
 |
Re: Script Not Detecting User In Group - 3/9/2005 11:40:08 PM
|
|
 |
|
| |
mbouchard
Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
Are you getting any kind of error when the drives don't map? Have you tried removing the error resume next? Also, you might want to check and make sure that london systems is showing up correctly. Try somehthing like this; If struser = "user1" or struser = "user2" or strUser = user3" then Msgbox "-" & prop.Name & "-" & vbcr & "London Systems" End if The reason for the - is to verify that there are no additional characters. And even if it is working for you and not them, I would still check this out.
|
|
| |
|
|
|
 |
Re: Script Not Detecting User In Group - 3/10/2005 12:19:23 AM
|
|
 |
|
| |
mbouchard
Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
|
you could add it to your login script or just add some of the login script code and have the other guys run it to see what they get.
|
|
| |
|
|
|
|
|