I have created a script to push message out to users.
but it dosnt behave like i wish?
the first line and last line is the same
the second line and the second line is the same
and the third first line and third line is the same??
Something like this??
1
2
3
4
3
2
1
I want it to run once only from top of the csv file and to the button of it.
1
2
3
4
.
somehow the message come out like below.
the code:
Set grplist = ("c:\CSV\Script_message.csv") aGroup = Split(grplist.Readall,vbcrlf) For I = 0 to UBound(GroupList) ' Check Every Group Membership the user is in (populated into Grouplist) grpname = Grouplist(i) For x = 0 to UBound(aGroup) ' Read the entire CSV to make sure all drives are mapped for each Group mapline = agroup(x) row = split(mapline,",") SecGroup = row(0) If InStr(LCase(SecGroup),LCase(grpname)) Then ' If you're in the group 'wscript.echo mapline row = split(mapline,",") SecGroup = row(0) Title = row(1) Symbol = row(2) Sec = row(3) Message = Row(4)
Set objShell = Wscript.CreateObject("Wscript.Shell") objShell.Popup Message,Sec,Title,Sym ' http://msdn.microsoft.com/en-us/library/x83z1d9f%28v=vs.84%29.aspx Call WriteLogFileLine(strFile,"Besked: " & Message & " # Tid: " & Sec & "sek # BoxTitle: " & Title & " # Symbol: " & Symbol) End If Next Next End If Sub GetGroupInfo Set UserObj = GetObject("WinNT://" & wshNetwork.UserDomain & "/" & WshNetwork.UserName) Set Groups = UserObj.groups For Each Group In Groups GroupCount = GroupCount + 1 Next ReDim GroupList(GroupCount -1) i = 0 For Each Group In Groups GroupList(i) = Group.Name i = i + 1 Next End Sub
the csv file:
MSG_CompService,ServiceDesk,EXCL,0,Kontakt ServiceDesk MSG_CompService1,Information,INFO,5,Information Mark MSG_CompService2,???,QUES,5,Question Mark MSG_CompService3,STOP,STOP,5,Stop Mark
Helpdesk Supporter