Tag Info

New answers tagged

1

Here's a one liner: getent passwd | awk -F ':' {'print $1'} | xargs -I {} groups {} | sed 's/ : /:/g' | tr ' ' ',' This dumps straight to console like so: pulse:pulse shearn89:shearn89,apache,monit,wireshark UPDATE: To get this in 'pure' .csv format, you could use this: getent passwd | awk -F ':' {'print $1'} | xargs -I {} groups {} | sed 's/ : ...


2

This is quite easy. AD has a 'lastloggedontimestamp'. I use the Quest AD CmdLets still, but you could re-jig this to work with the standard ActiveDirectory module. Basically you get 'today' and then scan for anyone with the last logontimestemp that matches today. $today = (Get-Date).day get-qaduser | where { $_.lastlogontimestamp.day -eq $today } | ...



Top 50 recent answers are included