🕵️♂️
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set suffixes | |
$suffixes = "suffix1.int,suffix2.int,suffix3.int" | |
$command = @" | |
cmd.exe /C "wmic nicconfig call SetDNSSuffixSearchOrder ($domain,$suffixes)" | |
"@ | |
Invoke-Expression -Command:$command -ErrorAction SilentlyContinue | |
#------------------------------------------------------------------------------ | |
#reverse suffixes change | |
#Append Primary and connection specific DNS suffixes | |
#Append parent suffixes of the primary DNS suffix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell -All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$paramHash = @{ | |
ServiceName = "BITS" | |
ComputerName = "Localhost" | |
Outvariable = "results" | |
} | |
Get-Service @paramHash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-VMSwitch -Name "TeamedvSwitch" -AllowManagementOS $true -NetAdapterName "Ethernet","Ethernet 3" -EnableEmbeddedTeaming $true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$compname = "20161" | |
$ip = "10.0.2.4" | |
#find a way to get the interfaceindex | |
$index = Get-NetAdapter | Select-Object -ExpandProperty ifIndex | |
#now set the ip of that index adapter | |
New-NetIPAddress -InterfaceIndex $index -IPAddress $ip -PrefixLength 16 -DefaultGateway 10.0.0.1 | |
#now set the DNS for that index adapter | |
Set-DnsClientServerAddress -InterfaceIndex $index -ServerAddresses 10.0.3.190 | |
$cred = Get-Credential -UserName domain\user -Message "Enter domain creds" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
add-type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { | |
public bool CheckValidationResult( | |
ServicePoint srvPoint, X509Certificate certificate, | |
WebRequest request, int certificateProblem) { | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Get-ItemProperty -Path 'C:\Windows\System32\wuaueng.dll').VersionInfo | ft -autosize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
disable/enable network binding | |
DisplayName ComponentID | |
----------- ----------- | |
File and Printer Sharing for Microsoft Networks ms_server | |
Client for Microsoft Networks ms_msclient | |
Internet Protocol Version 4 (TCP/IPv4) ms_tcpip | |
Microsoft Network Adapter Multiplexor Protocol ms_implat | |
Internet Protocol Version 6 (TCP/IPv6) ms_tcpip6 | |
Link-Layer Topology Discovery Responder ms_rspndr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$PASSWORD = 'password' | |
$user = "domain\user" | |
$secureString = ConvertTo-SecureString -AsPlainText -Force -String $PASSWORD | |
$credential = New-Object ` | |
-TypeName System.Management.Automation.PSCredential ` | |
-ArgumentList $user,$secureString |