Find user accounts question

TIA.
I'm trying to:
Find all 'user' accounts in AD which are enabled, then find those accounts which have not logged in for 60 days, then sort those accounts by lastlogondate, then provide a list of user names and lastlogondate, and (last in my thoughts but very important)
the count of the results.
I've only gotten as far as:      Get-ADUser -Filter {(ObjectClass -eq "user") -and (enabled -eq $true)}
I've tried to pipe it to Search-ADAccount -AccountInactive -Timespan 60.00:00:00 and have gotten a whole lotta red.
Any advice, links to read, etc... would be welcome.
Thanks again,
Davis

you could throw in a tee-object -variable myresults
and then get the count of objects: ($myresults).count
so the search-adaccount way:
search-adaccount -accountinactive -timespan 60 -usersonly | where-object { $_.Enabled } | tee-object -variable myresults | foreach-object {
$user = get-aduser $_ -properties lastLogonTimestamp
new-object PSObject -property @{
"DistinguishedName" = $user.DistinguishedName
"SamAccountName" = $user.SamAccountName
"lastLogonTimestamp" = [DateTime]::FromFileTime($user.lastLogonTimestamp)
$count = ($myresults).count
write-warning "Found $count inactive accounts!"

Similar Messages

  • Mavericks server alerts and User account questions

    Hi
    I'm looking for more detailed information about setting up Alerts in Mavericks Server, plus I seem to have a strange problem with new user accounts when setting up.
    More Info.
    I have a Mac Mini acting almost 100% exclusively as a Time Machine backup device with encryption of three portable computers on a wired network.  This was originally set up three years using Snow Leopard Server and a 2Tb external FireWire Drive.
    The external drive is now proving too small, and in any case is showing the possible first signs of failure when tested, so the intention is to replace it with a RAID of some sort, probably a 2-drive RAID 1 device but if the budget allows we might be able to look at RAID 5 or 6 units.
    It seems a good opportunity to clean install Mavericks Server on the Mini, so I've set up a test station on my MacBook Pro with my Mac Pro (both running 10.9.2) as a test backup client.  The Server OS is on an external FireWire boot drive, and the TM backup folders are on another external, in this case a USB 3.0
    For obvious reasons there does not seem to be any reason to turn on more services than absolutely necessary, so just Time Machine and File Sharing for the moment.  All works well but I can't seem to get Alerts working.  I've listed 3 different eMail addresses (all mine) for the alerts to be sent to, and I have two Admin Accounts for Notifications, both using the same AppleID I set the Server software up with.  I've gone through the rather sparse setup help information carefully, and there is no information about additional services being required, although I did try setting up the Mail client (tested sending and receiving) on the Server and having it running whilst the backups were being tested.
    As I said, the test backups went fine and when I disconnected the backup drive from the Server to simulate a failed drive the TM on the Mac Pro client showed an alert saying the backup drive could not be found.  However, there were no emails or Notifications received, either on the Mac Pro or my iPhone from the Server.
    There seems to be minimal amount of information available about the workings of Mavericks Server, but I have gone through what I can additionally find online about Mountain Lion Server, with no real indication of what it is that I am missing.  The only instructions seem to be exactly what I've done, so your advice would be appreciated.
    Another thing that puzzles me, is that when restarting the MacBook Pro I get all the Admin and Standard User Accounts (created in Server.app) showing at the login screen.  This is only four Accounts in total, so what would happen if this was 50 Users?  If I click on the 'User' tab in Server.app I get 83 User Accounts showing, but that was not the case until this evening, as only the Admin and Stardard User Accounts I had set up were visible.
    It's obviously possible that I've mucked up the install and basic setup somehow, but I can't see that anything I've done would have these effects as I've been careful to follow the options put in front of me.
    Thank you in advance.

    There's nothing to fetch. You assign the value from the function GET_APPLICATION_PROPERTY(USERNAME); as you would any value returned from a function.
    DECLARE
       myVar    VARCHAR2(50);
    BEGIN
       myVar := GET_APPLICATION_PROPERTY(USERNAME);
    END;Hope this helps.
    Craig...
    -- If my response or the response of another is helpful or answers your question please mark the response accordingly. Thanks!

  • CD/DVD Icon and User Account question

    I'm a noob with an iBook G3 and have a couple questions, since I just purchased it used and managed to get it up and running.
    Firstly, how does one open the CD/DVD player tray? There's no icon on the desktop or options I can find to add one. I did check to make sure the settings were set to display all drives and it does show in the System Info under ATA. So far, the only solution I've found is using the paper clip method and would rather have options.
    Secondly, the person who had it previous has a user account, and I was wondering how to remove/reset to make it my own. I have the OS X install CD as well as the OS 9 install disks. Obviously, question one will likely help with question two. Thanks!

    You really need the disc.
    You can go to System Preferences > Accounts and set up a new account, being sure to give it Administrative privileges. Log out and log in as the new user. Then you can delete the other account.
    The original owner should have given you the Tiger Install disc(s) as part of the deal or should have erased Tiger off the hard drive and reinstalled the version for which you have the Install CD.

  • DPM Agent - attaching agent user account question

    Hi there,
    I have a question concerning the attachment of User Agents.
    During the wizard you get asked to fill in a user account which is domain user and local admin. I am working in a big organization and we use service accounts as much as we can. I found out the user account I am to use has insufficient rights, I have
    found out my own AD user account works for the attachment. It is alot of work to have another department in the organisation change the rights of the service account(s).
    I was wondering what purpose does the account you fill in serve. I have seen that the service runs under local system and I can't really find any information about what the user account actually does(right at that moment or later on, doesn't matter).
    I am asking this since I could use my own AD account if its just for authorization during the attachment but not if the account I fill in gets used in a later sitatuation.
    Can anyone clear this up for me?

    Hi,
    The User Account is only used for Installing and attaching the Agent on the remote Server/Client, so best will be to use a Domain Admin user.
    The Agent willalways run unter System Account, so no Special Service Account will be needed.
    Seidl Michael | http://www.techguy.at |
    twitter.com/techguyat | facebook.com/techguyat

  • Simple Finder/User Accounts

    I was using my user account that I created, I Simplified the Finder when I first created the account. I put in a CD and for some reason it did not show on the desktop. Then I realized the account had Simple Finder. I clicked Finder on the desktop and choose "Run Full Finder" and was prompted for a password. Then Mac HD appeared and the CD icon.
    So, On User accounts that are created with limited access such as the ones you create with Simple finder,
    Will you have to "Run Full Finder" each time if you want to see CD icons, files, or folders on the desktop?
    Thanks in Advance!

    I should also note that I am managing accounts from OS X server so if there is a way anyone knows of to just not display shared and local disks / servers in the finder by default that would work too and I could lockdown the rest of the desktop through workgroup admin instead of simple finder.
    Thanks again
    ~ Ben

  • Multiple user account question

    I have created a second user account on my G5 but every time the person logs on the computer asks for a administrator name and password. I think the reason is to access the wireless internet connection. Is there any way to set this account up so that they can have access to the internet without requiring my name and password?
    Thanks, D.J.

    You need to edit the file as root, and there is no simple way of acquiring the needed permissions in TextEdit. Use TextWrangler to edit the file.
    An administrator password will be required to save the changes. TextEdit does not contain the code needed to implement the authentication.
    (24291)

  • User account question

    I am wanting to use contribute to allow a client to create a new page to update a 'customer page' that tells the status of his clients projects.
    I have considered InContext, but i need for him to be able to create a whole new page from scratch with a separate url. i set him up with another program that password protects the url for client login.
    I could not tell from the description page if this is the right program or not. Or is Contrribute jysust for web developers? I was looking for something like GoLive used to have for CMS function, where a client can login and create a page and edit it.
    Or if anyone has a better solution, i'm all ears.
    Thanks!

    Hi Burgessf,
    To view all user accounts locally created on ASA , go to ASDM--->Device Management--->Configuration-->Users/AAA-----> User Accounts.
    Also if Active Directory is integrated for user authentication, then see which OU is specified under base DN attributes. ASA can query only that OU for user authentication.
    Device Management-->Configuration----->AAA server Group--->Servers in the selected Group--->Select AD server------>Edit----> Base DN----->OU= what ever OU specified there.
    All users specified in that OU can login to the device but they may have different level of authorization.

  • Sharing libraries between user accounts question

    After many years of having one user account on our iMac, I have decided to segregate user accounts for me and my wife. I'm doing this because I have an iPhone and she is going to get one soon. When we sync our respective iPhones, we want to keep iCal and and Address book information unique to each user account. What I'm trying to figure out is how to share iPhoto and iTunes content between user accounts. I know there is a share preference that will allow the master libraries in these applications to be shared, but the photo albums and playlists created on the original user account are not "shared". Would it be possible to have playlists from iTunes and albums/events from iPhoto to be shared between user accounts? This would enable my wife to sync all her iPhone data from her user account. Thanks in advance.

    I have an idea that uses a different approach. I haven't done this for this purpose, so if you decide to try, please do it one step at a time so you can undo it. I'll explain it for iTunes.
    Instead of using the Sharing preference in iTunes, put the iTunes Music folder in a location that can be accessed from both accounts. You might use an external drive, or the <hard drive>/Users/Shared folder.
    iTunes should NOT be running. Go to /Users/<username>/Music/iTunes folder. In that folder is the iTunes Music folder. Copy this folder to a location on the external drive or to the Shared user folder. Rename the original iTunes Music folder another name, such as iTunes Music Old. Make an alias of the new iTunes Music folder (in the shared location) and put it in the user's iTunes folder (where iTunes Music Old now resides). Rename it "iTunes Music" if necessary (you are making the alias take the place of the actual iTunes Music folder). * It is very important that the name be exact.
    Start iTunes. All of your music and other media should be accessible as if the iTunes Music folder is where it used to be. To prove to yourself that the files are being accessed from the new shared location, do a Get Info on a couple of songs in iTunes. "Where" should show the file to be in the new location. To prove to yourself that you can add new content to the new location, download a free song from the iTunes Store (or a Podcast) or rip a CD. Then do a Get Info on the new item.
    Up to here, I'm confident it will work, because I have done it. The rest is "theory"...
    Copy the old user's /Users/<username>/Music/iTunes folder (except the now duplicated iTunes Music Old folder) to the shared location. You are only doing this step so that it will be available when you log in as the new user (your wife's account), which is the next step.
    Log out and log in to the new account.
    Copy everything in the old user's iTunes folder (that you just put in the shared location) to the new user user's /Users/<username>/Music/iTunes folder. Replace any duplicated items. You want the new user's iTunes folder to look exactly like the old user's iTunes folder (except for iTunes Music Old). Hopefully, that iTunes Music alias will connect to the actual iTunes Music folder at the shared location. Try it. Run iTunes as the new user. Hopefully, everything looks like the old user's iTunes. Do the tests like before to prove it.
    At this point, the two iTunes "looks" will start to diverge. But at least the starting point will be the same.
    If something does not work as expected, log in to the old user's account. With iTunes NOT running, go to /Users/<username>/Music/iTunes folder. Delete the iTunes Music alias. Rename the iTunes Music Old folder back to iTunes Music. Everything should be back to the way it was.
    If it works to your satisfaction, you can eventually delete that iTunes Music Old folder.
    I don't use iPhoto, but if iTunes works, you can do the equivalent steps for iPhoto.

  • Help - iMac Storage/New user account question

    Ok - so I've assumed that my user account was corrupt as Ive been having problems with Safari crashing/freezing the whole of my Mac, but thats another storey.
    So i decided to create a new user account to delete the old one. I copied the following folders from my original user account into the shared folder first of all:
    Pictures
    Music
    Movies
    Documents
    I've now deleted the old account and copied these folders from Shared into my new user account - actually Ive just left Music, Pictures & Movies in shared and am going to point the relevant apps such as iTunes to the shared folder.
    The problem I have, is that I've lost over 100gb of storage somewhere on the Mac and I can't see where!
    As far as I can see, I've deleted everything so that there is only one copy now and have emptied the Trash folder.
    Anybody got any suggestions - perhaps a hidden folder somewhere?
    Thanks

    >>... I can't seem to see it anywhere anyway...
    It would be a folder or disk image (.dmg) in /Users, along with your current account home.
    >>I might try and get rid of the Events folder - not sure if I need that or not?
    iMovie (2013): Updating projects and events from previous versions of iMovie
    and especially
    iMovie (2013): Removing old libraries after updating
    say that you probably don't...
    'You can delete these folders if you no longer want to work with them in the previous version of iMovie.
    Before removing your projects and events, make sure they have been updated for iMovie version 10.'

  • Can't find user account when trying to delete

    I'm using an iMac computer.
    And the problem I'm having is the following:
    I'm trying to delete an user account from my computer following the steps from apple.
             http://docs.info.apple.com/article.html?path=Mac/10.5/nl/8163.html
    So at step 3 they say I have to click on the user account I want to delete.
    But I cannot see the user account in the list.
    It is the only account with an password, but that person doesn't know the password even with the clues for it.
    Besides that I currently don't have the option to contact him.
    I am the main user so I hope it shouldn't be a problem.
    Does anyone know a solution for my problem?
    Or did anyone had the same problem?
    My thanks in advance!

    'Other' is the Root account - it shouldn't be enabled.
    From any admin account -
    How to disable the root user
    Mac OS X v10.6 and later
        1.    From the Apple menu choose System Preferences....
        2.    From the View menu choose Accounts.
        3.    Click on the lock and authenticate with an administrator account.
        4.    Click Login Options....
        5.    Click the "Edit..." or "Join..." button at the bottom right
        6.    Click the "Open Directory Utility..." button.
        7.    Click the lock in the Directory Utility window.
        8.    Enter an administrator account name and password, then click OK.
        9.    Choose Disable Root User from the Edit menu.

  • User accounts question - always baffled me!

    Hey Everyone, I'm just setting up some user accounts on my mac for the kids but just know something before I start:-
    • I want to install loads of games/applications etc on the main admin account that the kids can play on. If I create acounts after installing the games etc on the admin account - will these applications show up for everyone or do I have to install them on each indiviual acccout? (4 in total!)
    Thanks in advance for your help, it's always bafled me when it comes to creating acounts.
    If you have any tips on how to do this easily too so each kid has the exact same things installed too, that would be great!
    Mark

    Yes, applications installed in the Applications folder will be available to any user provided you give them access to the applications via Parental Controls.

  • Deleting a user account question

    Hi everyone, can anyone tell me the best way to delete a user account on my computer? Basically I no longer need two accounts and the music, movies and other information from the other side have been transferred to another computer. What I need to know if should I delete all the files from the user account before deleting the account or will deleting the account automatically delete all those files?
    My main concern is freeing up space on the computer again and want to be sure the way I do it will do the job. Thanks for any help.
    -Brian

    What I need to know if should I delete all the files from the user account before
    deleting the account
    You don't need to do anything beforehand. After following Macjack's instructions you will be presented with this option screen, and can choose accordingly:

  • 10.5.3 Local User Account Question

    I'm sure this is an extremely basic question. I don't understand OD/LDAP/Active Directory. I’ve got a mac mini I use as a home media server. I mistakenly added a login item using System Preferences and now the account can’t login locally. It is no longer recognized as a valid local account, but I can still check email, access wiki's, etc. When I login as root, WorkGroup Manager says the account only exists in ldap://127.0.0.1 and won’t let me login locally. How can I convert the account back to allow local access, and maintain access to email, calendar, etc.?
    Thanks
    Jeff

    Hi Vin,
    What's happening in your scenario is that you have your Access Policy/Identity using only AD1, this will force the ACS to check only in the Active Directory database.
    If you want to use both databases you need to create an Identity Store Sequence, this is done under "Users and Identity Stores/External Identity Stores/Identity Store Sequences"
    In this section you need to define both databases like the example below:
    Then you need to use this option under Identity. Check below:
    Let me know if it helps.

  • When I click on the icon to start firefox, the screen dims and I get this question in a dialogue box from User Account Control....."Do you want to allow the following program to make changes to this computer"

    Every time I start firefox

    '''If you have Windows-7: Home Basic and Home Premium this works.'''
    1. Create a new text file
    2. Copy the text below into it.
    <code>
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "ConsentPromptBehaviorAdmin"=dword:00000000
    </code>
    3. Save as, e.g. DisableUACadmin.reg The reg extension is recognized by the registry editor.
    4. Double-click your file and accept everything.Then do PART II below.
    '''If you have Windows-7: Professional (Business), Enterprise and Ultimate Editions this works.'''
    1. From the START MENU open the Control Panel and click on the Administrative Tools icon.
    2. Double click on Local Security Policy to open it.
    3. Browse down to Local Policies and then down to Security Options
    4. In the list find: “User Account Control: Behavior of the elevation prompt for administrators in Admin Approval
    Mode” and double-click on it.
    5. Using the dropdown window change the setting to “Elevate without prompting”.
    6. Close out all your windows and do PART II below
    '''PART II'''
    For all versions of Windows-7, now you can right-click the FireFox icon and select properties. Click on the Compatibility tab and select "Run this program as an Administrator".
    No more UAC for Firefox.

  • HT201441 i just bough a used iphone but looks that it was found and i cant unlock it. its still link to the last user my question is how do i find out who is the last owner so i can unlock it

    i just bough a used iphone but looks that it was found and i cant unlock it. its still link to the last user my question is how do i find out who is the last owner so i can unlock it

    peeweenborre wrote:
    i just bough a used iphone .... its still link to the last user ...
    If you cannot get this information from the seller
    Removing a device from a previous owner’s account
    You need to return the Device for a refund,

Maybe you are looking for