PS Script to find the list of users and the groups in a Workgroup server

Hi There, could you please explain on how to get a complete list of local users and local groups in a "Workgroup" server to which they belong to using Powershell. I'm able to get the users list but couldn't find any help in finding
the script to find to which localgroup the user belong to. Anticipating your response. Also let me know the cmdlet for Win2k3 servers to find the same.

Here's some code from David Pham (don't remember wher I fund this code):
Trap {"Error: $_"; Break;}
Function EnumLocalGroup($LocalGroup)
$Group = [ADSI]"WinNT://$strComputer/$LocalGroup,group"
"Group: $LocalGroup"
# Invoke the Members method and convert to an array of member objects.
$Members= @($Group.psbase.Invoke("Members"))
ForEach ($Member In $Members)
$Name = $Member.GetType().InvokeMember("Name", 'GetProperty', $Null, $Member, $Null)
$Name
# Specify the computer.
$strComputer = gc env:computername
"Computer: $strComputer"
$computer = [adsi]"WinNT://$strComputer"
$objCount = ($computer.psbase.children | measure-object).count
$i=0
foreach($adsiObj in $computer.psbase.children)
switch -regex($adsiObj.psbase.SchemaClassName)
"group"
{ $group = $adsiObj.name
EnumLocalGroup $group }
} #end switch
$i++
} #end foreach

Similar Messages

  • How to find out list of users and their access on Sharepoint

    Hello Everyone
    How can i find out list of users and what access they have on SharePoint site? I want to create table with list of the users and their access?
    Thanks

    you can get the report using below powershell scripts. first one gives list of users in a site collection level.
    The second link generates the permissions reports for each user.
    http://techtrainingnotes.blogspot.com/2010/12/sharepoint-powershell-script-to-list.html
    https://sp2010userperm.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Hi am having issues with getting the list of users from the Active Director

    Hi am having issues with getting the list of users from the Active Directory, can anyone help me with this!

    Hi Jason,
    Try this:
    1.  In Ultiboard select Tools>>Netlist Editor>>Pins, press the Delete button
    2.  Select all nets in the Select the Net to Delete dialog and then press the Delete button.  This will clear all nets in the layout, don't worry all traces, parts are still on the design.
    3.  Go to Multisim and select Transfer>>Forward annotate to Ultiboard.    This will add all nets that you removed back and it should fix the pin problem
    Tien P.
    National Instruments

  • Need an app or a script to find a list of files and retrieve them

    A few years ago at an old job I used an application that could search a hard drive for a list of images all in one shot. The names of the images were typed into a txt file. the text file was used as the search list and the application would report back if the images were found and it would retrieve them. Where can I get my hands on something like This or can it be built in Automator?

    'I used an application that could search a hard drive for a list of images all in one shot ... and it would retrieve them.' - desired result is too vague.
    'Where can I get my hands on something like this ... - perform a 'Google' or equivalent search.
    "... or can it be built in Automator?' - possibly yes.
    On your behalf the above request is re-written below.
    Can someone assist me in AppleScript scripting. I am trying to open a '.txt' file which lists on each line a file to search for, and if found - to open its containing folder. Is such a process also possible with 'Automator'? Thank you for any assistance.
    One possible AppleScript solution:
    -- Code starts here --
    set tFile to read (choose file) -- One was to obtain the file, to open.
    set tPars to paragraphs of tFile -- create a list of paragraphs of selected file.
    repeat with i in tPars -- Cycle through the list of paragraphs.
    with timeout of 0 seconds -- Prevent AppleScript timeout error.
    set tItems to paragraphs of (do shell script ("locate " & (quoted form of i))) -- Obtain list of found filename files.
    end timeout
    repeat with j in tItems -- Cycle through the list of found file.
    try
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"} -- Extract container of file.
    set fPath to text items 1 through -2 of j
    set AppleScript's text item delimiters to "/"
    set fPath to fPath as string
    set AppleScript's text item delimiters to oAStid
    do shell script ("open " & fPath) -- Open container of file.
    end try
    end repeat
    end repeat
    -- Code ends here --
    If the above sample code is not exactly what you seek - then edit the code accordingly; and / or post requests with specific details.
    'Is such an action also possible with 'Automator'?' - please post an properly constructed request to the 'Tiger - Automator'
    forum.

  • Query listing primary user and the primary device

    Is there a query to list the primary device and the primary user associated with that device. Coming from a LANDesk environment I was able to create reports and queries that would list this information pretty easily. I can't seem to link the two in
    SCCM for reporting. Thanks 

    That's a SQL query that should be executed in SQL management studio. It can also be used to create a SRS report.
    Torsten Meringer | http://www.mssccmfaq.de
    Any hints, what it the query itself? And how it should be imported, that it will be created in SRS? Is there any instructions for this? Thanks.

  • How can I restore the list of users on the top bar of the IMAC as it has disappeared

    I have a new IMAC and could previously access all 3 users to log in from an icon on the top right hand of the top bar of the IMAC.  This has disappeared and I cannot restore it.  Is there something simple to get it back?

    Open Users & Groups preferences and enable Fast User Switching along with how you want users displayed.

  • Getting a list of users and permission from a folder

    I run this command to get a a list of users and permission from a folder
    $project_folder = "\\servername\foldername"
    get-acl $project_folder | %{ $_.Access  } | ft -property IdentityReference, AccessControlType, FileSystemRights > folder.csv.
    This only lists information for 1 folder.
    If i have multiple folders how should the code be modified?

    this is the code i am looking for 
     $project_folder
    = "\\servername\foldername\foldername1"
    get-acl $project_folder | %{ $_.Access  } | ft -property IdentityReference, AccessControlType,
    FileSystemRights > folder.csv.
    I  run this code and this gives me the information for only the folder 'foldername1'.
    Ex. i need a list of users who have permmission in \\servername\foldername\foldername2.
    i run the code and it gives me the permissions and list of users in foldername2.
    This is the issue
    IF there are multiple folders \\servername\foldername\foldername2, \\servername\foldername\foldername1,
    i need to run the code each time for 1 folder. 
    is there a command where i can combine the path of these 2 or more folders and export
    it to csv
    Ex.  $project_folder
    = "\\servername\foldername\foldername1",
    "\\servername\foldername\foldername2"
    get-acl $project_folder | %{ $_.Access  } | ft -property IdentityReference, AccessControlType,
    FileSystemRights > folder.csv.
    This will give me the list of users and the type of access they have in foldername1 and
    foldername2

  • How to find the list of users  used  transcation from last 2 days plz urgen

    hi friendd
                   i am in need of  knowing the list of users used transcation in last 2 days
    can any one help me . how to find out the list of  users and used trancation in detail or step by step
    thanks in advance .i know that i can see in st03 but i dont find any user list or trancations .
    apart from that so we have any other transcation to see the user in sap abap box
    regards
    raja

    This info has been posted before but here you go (this is an alternative way to Bernhards):
    ST03N, make sure you are in Expert Mode (not Service Engineer)
    Expand Workload
    Expand Total
    Double Click on the day you want to analyse
    You can see transaction details under Transaction Profile -> Standard
    You can see what tx a user has started under User & Settlement Statistics -> User Profile
    If you are not seeing any data then speak to your Basis administrator about what they are doing with the log files.

  • Responsiblities  and the list of users under each responsiblity

    HI,
    Am on 11.5.10.2 CU2
    RDBMS 9.2.0.6
    I need the list of Responsiblities and the list of users under each responsiblity. Can anybody please help me ..
    Thanks

    Hi user;
    Please check below thread
    to find any users assigned to a responsibilty *<< Posted By Hussein Sawwan*
    to find any users assigned to a responsibilty
    Regard
    Helios

  • How to get list of users assinged the same product catagory

    Hi  All ,
      we have a requirement in which we need to get the list of users who are assigned   the same  product category.
    ie if we give the  prod category 14000000 then  we need the list of users assigned the  14000000 prod category.
      is  any FM available.
      please  help.
    Regards
    Channappa Sajjanar

    Hi Chinnappa,
    1) You can create a table query for tables HRT1222 and HRP1222 to get the org Id or Position Id assigned for the product category.
    Then use FM BBP_OM_STRUC_GET_USER_FROM_POS to get the list of users for that org ID.
    2) or if you want to check list of prod categories linked to user ID, then use FM BBP_READ_ATTRIBUTES
    rgds,
    Ravi

  • List of Users and Roles Assigned in Portal (producer & consumer)

    Hi
    We are running federated portal EP 7.0 EHP1 SPS07, we need to pull the list of users and their roles assigned from tables or thru report in our federated portal, so that we can have a consolidated list of users and their roles in both producer and consumer portal
    Thanks
    Senthil

    Hi Senthil,
    Use report RSUSR002 to get list of roles for the users.
    Regards,
    Marasa.

  • Distance Between user and The kinect Device

    Hey all :)
    how to get the distance between user and the kinect ??
    i found a function but it's in kinect v1 
    public static double GetSkeletonDistance(this Skeleton skeleton)
                return (skeleton.Position.X * skeleton.Position.X) +
                       (skeleton.Position.Y * skeleton.Position.Y) +
                       (skeleton.Position.Z * skeleton.Position.Z);
    i don't know how to make it under kinect v2 ?

    Joint head = body.Joints[JointType.hipCentre];
    return head.Position.Z ;
    it always return 0 :/
    There is no hipCentre in Kinect v2 SDK. Have a look at
    JointType Enumeration. There you can see all the available JointTypes. I am using the
    SpineBase , because users may lean from time to time. So
    return body.Joints[JointType.SpineBase].Position.Z;
    should give you a nice distance. Keep in mind, that even the smallest changes will affect this value. So if you want to check for a distance, you might want to use a threshold or even joint accumulation.
    Best regards,
    Alex
    Edit: Please mark Brekel's answer as answer. Thanks.

  • Report of Users and their groups

    Hi Experts,
    Is there a way to extract all the Hyperion Planning Users and the groups they belong in Hyperion 11.1.2.1 version? I need an excel file having the users and groups.
    Thanks
    Kannan.

    Hello Kannan,
    Yes, a clean list of Users with their Groups...
    Nothing standard. Strange...
    You might see if this export has something you can use. I do not recall it from the vast amount of detail exported here. The file will be generated on the server, so you might need somebody to pick it up and give it to you.
    MaxL command
    export security_file to data_file "essbase_security_file.txt";
    The alternative is to query the Planning repository. Maybe somebody has experience with this?
    Regards,
    Philip

  • Query to find the list of users having access to a particular scenario

    Hi,
    I am learning Hyperion Planning 9.2 x version. I wanted to know the query to find the list of users having access to Plan Iteration - 1 scenarion.
    As I am new to Hyperion Essbase and Hyperion Planning, I am assuming these ideas work out to get the desired result.
    1) As Hyperion Planning uses Relational DB to store the User Security information, we can query the list of users who is having access to Plan Iteration - 1 Scenario.
    I am not sure if this solution works. Please correct me If I am wrong.
    2) We can also query from the essbase editor to find out who all having access to this scenario.
    If the above is correct, can you please provide me the query.
    I am really need of this and I will be happy if any one provide the solution.
    Thanks & Regards,
    Upendra. Bestha

    Hi,
    If you are looking for some SQL to retrieve the access rights by member then you can use something like (SQL Server code though can easily be modified for Oracle)
    SELECT usr.object_name as Username,mem.object_name as Member,
    'Access Rights' = CASE acc.access_mode
    WHEN -1 THEN 'None'
    WHEN 1 THEN 'Read'
    WHEN 2 THEN 'Write'
    WHEN 3 THEN 'Write'
    ELSE 'Unknown' END,
    'Relation' = CASE acc.flags
    WHEN 0 THEN 'Member'
    WHEN 5 THEN 'Children'
    WHEN 6 THEN 'Children (inclusive)'
    WHEN 8 THEN 'Descendants'
    WHEN 9 THEN 'Descendants (inclusive)'
    ELSE 'Unknown' END
    FROM
    hsp_access_control acc, hsp_object mem, hsp_object usr
    WHERE acc.object_id = mem.object_id
    AND acc.user_id = usr.object_id
    AND mem.object_name = 'Plan Iteration - 1'
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • I have a requirement where I have to give the list of users who can access a specific computer. I am new with PS. Do you have a script to list users that can access a computer object of AD ?

    I have a requirement where I have to give the list of users who can access a specific computer define in AD.
    I am new with PS.
    Do you have a script to list users that can access a computer object of AD ?
    I have executed the following script  but it does not give me the access rights of who can access the computer 'computername'
    How can i have this information. please help
    Import-Module activedirectory
    $computer=get-adcomputer "computername" -properties ntSecurityDescriptor
    $omputer.ntsecurityDescriptor.Access | select-object -expandproperty IdentityReference | sort-object -unique

    I would say that, since the OP has so little info, there are no policies in use.  It there were then this question would never be asked the way it is being asked.
    I had a client call with a letter from their insurance company; an accountant with malpractice insurance.  THey asked the same question inmuch the same way.  "What computer can you users access?"  The question should be more like
    "Do you have a policy that restricts access to computers and do you audit for compliance?"
    I have had other clients whose insurance asked the question in that way.  It produces a better view of what should be happening and how to show compliance.
    I recommend that companies being asked these questions by their legal departments or insurance companies should contract with a god computer security consultant to assist with answering these very tricky questions.  Of course if it is just you boss's
    curiosity  then you may need to discuss his requirements with him in more depth.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • To find Queries by InfoObjects

    Hi SDN Community Here is a reversal of a post made by another developer List of infoobjects used in a Query This has the reverse logic... thanks for the tip. *& Report  ZBW_FIND_CHARACTERISTICS_QUERY SAP Consulting BW Tools: *& Find Characteristics i

  • Calendar in List view different from Day and Month view

    When I look at my Calendar in 'List' view all of the Birthdays and Events are in the wrong date but in 'Day' and 'Month' view they are correct.  Has anybody found a fix for this yet?  I have looked at similar discussions but they are all a couple of

  • My safari no longer works on my mac desktop

    Safari No longer wroeks.  At first it would open up but not open any websites, now it won't even open up. This is what the CrashReporter says SafariDAVClient_2014-01-26-125107_Sues-iMac.crash SafariDAVClient_2014-01-25-135110_Sues-iMac.crash Safari_2

  • Why do i keep getting box: The URL is not valid and cannot be loaded.

    When changing web sites, a dialog box pops up every time Saying "The URL is not valid and cannot be loaded".

  • Buying Indesign software instead of Creative Cloud pay monthly

    Please can someone help? I have Adobe Photoshop Elements 12 and I also want to buy Adobe InDesign. I don't want to pay monthly as the level that I need it for I will not need updates on it etc etc. I would prefer to buy outright and not pay monthly (