Day: January 6, 2020

PowerShell: Get Hyper-V Host Name from Inside Guest VM

$guestVMName="SOMENAME"function getHyperVHostname{ param([string]$guestVMName=$env:computername) $hive = [Microsoft.Win32.RegistryHive]::LocalMachine; $keyPath = 'SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters'; $value = 'HostName'; $reg =…

PowerShell: Search for Failed Logins on Primary Domain Controller

# Quick Script to search for failed logins$daysLimit=7$userName="Bruce"$todaysDate= Get-date$pdc = (Get-ADDomain).PDCEmulator #$allDCs = ((Get-ADForest).Domains |…

PowerShell: Check if a HostName is Resolvable on All Internal DNS Servers

# Check if servername is resolvable at all DCs$serverName="MIGRATED-SHERVER" function checkDns{ param( $serverName, $dnsServers=(Get-ADDomainController -Filter…