Powershell expert to modify logon/logoff script

I have a script written that shows the logon/logoff of users from a Virtual machine. I want to modify this script to show not just the logon/logoff times but also the duration. This will be achieved by subtracting the login time from the logoff time and displaying the time in hours.





Logon/logoff durations

Gets the logon/logoff times of any desired machine


Created: 2019-09-24

Author: Servo

This script is provided 'AS IS' with no warranties, confers no rights and is not supported by the author.


Initial Version



Param (

[string]$Computer = $env:computername,

[int]$Days = 7,

[string]$destinationpath = "\\tig\sor$\mdd\logOn_logOff",

[String]$Path = "c:\temp\"



$Result = @()

Write-Host "Gathering Event Logs, this can take a while..."

$ELogs = Get-EventLog System -Source Microsoft-Windows-WinLogon -After (Get-Date).AddDays(-$Days) -ComputerName $Computer

If ($ELogs)

{ Write-Host "Processing..."

ForEach ($Log in $ELogs)

{ If ($[login to view URL] -eq 7001)

{ $ET = "Logon"


ElseIf ($[login to view URL] -eq 7002)

{ $ET = "Logoff"



{ Continue


$Result += New-Object PSObject -Property @{

Time = $[login to view URL]

'Event Type' = $ET

User = (New-Object [login to view URL] $[login to view URL][1]).Translate([[login to view URL]])



$Result | Select Time,"Event Type",User | Sort Time -Descending | Export-CSV "$Path\report_$($env:computername)_$(Get-Date -Format yyyyMMdd-hhmmss).csv" -NoTypeInformation -Force

$filename = "report_$($env:computername)_$(Get-Date -Format yyyyMMdd-hhmmss).csv"

copy-Item -Path "c:\Temp\$filename" -Destination "$destinationpath\$filename" -Force

Write-Host "Done."



{ Write-Host "Problem with $Computer."


Skills: Shell Script, Powershell, Software Architecture, Windows Server, Script Install

See more: modify popup window script, add modify remove hphp script, modify sql table script, oscommerce logon logoff button, modify attributes user script excel, java script hours count counter, windows logon timer script, automatic logon websites script, css modify associate matic script, modify install website script, linux varlogmessages bash script hours, post logon vbs script sample, help modify xml file script, modify python feedback script, modify xml values script windows, modify xml file script, modify logon screen, modify file python script, agree terms logoff script, modify attribute user script

About the Employer:
( 2 reviews ) Hamburg, Germany

Project ID: #21571027

11 freelancers are bidding on average $28 for this job


I am good in powershell script along with automation, please let me know if you are good to award this project to me

$30 USD in 2 days
(20 Reviews)

Hi. Great app writer for your projects. I have writen .net, c#, powershell, scraping, excel, googlesheet, csv, database app, macro, vba for many years. I am ready to write your project. Thank you for visiting my profil More

$30 USD in 2 days
(5 Reviews)

I can modify your script to determine the duration of the login and add it to the *.CSV file that is already created. Please let me know if the sorting stays the same or sorting by the duration time would be preferred More

$25 USD in 2 days
(5 Reviews)

I have been working as System Engineer for 4 years. I have experience in scripting language like Python, shell script like Bash shell, Powershell... With your requirements I know I could solve it quickly and make it ru More

$25 USD in 1 day
(2 Reviews)

Hi Client , My name is Krish. I’m a Senior Software Developer & Freelance Web & Automation developer with 4+ years of experiences with Master degree holder and expertise in PYTHON, PHP, HTML 5, CSS3, JAVASCRIPT, More

$10 USD in 1 day
(1 Review)

Hi, Hope you are doing well. I have experience in writing PowerShell scripts. Looking forward to working with you. Regards

$50 USD in 1 day
(0 Reviews)

If you could share your script, I will do the modification that fits for requirement. Looking forward to work

$10 USD in 7 days
(0 Reviews)

I can write this program for you in c # a day But editing the previous code has more trouble Chat with me if you would like to rewrite the program

$55 USD in 1 day
(1 Review)

I am expertise in powershell. scripting. I have already created so many logon and logoff powershell scripts. Its nyc to working with you

$25 USD in 1 day
(0 Reviews)

If you have challenge, .. I have talent.. Test My Skills, and you will never regret ! This stuff is nothing more than the daily BAU which I deliver with Excellence,...... Everyday !!! #8+ Years Experience #Technical More

$28 USD in 1 day
(0 Reviews)
(0 Reviews)