none
HOw to update excel sheet using powershell RRS feed

  • Question

  • Hi,

    We have a small lab of 100 machines. I want to collect a the user name, logon time and logout time on a excel sheet which is PRESENT ON SERVER location (\\server\D$\list.xlsx). I have a script to collect the current user details and log duration time. I have scheduled this script to run when ever user logon to machine using GPO. BUT I AM UNABLE TO USE A CMDLETS WHICH UPDATE THESE DETAILS ON THE EXCEL SHEET, PRESENT ON SERVER LOCATION, IN 3 DIFERENT COLUMNS.

    Ex => sheet format

    User Name            Machine name                        Login Time                                               Logout Time

    Joe                               M-1                                 5:00 am                                                      6:00 am

    mark                            M-2                                 9:00 pm                                                     10:00 pm

    Joe                               M-3                                 4:00 pm                                                       5:00 pm

    Can a single sheet be updated from 100 machines even ever a user log's on to machine? Could you please suggest simple cmdlets to update that sheet.

    Thanks for your help

    • Moved by Bill_Stewart Sunday, June 29, 2014 6:42 PM Unanswerable drive-by question
    Saturday, January 25, 2014 5:56 PM

All replies

  • You are asking for a very complex collaboration.  I recommend that you use a database instead.  Databases are like spreadsheets and can be easily updated from 100+ locations concurrently.

    It may even be better to look in the repository for scripts that do what you are trying to do and store the info into other locationslike the eventlog.

    I use MSMQ to send records of logins from machines to a central queue which updates a database.  It could be used to update a shared spreadsheet but requires that you have the technical expertise to set up and configure MSMQ (Canbe done with Group Policy).


    ¯\_(ツ)_/¯

    Saturday, January 25, 2014 6:23 PM