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…
vSphere ESXi 6.7 Unable to talk between subnets between hosts
Configuration was : ESXi 6.7 - vSphere handling all the port groups tagged with VLANs Firewall - CISCO ASA Problem : New ESXi 6.7 hosts. A virtual machine if…
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…
How To Access A SQL Server 2008 Databases WITHOUT SA (SysAdmin) Credentials
Challenge : How to make a backup of a SQL 2008 database without knowing any working credentials. Log on to the Windows 2008 R2 server running SQL Server 2008 as…
Remove Directory Batch Script
#Remove directory in a batch file # rmdir /S /Q "C:\test\"
Robocopy Mirror Files and Folders
Map network drives to the correct locations Run CMD as Administrator Mirror file & directories and output detail to text file robocopy E:\..... z:\.... /MIR /S >c:\temp\detail.txt
List all users in the domain and email addresses
import-module activedirectory #List all users in the domain # Display Name and Email Address get-aduser -Filter * -SearchBase "dc=Test,dc=com" -Properties Displayname,emailaddress | select displayname ,emailaddress | Export-Csv C:\temp\users_and_email.csv
Troubleshooting Windows Updates and WSUS
Troubleshooting Windows Updates #Windows 10 #Windows 2016 Windows Update Log PowerShell command to check the Windows Update log • Get-WindowsUpdateLog Check Registry Keys Run command prompt as adminitrator and…
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