1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function comprobar($elemento) { foreach($verificar in (Get-ADUser -LDAPFilter "(samaccountname=$elemento)")) { ($verificar | Get-ADObject -Properties lastLogon).lastlogon } } foreach($elemento in Get-Content .\usuarios.txt) { $elemento comprobar($elemento) Start-Sleep -Seconds 5 } |