Just Another Technology Blog

Category Uncategorized

Batch script to reset users home directory permissions

123@echo off for /d %%d in (*.*) do icacls %%d /setowner Domain\%%d /t for /d %%d in (*.*) do icacls %%d /reset /t

PowerShell Script to find LastLogonDate and PasswordLastSet information from Active Directory for list of computers in a text file

1234[Array]$OutList = foreach ($computer in Get-Content -Path C:\Temp\InputFile.txt) { Get-ADComputer -Identity $computer -Property LastLogonDate, PasswordLastSet -ErrorAction SilentlyContinue | select Name, LastLogonDate, PasswordLastSet } $OutList | Export-CSV C:\Temp\OutputFile.csv -NoTypeInformation

© 2024 Steven Hodson — Powered by WordPress

Theme by Anders NorenUp ↑