junior_one

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
Sub test1()
  Set Sy = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
    For Each WG In Sy
       MsgBox "工作组" & WG.Workgroup
    Next
End Sub

Sub test2()
  Set Sy = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
    For Each WG In Sy
       MsgBox WG.UserName
MsgBox WG.PrimaryOwnerName
    Next
End Sub

 

posted on 2019-01-29 16:26  junior_one  阅读(489)  评论(0编辑  收藏  举报