This file contains hidden or 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
| @Echo off | |
| :: Pass the file to hash as the only arg | |
| Set "MD5=" | |
| For /f "skip=1 Delims=" %%# in ( | |
| 'certutil -hashfile "%~f1" MD5' | |
| ) Do If not defined MD5 Set MD5=%%# | |
| Set MD5=%MD5: =% | |
| Echo:%MD5% |
This file contains hidden or 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
| select schema_name(tab.schema_id) as schema_name, | |
| tab.name as table_name, | |
| col.column_id, | |
| col.name as column_name, | |
| t.name as data_type, | |
| col.max_length, | |
| col.precision | |
| from sys.tables as tab | |
| inner join sys.columns as col | |
| on tab.object_id = col.object_id |
This file contains hidden or 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
| ((netsh wlan show interfaces) -Match '^\s+Signal' -Replace '^\s+Signal\s+:\s+','') -Replace '%','' |
This file contains hidden or 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
| Function Invoke-SpeedTest { | |
| param ( | |
| $Server | |
| ) | |
| $topServerUrlSpilt = $Server -split 'upload' | |
| $url = $topServerUrlSpilt[0] + 'random2000x2000.jpg' | |
| $wc = New-Object system.net.WebClient | |
| $wc.QueryString = New-Object System.Collections.Specialized.NameValueCollection | |
| $downloadElaspedTime = (Measure-Command {$webpage1 = $wc.DownloadData($url)}).totalseconds |
This file contains hidden or 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
| # Sender and Recipient Info | |
| $MailFrom = "[email protected]" | |
| $MailTo = "[email protected]" | |
| # Sender Credentials | |
| $Username = "" | |
| $Password = "" | |
| # Server Info | |
| $SmtpServer = "" |
This file contains hidden or 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
| param( $Newest = 10 ) | |
| function Parse-EventLogEntry | |
| { | |
| param( | |
| [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)] | |
| [System.Diagnostics.EventLogEntry[]] | |
| $eventInfo | |
| ) |
This file contains hidden or 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
| esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep ESXi-6.7.0-20 | |
| vim-cmd /hostsvc/maintenance_mode_enter | |
| esxcli network firewall ruleset set -e true -r httpClient | |
| esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.7.0-20191204001-standard | |
| reboot | |
| vim-cmd /hostsvc/maintenance_mode_exit |
This file contains hidden or 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
| esxcli system snmp set --communities public | |
| esxcli system snmp set --enable true | |
| esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false | |
| esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address <IPAddress Of SNMP Manager> | |
| esxcli network firewall ruleset set --ruleset-id snmp --enabled true | |
| /etc/init.d/snmpd restart |
This file contains hidden or 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
| $svcName = "WiresharkPCAPTrace" | |
| $outFile = "C:\ProgramData\WiresharkPCAPTrace.pcapng" | |
| if (Get-Service -Name $svcName -ea SilentlyContinue) { | |
| Write-Host "The pcap service has already been added to this system. Proceeding with removal and recreation" | |
| $service = Get-WmiObject -Class Win32_Service -Filter "Name='$svcName'" | |
| $service.Delete() | Out-Null | |
| } | |
| $fspace = Get-WMIObject -Class Win32_LogicalDisk | Where {$_.DeviceID -like "C:"} | Select @{Name="FreeSpaceGB"; Expression={[math]::round($_.FreeSpace/1GB, 2)}} | |
| if ($fspace.FreeSpaceGB -lt "10.00") { |
This file contains hidden or 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
| # Install Powershell Modules | |
| Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | |
| Install-WindowsFeature RSAT-AD-PowerShell | |
| # Install RDS Server Features | |
| Add-WindowsFeature –Name RDS-Gateway –IncludeAllSubFeature | |
| Add-WindowsFeature –Name RDS-Connection-Broker –IncludeAllSubFeature | |
| Get-WindowsFeature | ? { $_.Name -match "RDS-Licensing|RDS-RD-Server" } | Install-WindowsFeature –IncludeAllSubFeature | |
| # Set Firewall and Service Settings for RD |