Need excel 2010 Macro wmi to extract username from wmi?

Asked By 30 points N/A Posted on -
qa-featured

I need a excel 2010 macro wmi to help me extract username from wmi.

I have windows 7 and office 2010 on my laptop.

SHARE
Best Answer by Sharath Reddy
Answered By 0 points N/A #156966

Need excel 2010 Macro wmi to extract username from wmi?

qa-featured

Hey Dennis,

You should do the following-

1. Change the USER21 Macro with $ARG1$ by typing in the command – ch wig $ARG1$.

2. Then replace by writing – mv wig uspl

4. A window will appear. Click apply to host and close the terminal.

And you will be able to extract.

 

Best Answer
Best Answer
Answered By 590495 points N/A #156967

Need excel 2010 Macro wmi to extract username from wmi?

qa-featured

I tried searching for a Microsoft Office Excel macro that can be used to extract usernames in WMI files.

I found several macros on my search and here is one of the macros I found that might help you in extracting some information on WMI files.

Function GetFullName() As String
    Dim computer As String
    computer = "."
    Dim objWMIService, colProcessList As Object
    Set objWMIService = GetObject("winmgmts:\" & computer & "rootcimv2")
    Set colProcessList = objWMIService.ExecQuery _
        ("SELECT * FROM Win32_Process WHERE Name = 'EXCEL.EXE'")
    Dim uname, udomain As String
    Dim objProcess As Object
    For Each objProcess In colProcessList
        objProcess.GetOwner uname, udomain
    Next
    GetFullName = UCase(udomain) & "" & UCase(uname)
End Function

Related Questions