PowerShell script to query active directory : Identify Accounts with Password expiring is disabled Identify Accounts have not logged on for 30 or 90 days and accounts have never logged…
Azure – Update Management
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…
List Computers in Specific OU which are Enabled and Output to CSV
# Out puts computer accounts including status Enabled True or False # Targets a specific OU # Lists computer names # OU Variable to set $OU_HotWiredUK_location = "OU=Computers,OU=HotWiredHQ,OU=UK,DC=test,DC=com" # Out…
List Members of a specific AD group
#List Members of a specific AD group – output Username and User Full Name Get-ADGroupMember -Identity "AD GROUP NAME" | Select samAccountName, Name
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…
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