IT Management Suite

 View Only
Expand all | Collapse all

Local User Account report ("Users" group)

Alexander Cherbunin

Alexander CherbuninJul 11, 2016 05:43 PM

Alex Hedley

Alex HedleySep 27, 2016 04:11 AM

  • 1.  Local User Account report ("Users" group)

    Posted Jun 22, 2016 11:31 AM

    Good afternoon! Faced with the problem - the standard set of reports does not include a report on the local accounts (the group "Users"). The report shall contain the name of the workstation (the server), the name of a local user account (the group "Users"). Are there tips for using data classes or ready-made solution (script report)?



  • 2.  RE: Local User Account report ("Users" group)

    Posted Jun 22, 2016 03:09 PM

    Maybe I am misunderstanding, but are you saying that the Local User Account Information report is not showing you users? The report I am referring to is at: Discovery and Inventory -> Inventory -> Windows -> User

    This report should contain all local user accounts if I am not mistaken as they would be placed in the Users group in Computer Management.



  • 3.  RE: Local User Account report ("Users" group)

    Posted Jun 22, 2016 04:51 PM
      |   view attached

    Hello! I'm using version 7.1 . I have not found in the control console, said the report. What is it called ?



  • 4.  RE: Local User Account report ("Users" group)

    Posted Jul 11, 2016 05:43 PM

     

    Colleagues, I'm still looking for a solution (report).

     



  • 5.  RE: Local User Account report ("Users" group)

    Posted Jul 12, 2016 09:11 AM
      |   view attached

    Here is the exported XML from my 7.6 console. Again, I am not 100% sure this was in 7.1 as I dont have a 7.1 environment set up to test on. You can try and import this report, but depending on the database schema of 7.1 vs 7.6, it may or may not fail. 

    Attachment(s)



  • 6.  RE: Local User Account report ("Users" group)

    Posted Aug 02, 2016 03:53 PM

    Thank you for your report, Donald! This report is present in version 7.1. However , it returns the domain accounts profile that is present on the workstation. It is possible to eliminate all of the accounts that contain the domain name and get a nice report. Thanks again!



  • 7.  RE: Local User Account report ("Users" group)

    Posted Aug 17, 2016 05:58 PM

    Colleagues! Tell me, please , how do I get a report on members of local groups on servers and workstations? Do not found a way to link Inv_UG_Group table with Inv_UG_User_Account. Really it is necessary to deal with the special rule of inventory? The report shall contain the name of the workstation, the local group name, user name.



  • 8.  RE: Local User Account report ("Users" group)

    Broadcom Employee
    Posted Aug 18, 2016 07:08 AM

    Hi Alexander,

    here is a simple query which gathers data from Inventory Solution SQL tables as well as from Basic Inventory SQL tables of managed clients (report includes only managed computers where Symantec Management Agent is installed).

     

    SELECT DISTINCT
    vi.Guid,
    vi.Name AS [PC Name],
    iugua.[User Name],
    iugua.[User ID],
    iugua.[Full Name],
    iaapu.[User] AS [Primary User],
    iugua.[Domain] AS [Domain Name],
    iug.[Name] AS [User Group Name],
    iugua.[Primary Group ID],
    iaai.[Last Logon User]
    
    FROM vComputer vi
    JOIN Inv_UG_User_Account iugua
    ON iugua._ResourceGuid = vi.Guid
    JOIN Inv_UG_Group iug
    ON iug._ResourceGuid = vi.Guid
    JOIN Inv_AeX_AC_Primary_User iaapu
    ON iaapu._ResourceGuid = vi.Guid
    JOIN Inv_AeX_AC_Identification iaai
    ON iaai._ResourceGuid = vi.Guid
    ORDER BY [PC Name]
    ASC

    Note!

    There will be a lot of records returned by this Query, because it shows each User Group per User.

    • If you don't want to see user groups, then remove this from Query
    iug.[Name] AS [User Group Name],
    iugua.[Primary Group ID],

     

    Thanks,

    IP.



  • 9.  RE: Local User Account report ("Users" group)

    Posted Aug 18, 2016 09:36 AM

    Igor, thank you very much! I saw that the report returns a list of local groups and users. But I did not understand how to determine which user belongs to which group?



  • 10.  RE: Local User Account report ("Users" group)

    Broadcom Employee
    Posted Aug 19, 2016 05:48 AM

    Alexander, yes there is a mistake since it will return all records by PC GUID and no matter if this user exists in this user group or not. So Query above isn't valid.



  • 11.  RE: Local User Account report ("Users" group)

    Posted Aug 21, 2016 07:59 AM

    Thanks Igor! I need to use a special inventory rule (custom inventory).



  • 12.  RE: Local User Account report ("Users" group)

    Posted Aug 22, 2016 05:38 PM

    I want to share experiences and ask for advice. I have created the necessary data class and script to obtain information about the composition of the group ("Users"). All actions are performed based on information from the KB article (link). The question is - how to change the script to return the names of local groups and users belonging to them in one list?

    'Declare global variables
    dim objNSE, objDCInstance, objDataClass

    Dim arrMembership, arrCols()
    arrMembership = GetGroupMembership("Users")
    Redim arrCols(UBound(arrMembership))

    dim intMembers, arrRow(1), arrUser
    For intMembers = 0 to uBound(arrMembership)
        'wscript.echo "User:[" & arrMembership(intMembers) & "]"
        'Populate Values - check for backslash in field
        if instr(arrMembership(intMembers), "\")>0 then
            arrUser = split(arrMembership(intMembers), "\")
            arrRow(0) = arrUser(1)
            arrRow(1) = arrUser(0)
        else
            'If no backslash empty domain field and put everything into the user field
            arrRow(0) = ""
            arrRow(1) = arrMembership(intMembers)
        end if
        
        'Add Row to arrCols
        arrCols(intMembers) = arrRow
    Next

    'Create instance of Altiris NSE component
    set objNSE = WScript.CreateObject ("Altiris.AeXNSEvent")

    ' Set the header data of the NSE
    ' Please don't modify this GUID
    objNSE.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
    objNSE.Priority = 1

    'Create Inventory data block. Here assumption is that the data class is already configured on server
    set objDCInstance = objNSE.AddDataClass("LocalUsersGroup") ' -THIS IS THE NAME OF THE DATACLASS
    set objDataClass = objNSE.AddDataBlock(objDCInstance)

    Dim intCol
    For intCol = 0 to uBound(arrCols)
        AddInventoryRow(arrCols(intCol))
    Next

    ' Send the NSE data to the NS server
    objNSE.SendQueued

    'Functions down here to make it easier to understand
    Function GetGroupMembership(strGroupName)
        'Returns an array with members of a given local group in format Domain\UserName
        dim colGroups, objGroup, objUser, strUsers
        strUsers = ""

        Set colGroups = GetObject("WinNT://.")
        colGroups.Filter = Array("group")
        For Each objGroup In colGroups
            If objGroup.Name = strGroupName Then
                For Each objUser in objGroup.Members
                    dim strUser
                    'strUser = objUser.Name
                    strUser = objUser.adsPath
                    strUser = replace(replace(strUser, "WinNT://", ""), "/", "\")
                    If strUsers = "" Then
                        strUsers = strUser
                    Else
                        strUsers = strUsers & "," & strUser
                    End If
                Next
            End If
        Next

        dim arrUsers
        arrUsers = split(strUsers, ",")
        GetGroupMembership = arrUsers
    End Function

    Sub AddInventoryRow(arrData)
        'Add a new row
        dim objDataRow
        set objDataRow = objDataClass.AddRow
        
        Dim intCols
        For intCols = 0 To uBound(arrData)
            objDataRow.SetField intCols,  ToXmlString(arrData(intCols))
        Next
    End Sub

    'Internal Functions
    Function ToXmlString(strInput)
      Dim strOutput
      If (IsNull(strInput)) Then
        ToXMLString = strInput
      Else
        strOutput = Replace(strInput, "&", "&")
        strOutput = Replace(strOutput, """", """)
        strOutput = Replace(strOutput, "<", "&lt;")
        ToXmlString = Replace(strOutput, ">", "&gt;")
      End If
    End Function



  • 13.  RE: Local User Account report ("Users" group)

    Posted Aug 22, 2016 05:43 PM

    I forgot - for me is actual problem of using Russian characters when specifying the function parameter (arrMembership = GetGroupMembership ( "Пользователи")). Can anyone help with a solution to this problem?



  • 14.  RE: Local User Account report ("Users" group)

    Posted Aug 30, 2016 07:49 AM

    Colleagues! I opened the case in technical support. If anyone have any idea how to create a report - welcome!



  • 15.  RE: Local User Account report ("Users" group)

    Posted Sep 08, 2016 12:13 PM

    When i'm trying to run script with cyrillic symbols locally i get a positive result! NSE file was created with actual information! What is the reason of incorrect script work from console? How can i fix this situation?



  • 16.  RE: Local User Account report ("Users" group)

    Posted Sep 19, 2016 03:20 PM

    Colleagues, during testing on a nearby server encountered a problem. In the table (my data class) there is only one record. ID does not change its value. What could be the reason?



  • 17.  RE: Local User Account report ("Users" group)

    Posted Sep 20, 2016 06:37 AM

    Hi Alexander.

     

    Sorry, but I'm not understanding what you need. Do you need a report with all local users and the machine's name?

     

    Regards,



  • 18.  RE: Local User Account report ("Users" group)

    Posted Sep 20, 2016 11:12 AM

    Custom Inventory will show 1 record per ResourceGuid, this gets overwritten.

    Turn on Data Class History

    Settings | Notification Server | Resource History

    Expand Custom

    Select your Custom Inventory Data Class and give it a duration.

    Look for your Table in SQL with a prefix of "InvHist_" then Data Class name.

    You could then create a report with a drilldown option to see the history

     

    You can capture the events sent to the NS by adding a folder to the following Reg Key

    HKLM | Software | Altiris | Altiris Agent | Transport | Capture Events Folder

    Trapping NSEs on a client

    https://support.symantec.com/en_US/article.HOWTO4191.html

    Check if your Field contains a value you'd expect.



  • 19.  RE: Local User Account report ("Users" group)

    Posted Sep 21, 2016 04:47 PM

    Colleagues, thank you very much for your help! I solved the problem of recording - it was necessary to activate the check-box «Allow multiple rows from a single computer resource». I will try to translate into English the instructions to resolve the problem indicated in the topic.



  • 20.  RE: Local User Account report ("Users" group)

    Posted Sep 21, 2016 04:55 PM

    Hello, Romano! I need to get the composition of local groups . Technical Support representative has confirmed the absence of such a possibility ("out of the box ") in the SMP 7.1. I solved the problem by creating a separate class of data. Using vbs script I collected the necessary data and recorded to the newly created data class.



  • 21.  RE: Local User Account report ("Users" group)
    Best Answer

    Posted Sep 25, 2016 06:32 AM

    My first article on the portal - https://www.symantec.com/connect/articles/creating-report-composition-local-users-group-itms-71

    I would be happy to receive comments and suggestions ;D



  • 22.  RE: Local User Account report ("Users" group)

    Posted Sep 26, 2016 03:59 AM

    I'm getting accessed denied, is this marked as private and has it been approved yet?



  • 23.  RE: Local User Account report ("Users" group)

    Posted Sep 26, 2016 12:58 PM

    Just recently published - should be able to access it now

    Cheryl



  • 24.  RE: Local User Account report ("Users" group)

    Posted Sep 27, 2016 04:11 AM

    It's showing now, thanks Cheryl



  • 25.  RE: Local User Account report ("Users" group)

    Posted Oct 06, 2016 03:54 PM

    Colleagues! Can anyone help to properly adjust the script to return a complete list of local users with SID Windows security groups? Or it's a question for technet community? I want to get a universal solution that will fill the missing functionality.



  • 26.  RE: Local User Account report ("Users" group)

    Posted Oct 07, 2016 06:57 AM

    You could parse

    whoami /groups

    You could pass the group name to

    'dsquery group -name "groupname" | dsget group -sid
    dsquery group -name Users | dsget group -sid

    Replacing Users with the Group name