Category: Scripting
PowerShell – Add DNS Suffix to Ethernet Connections
Notes Get-DnsClient Set-DnsClient Set-DnsClientGlobalSetting Get-DnsClientGlobalSetting Get-NetAdapter Clear Suffix List Set-DnsClientGlobalSetting -SuffixSearchList @(“”) Set Suffix Order Set-DnsClientGlobalSetting -SuffixSearchList @(“domain.com”, “child.domain.com”) or $DnsSuffixes = “domain.com”,”child.domain.com” Invoke-Wmimethod -Class win32_networkadapterconfiguration -Name setDNSSuffixSearchOrder -ArgumentList @($DnsSuffixes),$null Set Suffix for Single Network Connection Get-NetAdapter | where {$_.name -ne “Local Area Connection”}| foreach{ Write-Host $_.name Set-DnsClient $_.name -ConnectionSpecificSuffix Read More …
PowerShell – Enabling All Notifications (Azure and Desktops)
Notes gpupdate /force (user context) Settings > Notifications & actions > Get notifications from apps and other senders
PowerShell – Delete String Containing Brackets
String you want to delete: [SERVER:8888],Timeout=10
PowerShell – Dynamically Return Directory Name
This is how you would dynamically return a directory name based upon wildcard in string. The full app version is unknown, but you know it begins with a 9. The end goal is to edit a text file in the unknown path.
PowerShell – Create Restore Point
Commands Disable 24 Hour Default Setting reg add “HKLM\Software\Microsoft\Windows NT\CurrentVersion\SystemRestore” /v SystemRestorePointCreationFrequency /t REG_DWORD /d 0 /f /reg:64 Create Restore Point wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint “EddieRestorePoint”, 100, 7 PowerShell Create Restore Point
Active Directory – PowerShell – Return User, Username, Email Address
This is how you would return the SAM account name, username, and email address for a specific domain. Useful, especially if you need to return data from multiple domains (just change the DCSERVER and OU, accordingly). Notes Get-AdGroupMember Get-ADUser Export-CSV