home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / compak7 / dacpack7.exe / DLGroup.vbs < prev    next >
Encoding:
Text File  |  1998-08-29  |  1.1 KB  |  45 lines

  1. L_Welcome_MsgBox_Message_Text    = "This script demonstrates DameWare Local Group using the Windows Scripting Host."
  2. L_Welcome_MsgBox_Title_Text      = "DameWare Windows Scripting Host Sample"
  3.  
  4. CrLf = chr(13) & chr(10)
  5. MyTab = chr(9)
  6.  
  7. Call Welcome()
  8.  
  9. Dim DCtl1, strMachine, strUserID
  10.  
  11. Set DCtl1 = Wscript.CreateObject("DameWare.DLGroupCtl.1")
  12.  
  13. strMachine = DCtl1.GetMachineName
  14. strUserID = DCtl1.GetCurrentUserID
  15.  
  16. Ans = MsgBox ("Local Machine Name: " & strMachine & CrLf & _
  17.                 MyTab & "User Id: " & strUserID, _ 
  18.                 vbOKOnly + vbInformation, _                
  19.                           L_Welcome_MsgBox_Title_Text )
  20.  
  21. DCtl1.Machine = DCtl1.GetMachineName
  22. DCtl1.SetFirstGroup
  23.  
  24. Dim strGroups
  25.  
  26. While DCtl1.GroupGetNext <> 0
  27.     strGroups = strGroups & DCtl1.Group & MyTab & DCtl1.Groupcomment & CrLf
  28. Wend
  29.  
  30. MsgBox "All Local Groups: "  & CrLf & CrLf & strGroups
  31.  
  32. Set DCtl1 = Nothing
  33.  
  34. Sub Welcome()
  35.     Dim intDoIt
  36.  
  37.     intDoIt =  MsgBox(L_Welcome_MsgBox_Message_Text, _
  38.                       vbOKCancel + vbInformation,    _
  39.                       L_Welcome_MsgBox_Title_Text )
  40.     If intDoIt = vbCancel Then
  41.         WScript.Quit
  42.     End If
  43. End Sub
  44.  
  45.