Script for Inactive computer from last logon time stamp

Hi Freinds,
I have a list of servers which include some specific servers (around 900 servers). now i need to check those servers which are not logged on from last 30 or 60 days. 
I find the scripts which run against AD and list the servers but here i need to check from the specific servers. 
I know this is possible but not sure how it can be. Please Help 
Thanks.
Anjani Kumar

Hi Anjani,
you really might want to try learning Powershell for yourself, if you have to manage hundreds of servers. That said, there are some fairly simple and obvious tools, with which you can do this:
"Get-Content" gets contents from text files and stores it line by line into an array. Maybe a list of those servers?
"foreach" allows you to loop through each item in an array and do something with the item.
"Get-ADComputer" searches for computers in an AD. You can filter which computer-object you get (say - only get a computer that is named thus ...).
If you have any questions about these commands, asking the powershell might help you (Example: Get-Help Get-Content -Detailed).
Cheers,
Fred
There's no place like 127.0.0.1

Similar Messages

  • Get Inactive User in Domain based on Last Logon Time Stamp

    Dear Experts,
    I have used this code, but it is not displaying proper result, please help me how to display only "Daysinactive=90", for me it is display all the user.Please help me
    # Gets time stamps for all User in the domain that have NOT logged in since after specified date 
    # Mod by Tilo 2014-04-01 
    import-module activedirectory  
    $domain = "domain.mydom.com"  
    $DaysInactive = 90  
    $time = (Get-Date).Adddays(-($DaysInactive)) 
    # Get all AD User with lastLogonTimestamp less than our time and set to enable 
    Get-ADUser -Filter {LastLogonTimeStamp -lt $time -and enabled -eq $true} -Properties LastLogonTimeStamp | 
    # Output Name and lastLogonTimestamp into CSV  
    select-object Name,@{Name="Stamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('yyyy-MM-dd_hh:mm:ss')}} | export-csv OLD_User.csv -notypeinformation
    Hari

    Hi,
    Use the -AccountInactive parameter of Search-ADAccount:
    http://ss64.com/ps/search-adaccount.html
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Last logon time from list of computers?

    Hello,
    I'm looking for some type of script that will query a list (c:\script\computers.txt) of computers and return the last logon date and user.
    I do not want to do this from active directory, but instead want to get the data directly from the machines. So to sum it up I need to input a list of host names (all on the network) and output a list of last logon time stamps.
    Any help is appreciated!
    Thank you,
    Brian

    Hi
    Well AD will be your best option but you can try this in a bat file:
    net user User| findstr /B /C:"Last logon"
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Get last logon time,computer and username together with Powershell

    I have a script which gets the last logon times of each computer in the domain.
    My script:
    $dcs = Get-ADComputer -Filter { OperatingSystem -NotLike '*Server*' } -Properties OperatingSystem
    foreach($dc in $dcs) {
    Get-ADComputer $dc.Name -Properties lastlogontimestamp |
    Select-Object @{n="Computer";e={$_.Name}}, @{Name="Lastlogon"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}}
    ==================================
    Result:
    Computer Lastlogon
    DC1 6/06/2013 16:38:24
    DC2 6/06/2013 16:30:40
    =============================================I also want to get who/which account made this logon. For example:Computer Lastlogon User
    DC1 6/06/2013 16:38:24 user2
    DC2 6/06/2013 16:30:40 user1

    I also want to get who/which account made this logon. For example:Computer Lastlogon User
    DC1 6/06/2013 16:38:24 user2
    DC2 6/06/2013 16:30:40 user1
    The last logon from aD is the last time the computer account authenticated on AD.  It has nothing to do with a user.
    Get-ADComputer will not return DCs. It will return all workstations.
    To find the last logon for a specific computer just query the computers security log for event 529(XM-2003) or 4672 Get the newest one.
    ¯\_(ツ)_/¯

  • Last Logon Time in Iplanet Directory Server 4.1

    Hi,
    It would be great help if any one of you could let me know the attribute in Iplanet Directory Server 4.1 to get the Last Logon Time of a particular account.
    The Directory Server is on solaris.
    Thanks

    Hari,
    You can try to find it from the logfiles.
    I actually designed a plugin for this type of thing, but it's not yet implemented. It would simply write a timestamp to a user's entry after every successful bind, among other things which I won't go into detail about now...
    Oletko suomessa?
    podzap

  • Last Logon Time

    Hi,
     In Exchange 2003 I looked into the Mailboxes on a Mailbox Store. It has a label Last Logon Time. What is this last logon time? Where does it get it from? I have users already using another email system which is web based and they are no longer using
    outlook on their PCs.
    Thanks!

    Last Logon Time that is shown in Active Directory and Exchange are different. Active Directory shows last successful authentication and Exchange shows last time when mailbox was accessed. However, Exchange uses many background processes that access the
    mailbox for maintenance.
    - Sarvesh Goel - Enterprise Messaging Administrator

  • AD Users Last Logon Time

    Hi Folks,
    I need to generate User's Last logon time from AD database. Could any one please assist me on this.
    Thanks in advance !
    -Chalapathi

    Hi,
    Get-ADUser -Identity USERNAME -Properties LastLogonDate |
    Select SamAccountName, LastLogonDate
    Link to syntax:
    http://ss64.com/ps/get-aduser.html
    EDIT: Just in case:
    http://blogs.technet.com/b/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • USR02-LTIME - Last logon Time

    Hi All
    we have to trace the last logon time of CRM webclient users but USR02-LTIME does not write the right time, in this sense:
    - you logon at 11:00 with user TEST
    - you see USR02-LTIME = 11:00
    - you use the webclient without logoff and you see in USR02-LTIME the time of the last click
    Can you help me ?
    Regrads,
    Davide Ivanov
    Pirelli Italy

    1 .You can do it from NWA.
    http://fqdn:port/nwa
    analysis-debug-logs and traces,Initial check sap logs or default logs with predefined view
    Later open column customization and check mark "user"
    and you can get all informartion about user.
    Hope it help.
    Amit

  • Folders last modified time stamp are not updated in Windows 7

    After changing any .cpp file in Visual Studio, the last modified time stamp for the file's folder
    IS NOT updated. What's happening ?
    However when I change a Word (.docx) file, the last modified time stamp for the file's folder
    IS updated ! How come ?

    Hi,
    If you thought this issue gets worse and if you have already set NtfsDisblesLastAccessUpdate to 0, then please revoke it to 1.
    From the above Blog we can see that in Windows 7, the "Last Modified" field on log files is not updated when a program attempts to open the file or the utility is stopped, this is a design change to NTFS , becase we cache the metadata for
    folder contents and do not refresh it until a handle is closed on an open file or an explicit call is made to retrieve the properties of an individual file.
    Per your current issue that even if you closed these Vistual Studio files, the timestamp still didn't update. Please try the following and check whether any of them work:
    - open the file in a second program
    - view the proprties of the file
    - "dir <filename>" at a command prompt 
    In addition, if you edit these Vistual Studio files with Notepad(Before doing that, please close all the programs include Vistual Studio) and try to reproduce the issue, does the issue still occur?
    Regards,
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • ITunes "Last Played" Time Stamp issues

    I have a late 2011 Mac Mini running OS X 10.8.2 & iTunes 11.0 (163).
    Ever since I did the last update to iTunes, the "Last Played" time stamp has not worked.
    In the past, whenever a track finished playing, iTunes would place the time & date in the "Last Played" column. This no longer works.
    I just came back from the local Apple Store, & one of the workers there suggested setting the iTunes Preferences supply the time stamp.
    When I got home, I went through the preferences, but could not find anything for the "Last Played" time stamp.
    Please help.

    Go into iTunes Preferences and turn off crossfade.  Don't ask why it works; do ask apple to fix this bug!

  • Windows 8 Last Access Time Stamps not working

     Hi I have been trying to fix a issue with last access time stamps not working when I open a file
    so will have time on created modified and accessed from when created but some are wrong like one file
    saying
    created ‎Sunday, ‎September ‎14, ‎2014, ‏‎5:19:32 AM
    modified  ‎Sunday, ‎September ‎14, ‎2014, ‏‎5:19:32 AM
    accessed Sunday, ‎September ‎14, ‎2014, ‏‎5:19:32 AM
    I'm not sure what can cause this please help thank you

    Hi whowhatwere,
    Are you only confused about the last access time not change when you open a file?
    If you want to know more details about modified and created time, we can refer to the following KB.
    http://support.microsoft.com/kb/299648/en-us
    About the accessed time, please refer to the following blog.
    How do I access a file without updating its last-access time?
    http://blogs.msdn.com/b/oldnewthing/archive/2011/10/10/10222560.aspx
    The blog mentioned that: In fact, the intuitive definition of access is more specific: It's "the last time I opened, modified, printed, or otherwise performed some sort of purposeful action on the file."
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • Portal users - last logon time details

    Hi , 
    We have an requirement to get the list of users who logged in with the Last Logon Information  .
    From Standard Portal activity report ...we can get only the First logon date of the users .
    Kindly let us know the other possibilities to get it .
    Thanks ,
    Keerthi

    Hi Keerthi,
    Apart from Coding there is one option available through Authentication logs,this is tested in NW7.3 iam not sure which version you are using if you are using 7.0 then please check if this is available in 7.0 or not.
    1) Go to NWA
    2) Go to troubleshooting and logs section
    3) Open log viewer and choose Authentication logs from the logs option
    4) Specify the time frame in filter and choose everywhere for the logs to be picked up in generated report ,this wil gather authentication data from all server nodes.
    5) these logs will show each and every login performed bu Useres and it also shows how many times user have logged in to a particular application,choose IRJ as the application.
    6) Export the content to excel file and apply filter ,choose aplication as IRJ and choose date and time and select a user it will show all login with the date and time.
    7) You can feed this data to a predefined excel format and pull out necessary info ,only you need to develop an excel template for your reporting purpose and manually logs requires to be pulled in from NWA to feed the excel .
    this is another way which does not involve any java coding and tested on NW7.3 versions of Portal.
    hope this helps.
    Thx,
    Siddharth

  • Script for replacing Image from a frame into InDesign document file

    Hi All,
    I am having an indesign document (indd) file with images and texts. I am using InDesign Server CS4 to run the scripts via SOAP.
    My requirement is to replace any of the images from the required frame/s of indesign document through scripting (I already have frame id of which image needs to be replaced). I have written written java-script file (as given below): but when I execute this java-script on InDesign Server via SOAP, I get follwoing error into InDesign Server:
    10/03/09 15:15:54 INFO  [javascript] Executing File: \\Server_IP_Address\JavaScript_File_Path\JavaScript_File.js
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/help.gif
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Water%20lilies.jpg
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Winter.jpg
    Following is the java-script that is being used for replacing image from indd's frame:
    var myDocument = app.open(File('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd'));
    var tmp_frmid="1339"; //frame id of which image needs to be replaced.
    for (var i=0;i<myDocument.pages.length;i++)
    var objPage=myDocument.pages.item(i);
    var objPageitems = objPage.pageItems;
    try
    var obj = objPageitems.itemByID(tmp_frmid);
    obj.images[0].remove;
    obj.appliedObjectStyle = null;
    var myImage=obj.place(File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg'));
    var old_height = myImage.geometricBounds[2] - myImage.geometricBounds[0];
    var new_height = obj.geometricBounds[2] - obj.geometricBounds[0];
    var old_width = myImage.geometricBounds[3] - myImage.geometricBounds[1];
    var new_width = obj.geometricBounds[1] + ((new_height / old_height) * old_width);
    myImage.geometricBounds = [obj.geometricBounds[0] + "mm", obj.geometricBounds[1] + "mm", obj.geometricBounds[2] + "mm", new_width + "mm"];
    var diff = obj.geometricBounds[1] - myImage.geometricBounds[1];
    myImage.move( undefined, [diff,0] );
    break;
    catch(e)
    myDocument.save('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd');
    var previewFile = File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg');
    app.jpegExportPreferences.jpegQuality["JPEGOptionsQuality.low"];
    app.documents.item(0).exportFile(ExportFormat.jpg, previewFile);
    myDocument.close();
    I have very urgent requirement; if anyone have any idea; please suggest me. \
    It would be highly appreciable.
    Kind Regards,
    Prashant.

    http://www.automatication.com/selection-to-pdf-script.html
    Harbs
    http://www.in-tools.com

  • Algorithm or pseudo code sought for getting the latest last modified time..

    Hi I need to write a program in java that lists the latest last modified time among the files in folders and its subfolder and also gets the size of the folder. In my case, average folder size is 9 GB. Could you please suggest any algorithm to achieve this?? I tried to implement it by gathering last modified times from folders and its subfolders recursively and storing the info in Vector and finally
    getting the max of the last modified times but it was horribly slow and memory hogging.

    Remove the part that stores the data in a Vector. You don't need to store any data to add up a series of numbers. And you don't need to store any data to find the largest of a series of numbers either. Just scan the directory recursively as you are already doing and keep track of the sum of the sizes and the max of the last-modified dates.

  • Script for downloading files from pdf placed on web, script for printing for exchange-

    Looking for java script command to set on button in pdf. We have mp3 and pdfs on our web site, example of URL: http://www.uzlicek.cz/download/Pohadky/O_holcicce_ktera_si_prala_byt_dospela.mp3
    By clicking on button/link in reader I would like to appear a dialog box with offer to Safe file as…
    Any suggestion? In case of using “link tool” the file starts downloading to cache and this is not the objective. In case of using “sound tool”, the file does not appear for saving.
    For exchange the script for Print the current page:
       var n = this.pageNum;
        var pp = this.getPrintParams();
        //pp.pageSubset = pp.subsets.all;
        //pp.printContent = pp.constants.printContent.doc;
        pp.firstPage = n;
        pp.lastPage = n;
        this.print(pp);
    Cheers Martin

    It can't be done using only a PDF file - any link to a URL will simply open your web browser, and whatever handler that browser uses when presented with MP3 files will be triggered (download, play, etc.) - nothing in the PDF can override that handler and force a "save" operation.
    Instead you'll need to configure your website to force downloads (using HTTP headers) and link to those URLs instead; which is a subject outside this forum.

Maybe you are looking for