Backwards of most

I am a sysadmin. I am not scared of the command line but scripting to me is like reading japanese. I started out doing hardware, moved into support and system administration. I use PowerShell commands all the time. I can find enough in some scripts to modify them but unlike most people with CS degrees, […]

ls -Filter -Recurse not detecting all files

When I do a ls -Filter on the root directory to find python.exe, I only get 1 result. ls -Filter “python.exe” -Recurse -ErrorAction ignore Directory: C:Users[redacted]Downloadspython-3.7.1-embed-amd64 Mode LastWriteTime Length Name —- ————- —— —- -a—- [redacted] 99992 python.exe However, there exists a python.exe in another user’s folder: ls Users[redacted2]AppData -Filter “python.exe” -Recurse Directory: C:Users[redacted2]AppDataLocalProgramsPythonPython37 Mode […]

Erroneous Results from Get-ADUser

The below AD query gives me thousands of results, including four named: 7-Jan, 7-Mar, 1-Apr, 8-May Get-ADUser -Filter * -SearchBase “OU=Departments,DC=dom,DC=for” | Select-Object samaccountname | export-csv -Path c:usersmedesktopwtf.csv -NoTypeInformation However, when I use Powershell to ask AD to show me users with the samaccountname of any from the above list I get nothing: Get-ADUser -filter […]

Sort by LastBootUpTime

Hello All, I’m looking for a little help in sorting a list of servers by their last boot up time. For some reason I cannot get sort-object to work. Any help would be appreciated. $servers = get-content -Path c:servers.txt foreach ($server in $servers) { if (Test-Connection -ComputerName $server -Count 1 -ErrorAction SilentlyContinue) { Get-WmiObject -Computername […]