Getting All Local Groups, Group Members and Local accounts on all Servers

Hello Everyone,
Sorry if this has been covered already, but I didnt see anything that quite answered my question.
I've been given the task of generating an Access Control List here at work and I've managed to piece together a few scripts that gets me so close it's frustrating.
The script I have now will parse through a text file with all my Windows servers listed in it and it does output in the console the server name, all of the groups on the server (Administrators, Remote Users, Backup Operators, etc.) and all the individual
members of those groups and nested groups.
However, I can't seem to get it to export to a CSV for easy digestion.  I've tried to pipe the export-csv command, but the csv it gives me doesnt have any useful information in it.
Here is the script:
$list =@()
$Servers=Get-Content ListOfComputers.txt
foreach($server in $Servers) {
$server | % {
$server = $_
$server
$computer = [ADSI]"WinNT://$server,computer"
$computer.psbase.children | where { $_.psbase.schemaClassName -eq 'group' } | foreach {
"`tGroup: " + $Group.Name
$group =[ADSI]$_.psbase.Path
$group.psbase.Invoke("Members") | foreach {
$us = $_.GetType().InvokeMember("Adspath", 'GetProperty', $null, $_, $null)
$us = $us -replace "WinNT://",""
$class = $_.GetType().InvokeMember("Class", 'GetProperty', $null, $_, $null)
$list += new-object psobject -property @{Group = $group.Name;Member=$us;MemberClass=$class;Server=$server}
"`t`tMember: $us ($Class)"
The format it pumps out to the console is good, other than it's somewhat upside down, the members are all listed above the group name such as below, where there's no members in the Administrators group, but User1, 2 and 3 are part of the Remote Desktop Group.
 This isn't horrible as I can cut and paste it out of the console and into a spreadsheet, but then i have to shift things up a row and doing that for the entire list is going to be way more work than I'd like.
Server01
Administrators
User1
User2
User3
Remote Desktop Users
When I use export-csv on the script above I get a bunch of numbers rather than groups or members like this:
Length
13
51
40
35
63
63
35
32
Hopefully, there's someone out there who can help me tweak this script so that I can just dump it all to a csv and be done, with little to no massaging of the data afterward.
Thanks in advance,
Tyler

Sure. After you've run the script, type this in the console:
$list | Export-Csv .\groupInformation.csv -NoTypeInformation
You'll then have a CSV file in the directory, open that with Excel and see if that gives you the information you're after.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing)

Similar Messages

  • Possible security problem with my iPhone4, it seems like it has been hacked into and my hotmail, facebook and university accounts (which all have different passwords) and proceed to change my passwords on me. This has happened twice.

    I seem to be having security problems with my iPhone4, it seems like someone has hacked into my hotmail, facebook and university accounts (which all have different passwords) and proceed to change my passwords on me. This has happened twice and I have not left my phone unattended at any time that I can recall nor have I accessed these accounts from another source (i.e. computer/laptop) since changing my passwords after the first hacking occurred. Please help.

    Anyone else at your university complaining about the same thing?  It is more likely someone is stealing passwords by sniffing traffic over the university wifi or with a man-in-the-middle attack or by other means external to your phone.  Try a Google search on "steal password" (without quotes) or "steal SSL password" and you'll learn more than you wanted to know about how passwords get stolen.
    Some related info:
    http://en.wikipedia.org/wiki/Session_hijacking
    http://en.wikipedia.org/wiki/Man-in-the-middle_attack

  • I erased all the contacts, apple ID and icloud account in my old 4s and gave it to someone. However, whatever contact that someone has saved in my old 4s phone has added in my new 5sphone. Does anyone know how to solve this?

    I erased all the contacts, apple ID and icloud account in my old 4s and gave it to someone. However, whatever contact that someone has saved in my old 4s phone has added in my new 5s phone. Those are not my contact and I don't want them in my new phone. Does anyone know how to solve this problem?

    Ln the old iPhone, -> What to do before selling or giving away your iPhone, iPad, or iPod touch

  • I syncronized my mom's iphone on itunes in my computer.. i put some music in her phone, but then, when i syncronized my iphone all my stuff went away and now i have all my mom's stuff in my iphone... even her apple id and everything... i am craying.. plea

    I syncronized my mom's iphone on itunes in my computer.. i put some music in her phone, but then, when i syncronized my iphone all my stuff went away and now i have all my mom's stuff in my iphone... even her apple id and everything... i am craying.. please helpe me to have my phone again

    When you connect the iPad to the computer can you see any apps in the apps list at all in iTunes?
    Connect the iPad to the computer and launch iTunes.
    Click on the iPad name on the left side under devices.
    Click on the Apps Tab on the right.
    Do you see apps in that apps list? If you do, click on all of the apps that you want to sync.
    Click on the Sync Apps Heading.
    Click on Apply in the lower right corner of iTunes

  • I am not getting my news , sports etc notifications and my settings are all turned on?

    I Have all my notifications turned on and still not getting news, sports, Facebook , etc notifications to pop up

    Is there any orange showing on the switch on the side of the phone? If so, it should be in the up position to enable sounds. As for the notifications that are not appearing, have you checked under Settings > Notifications, and verified that the apps there have a type of notification set up?

  • I have multiple devices (imacs, lap tops and ipads) all connected to a NAS server.  Can I create a user for myself and one for my wife, and each have our own apple ID, and Itunes accounts, but all share the same media on NAS drives?

    I have multiple devices (iMacs, Lap tops, Ipads) all connected to a Nas Drive.  Can I create a user for myself and one for my wife and we each have our own apple ID's, Itunes etc, but share the same data on the hard drives?  So when she logs in, and sync's her ipads, they will sync with her stuff and when I do the same under my user account, on the same device, my ipads will sync with my stuff?

    You can share the same Apple ID for purchasng form the iTunes and app stores without any problems, but you should all used separate iCloud accounts with separate Apple IDs.  (You are not required to use the same ID for iCloud and other services as you do for the iTunes store.)  This will prevent you from ending up with merged data.  You should also use separate Apple IDs for iMessage and FaceTime or you will end up getting each other's text messages and FaceTime calls.
    This article may be of interest: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/, as well as this video: http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l.

  • Walk through all files in a folder and do this for all subfolders and...

    ... and their subfolders, etc. I mean I want to recursively walk through all subfolders of a folder and when I'm "in" in each folder I would like to walk through all files alphabetically of that folder.
    While iterating through the files (of a certain type: .mp3, .mp4, .m4a) of that folder, I need to make a simple counter. e.g. when counter is 3 it means we are on the 3rd file alphabetically of the folder.
    Then I simply want to set the track # mp3 tag of that file to this counter value (e.g. 3)
    Anyone know how to do this? or at least to be able to show me the walking the folders and iterating the files bit? I'm brand new to applescript.
    Why do I want to do this? Well I have a lot of live music shows, each in its own folder, but in my apple devices and itunes when I play a show it will not show the songs in the correct order. The file names are alphabetical in the correct order though and I suspect if I assign track #s then itunes, ipods and iphones will be able to play the "album" back in the order listed by track #??

    What are you using to play your items? iTunes can use various properties to sort a playlist, independent of what the file name is (Finder too, for that matter). If you are just wanting to add a prefix number to a file name, you would also probably need to use leading zeros to keep it in order when sorted by name.
    The following is a general purpose handler to go through the items in a folder - I just put various text into the output list as an example.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run -- example
    set TheFolders to (choose folder with multiple selections allowed)
    choose from list (ProcessStuff from TheFolders)
    end run
    to ProcessStuff from SomeItems
    process items contained in SomeItems, recursively descending the directory tree
    parameters - SomeItems [list]: the items to process
      returns [list]: a list of processed items
    set FilesList to {} -- this will be a list of processed items
    repeat with AnItem in SomeItems
    set AnItem to AnItem as text -- get the contents
    set FileInfo to (info for AnItem as alias) -- see Standard Additions
    if (folder of FileInfo) and not (package folder of FileInfo) then -- a folder (not a package)
    -- do something with the folder, if desired
    set the end of FilesList to "folder  " & AnItem
    try -- sort and process contents, skipping any errors
    tell application "Finder"
    set SubItems to (get items of folder AnItem)
    set SubItems to (sort SubItems by name) as alias list
    end tell
    set FilesList to FilesList & (ProcessStuff from SubItems)
    end try
    else -- a file
    -- do something with the file, if desired
    set the end of FilesList to tab & (name of FileInfo)
    end if
    end repeat
    return FilesList
    end ProcessStuff
    </pre>

  • Difference between Groups books/IFRS and Local Stats Depreciation Areas

    Hi
    We created assets with difference useful life between Groups and Stats of which the asset depreciation difference between two dep areas is posted in to seperate GL account starts with "S" used for local stats purpose. Any idea how to avoid this difference getting posted to other stats GL account.
    We also tried to have same useful life between dep areas. But still i can see depreciation difference is getting posted in dep area 30.
    Kindly help.
    REgards,
    Hari

    Hi Hari
    Welcome to SDN.. This is standard behaviour....
    If you have 2 dep areas posting to FI, then you need to create a 3rd depre area as Delta Dep Area which manages the differential posting between Dep Area 01 and Parallel Dep area
    Only solution to avoid this is to have the Parallel Dep Area as STatistical Dep Area i.e. It should not post to FI (Indicator 0 in OADB)
    br, Ajay M

  • Group cur. amount and local curr. amount are not matching in CO88 Settlemen

    Hi Gurus,
        After settlement in CO88  for some process orders only in settlement accounting doc Group currency amount is not calucalted correctly against Local currency amount . Pls find details below
    For one process order in co88 setllment accounting document local currecny amount 12312.89 RSD  , In BKPF table i have chekced the doc has picked to convert it in to Group currecny (USD) exchange rate type M and  indirect exchange rate from RSD to USD  71.96. The document posted on 30.6.2011 , exchange rate maintaied in TCURR table on 01.06.2011 as 71.96. SO The system has picked correctly upto this.
                    As per this Group currecny amount should be = 12312.89/ 71.96 = 171.10
    But system posted Group currecny  as  = 45.74 USD , 
           How the system posted 45.74 in USD. Pls suggest what could be the reasons for this .This is happening only for some process orders.
    Thanks & regds
    Ramachandra

    thank you

  • I am getting sync problems with Exchange Server and local outlook. Error code is 18439. Does anybody have an idea what the problem might be?

    I am using Outlook on my Imac, which is linked to the Windows Exchange Server. All off a sudden I keep receiving messages saying that the message Re: xxxx cannot be synchronized with the exchange server. When I delete the message from my local mail box, all is fine, but after a while another one pops up. The error code is 18493. Does anyone have an idea what could be going wrong???
    Thanks for your help already now!

    Hello Wolfgang,
    I get the same error, but I cannot figure it out too. I hope you or I get some responses back! I do not know why there isnt an edit feature in outlook to acknowledge the individual alarm so it does not alarm again!
    Fil

  • List all printers configured from server and local machine when hosted in server machine and working from Client machine

    Hello Team
    I am developing web application in asp.net. When application run from IIS(hosted in server machine running from client machine using web browser) application should list all the configured printers in local and network.
    can any one please let me know the process, in this i was able to load printers from server, so need to load printers from local machine.
    Thanks in Advance
    Bindu

    Hi Bindu,
    I am developing web application in asp.net. When application run from IIS(hosted in server machine running from client machine using web browser) application should list all the configured printers in local and network.
    From this message, this is a web application in asp.net, and it also related to IIS.
    You should post in the dedicated ASP.Net Forum
    http://forums.asp.net
    For IIS issue, http://forums.iis.net/ IIS forum should post.
    Thanks
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Profit center and profit center group wise profit and loss account

    Hi
    My name is swetha i have one doubt in ecc 6 version.   i need profit & loss account profit center and profit center group wise is it available in sap ecc 6 . Could u please details such kind of informatiion how we will get the p&l report  in sap profit center group and profit center with transaction code.
    Regards
    Swetha

    Hi
    Please use report
    S_ALR_87009712 - Profit Center List: Plan/Actual
    Here you can enter the Profit Center Group for which you need the P&L .
    Also create a account group which should include all your PL accounts and use the same in the selection of the report.
    There are other reports you can try on the same concept.
    S_ALR_87009712 - Profit Center List: Plan/Actual
    S_ALR_87009726 - Profit Center Group: Plan/Actual/Variance by Origin
    S_ALR_87009734 - Profit Center Group: Plan/Plan/Variance
    S_ALR_87009717 - Profit Center Group: Quarterly Comparison of Actual Data
    Thanks

  • I keep getting support not installed error 2 and tried to unistall all and keep getting it

    i uninstalled itunes following the instructions but keep getting the error message that i need apple support error 2 and reinstall itunes

    See Troubleshooting issues with iTunes for Windows updates.
    Start with the section Install missing components.
    tt2

  • How to get rid of automatically created Mail and iCal accounts on client?

    I have recently setup an OS X 10.6 Server for our small office. I got the domain name wrong in the initial install and fixed this by doing a complete clean reinstall of OS X 10.6 server (now upgraded to 10.6.4).
    The problem is that one of the OS X 10.6.4 clients had been setup to talk to the server prior to the rebuild. Now on this client, I cannot work out how to get rid of or change the automatically created server accounts in iCal and Mail - everytime you login, these are recreated using the old domain name (and of course don't work).
    In Mail if you remove the server account (from Accounts in Preferences), it just pops back again. I even removed every trace of the old domain name from the apple.com.mail.plist file but when I re-open Mail that darned server account (with the old domain name) just pops up again.
    In iCal its slightly different in that you can remove the account and it stays away while you have iCal open. But as soon as you close and re-open it, that server account just pops up again!
    I thought it might be something to do with Kerberos and found a Kerberos file on the client which had the old domain name throughout it - I changed all these references to the new domain name, but still the same behaviour in Mail and iCal.
    This is doing my head in. Any ideas?

    I have the same problem. Every time that I open iCal on the client a new account is created and an error message shown that I cannot login. I can delete the wrong account in the iCal preferences. However, as soon as I restart, the account and the error message are back.
    How do I "unbind" and "rebind" a client? I searched the "Mac OS X Server
    Open Directory Administration Version 10.6 Snow Leopard" but the only reference to "binding" seems to be in the context of Active Directory which I don't have.
    Any help is greatly appreciated.

  • Hot to get rid of automatically created Mail and iCal accounts on client?

    I have recently setup an OS X 10.6.2 Server for our small office. I got the domain name wrong in the initial install and fixed this by doing a complete clean reinstall of OS X 10.6 server (then upgrade to 10.6.2).
    The problem is that one of the OS X 10.6.2 clients had been setup to talk to the server prior to the rebuild. Now on this client, I cannot work out how to get rid of or change the automatically created server accounts in iCal and Mail - everytime you login, these are recreated using the old domain name (and of course don't work).
    In Mail if you remove the server account (from Accounts in Preferences), it just pops back again. I even removed every trace of the old domain name from the apple.com.mail.plist file but when I re-open Mail that darned server account (with the old domain name) just pops up again.
    In iCal its slightly different in that you can remove the account and it stays away while you have iCal open. But as soon as you close and re-open it, that server account just pops up again!
    I thought it might be something to do with Kerberos and found a Kerberos file on the client which had the old domain name throughout it - I changed all these references to the new domain name, but still the same behaviour in Mail and iCal.
    This is doing my head in. Any ideas?

    I have the same problem. Every time that I open iCal on the client a new account is created and an error message shown that I cannot login. I can delete the wrong account in the iCal preferences. However, as soon as I restart, the account and the error message are back.
    How do I "unbind" and "rebind" a client? I searched the "Mac OS X Server
    Open Directory Administration Version 10.6 Snow Leopard" but the only reference to "binding" seems to be in the context of Active Directory which I don't have.
    Any help is greatly appreciated.

Maybe you are looking for

  • Connect Mac Mini 2011 to iMac 2010 via MiniDisplay Port?

    Thought I read somewhere that a Mac mini could be connected to a 27" iMac for display purposes. I have the 27" iMac from 2010 and it has the minidisplay port. I'm considering getting the new Mac Mini. Can the two be connected so that the iMac display

  • Iphone 5 LTE after updating to iOS 8.0.2

    hello. i wave a small question. i have iphone 5 ios 8.0.2, my wife have iphone 5c ios 8.0.2. we are in st louis right now, she has LTE signal all the time, i never. we both using at&t. is this because of the difference of the iphones modems/antennas/

  • Flash player will play multiple layers of the song...

    Has anybody run into this problem? Is this because of a setting on my flash media server? On SOME computers, the player will play multiple layers of the same song, making it impossible to listen to. Its ok on the PC not on some MACs. Please help!!!

  • Transaction in group currency

    Dear all, we are implementing FSCM module. Our customer needs to have transaction in document currency, local currency and group currency. Table VTBFHAPO shows only document and local currency amounts. Some of you can tell me how to solve this proble

  • App for creating complex and data-enclosed forms

    Hello guys, This may be a wrong place to ask this but hey i don't know where to go, so here goes: I'm looking for an app (OSX) with which i can create quite complex forms, and with that i mean the following example: Like in Acrobat Reader Pro you can