BEST LOGON SCRIPT

Mustafa Ülker
Feb 19, 2020
"logon {0:yyyy-MM-dd HH:mm:ss} {1} {2} {3} {4}" -f (Get-Date), $env:username, $env:computername, ((Get-WmiObject win32_networkadapterconfiguration -ComputerName $env:COMPUTERNAME | Where{$_.IpEnabled -Match "True"} | Select-Object -Expand macaddress) -join ","), ((Test-Connection -ComputerName (hostname) -Count 1).IPV4Address.IPAddressToString) >> \\DC01\netlogon\logon.log

DC01 is my domain computer. Just change it for your project

Here is the sample output log

logon 2020–02–19 14:38:28 Administrator DC01 00:0C:29:X8:5X:YY 192.168.0.4

--

--