# Define input and output file paths
$inputFile = "ip_addresses.txt"
$outputFile = "nslookup_results.csv"
# Read IP addresses from the input file
$ipAddresses = Get-Content $inputFile | Where-Object { $_.Trim() -ne "" }
# Create an array to store results
$results = @()
# Perform nslookup for each IP
foreach ($ip in $ipAddresses) {
try {
$nslookup = nslookup $ip 2>&1
$hostname = ($nslookup | Where-Object { $_ -match "Name:" }) -replace "Name:\s*", ""
if (-not $hostname) {
$hostname = "Lookup failed"
}
} catch {
$hostname = "Lookup failed"
}
$results += [PSCustomObject]@{
"IP Address" = $ip
"Hostname" = $hostname
}
}
# Export results to CSV
$results | Export-Csv -Path $outputFile -NoTypeInformation
Write-Host "Results saved to $outputFile"
IT Admin Assist
Cheat Sheet for Quick IT Administration
Bulk nslookup script
Bulk nslookup powershell script-
Get Information Barrier User Detail
Get-ExoInformationBarrierRelationship -RecipientId1 "user1@xyz.com" -RecipientId2 "user2@xyz.com"
Get Teams policy User List
Get-CsOnlineUser -Filter "TeamsMeetingPolicy -eq 'RestrictedAnonymousAccess'"
Force refresh Retention policy on mailbox
Start-ManagedFolderAssistant -Identity <MailboxOrMailUserIdParameter>
Check Volume License and Digital License
- Open Command Prompt as an administrator.
- Type
slmgr /dlv
and press Enter. - This command will display detailed license information. Look for the License Status and Description fields:
- If it mentions "Volume_MAK" or "Volume_KMS," it is activated using a Volume License.
- If it mentions "Retail" or "OEM," it is not using a Volume License.