I'll first explain what I'm trying to achieve.
For a project they want to monitor the pilot group of PCs. And they want the following information:
- Total unique users that logged on
- Total log on
- Time of each session per user
So I went ahead and created a logon- and logoff script. The output of these scripts is a txt file each month.
For example: File 01-2017.txt
contains:
25-01-2017,09:29,lky9,WS257737,Logon
25-01-2017,10:37,lky9,WS257737,Logoff
25-01-2017,10:01,1f57,WS157954,Logon
25-01-2017,10:29,7df6,WS248751,Logon
25-01-2017,10:34,7df6,WS248751,Logoff
25-01-2017,10:48,1f57,WS157954,Logoff
Now I have (unsuccesfully) tried getting all of this in an array, with Get-Content
. Because when I can achieve this, I can try further. PowerShell skills still very poor, but I can manage arrays okay. So the questions is;
Can anyone please explain to me how I get this in an array?