Get AD user Properties across the forest
#get all AD users in forest with name like v- and status is enable $allusers = (get-adforest).domains| %{get-aduser -filter {SamAccountName -like “v-*” -and Enabled -eq […]
#get all AD users in forest with name like v- and status is enable $allusers = (get-adforest).domains| %{get-aduser -filter {SamAccountName -like “v-*” -and Enabled -eq […]
#Domain names in forest $ForestInfo = Get-ADForest$Domains =$forestInfo.domains$FileName = “DNSForwarder”+”$(get-date -Format MM-dd-yyyy)”+”.csv”$FilePath = “c:\temp”foreach($domain in $domains){Write-Output “Working on $domain”get-dnsserverforwarder -computer $domain| select IPAddress, @{l=”Domain”;e={$domain}}| Export-Csv […]
#Input file is CSV file with headers IPaddress $Computers = import-csv “c:\temp\servers.csv” ForEach ($Computer in $Computers) {Write-Host “$($Computer.IPAddress): ” -ForegroundColor YellowInvoke-Command -ComputerName $Computer.IPAddress -ScriptBlock { […]
#Created domain user and add user account to domain group $domains = (get-adforest).domainsforeach($domain in $domains){$accountname = ‘s-user-‘+($domain -split “.”)[0]+’-DA’$accountpass = ‘P@ssword123456’ | ConvertTo-SecureString -Force -AsPlainTextWrite-Output […]
$Computers = GC “c:\temp\servers.txt” foreach($computer in $computers){Get-WMIObject Win32_NetworkAdapterConfiguration -Computername $Computer | Where-Object {$_.IPEnabled -match “True”} |Select-Object -property DNSHostName,@{N=”DNSServerSearchOrder”;E={“$($_.DNSServerSearchOrder)”}},@{N=’IPAddress’;E={$_.IPAddress}}|export-csv c:\temp\DNSlist.csv -NoTypeInformation -append#@{N=’DefaultIPGateway’;E={$_.DefaultIPGateway}}}
Connect to Vcenter Connect-VIServer vmwareenterprise.com -WarningAction 0 ####### Shutdown all VMs from the list “C:\temp\vm.txt“########### foreach($vmlist in (Get-Content -Path C:\TEMP\vm.txt)) { $vm = Get-VM -Name […]
dsquery user -startnode forestroot -samid <username> | dsmod user -pwd <new_password> DsQuery | HomeWorks’s Blog (wordpress.com)
Add multiple DNS servers as name servers to multiple DNS zones all in once. So this is essentially adding NS resource records to a zone, […]
Get Password Policy for all domains in a forest.. (Get-ADForest).domains | %{Get-ADDefaultDomainPasswordPolicy -Identity $_ } | Select-Object * | Export-Csv -Path C:\Reports\DefaultPasswordPolicy-All.csv -NoTypeInformation Having […]
How do I manually connect my Windows or Windows Server device to the KMS activation server? Right Click on the Start menu and select Command Prompt (Admin) Run […]
Copyright © 2025 | WordPress Theme by MH Themes