How to maintain the patch status of your Windows and Linux machines "You can use Update Management in Azure Automation to manage operating system updates for your Windows and Linux…
Ping sweep script test
POWERSHELL import-CSV "" | foreach { $result = Test-Connection -ComputerName $_.Name -Count 1 -Quiet $_.name, $result -join ',' | out-file "c:\scripts\PingSweep\computer_results.txt" -Append } COMMAND /BATCH SCRIPT Create list of computers…
If Not Exists – Batch Script
Create a batch file to check a text file is in the location specified, else run a task. #This batch file checks to see if a text file is…
Files Older Than 3 Months Combined Total File Size
A requirement to identify the total file size of all files not used in the last 3 months. This was the solution #Run as administrator #You need to have permission…
Task : Output A List Of Home Drive Paths Configured In Active Directory
#DSQuery dsquery user -name "*" -limit 0 | dsget user -samid -hmdir -hmdrv -profile >c:\temp\usersV2.txt #PowerShell # More flexibility # Includes the state of the computer account (Enable or…
Get a list of active users which have logged on to the domain in the last 7 days
# Get a list of users which have logged on to the domain in the last 7 days $Date = (Get-Date).AddDays(-7) Get-ADUser -Filter {LastLogonDate -gt $Date} | Select distinguishedName
PowerShell Script to find all AD users who have the “cannot change password” box checked in a specific OU
# script to find all AD users who have the "cannot change password" box checked in a specific OU # Windows Server 2016 # Powershell Get-ADUser -Filter * -Properties CannotChangePassword…
WSUS and Windows 10 Clients – UsoClient.exe
So, you deploy a GPO to Window 10 clients, but your in a hurry to get the clients to check in... As a SysAdmin for many years I would log…
Sysinternals – Permissions, LoggedOn, Endpoints
How to Get the permission on folders: PowerShell: Get-ChildItem | Get-ACL Path | Owner | Access or more in depth use: GUI based : Run AccessEnum against the drive or…
Check / Set / Sync Time Source for Windows Servers
To set the time ( Tested against Windows 2016) Launch CMD as administrator exampled c:\time 09:00:00 AM - This will set the time to 9am Note a time source…