- Web pages replaced with ISP's pages / adverts.
- Failure to find/connect to expected resources.
- Monitoring/tests of services that are down shows them as being up / responding to HTTP or ICMP pings.
- Issues particularly common when using VPN.
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 ConvertTo-Icon { | |
| [CmdletBinding(DefaultParameterSetName = 'BySuffix')] | |
| Param ( | |
| # Specifies the source image filename | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
| [string]$Path | |
| , | |
| # the name of the .ico file | |
| [Parameter(Mandatory = $true, ParameterSetName = 'ByLiteralName')] |
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
| declare @sp_who2 table ( | |
| Spid int | |
| ,[Status] varchar(255) | |
| ,[Login] varchar(255) | |
| ,HostName varchar(255) | |
| ,BlkBy varchar(255) | |
| ,DBName varchar(255) | |
| ,Command varchar(255) | |
| ,CpuTime int | |
| ,DiskIo int |
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 New-TelnetClient { | |
| [CmdletBinding()] | |
| Param ( | |
| [Parameter()] | |
| [string]$ComputerName = '127.0.0.1' | |
| , | |
| [Parameter()] | |
| [int]$PortNo = 23 | |
| , |
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
| Add-Type -Path (Get-Command 'Microsoft.SqlServer.Management.UserSettings.dll').Source | |
| [bool]$loaded = $false | |
| Get-Item -Path 'C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.ConnectionInfo\*\Microsoft.SqlServer.ConnectionInfo.dll' | Select-Object -ExpandProperty FullName | Sort-Object -Descending | ForEach-Object {if (!$loaded ){try {Add-Type -Path $_;Write-Verbose "Successfully loaded $_";$loaded=$true}catch{Write-Warning "Failed to load $_"}}} | |
| [string]$settingsFilePath = (Resolve-Path (Join-Path -Path $env:APPDATA -ChildPath 'Microsoft/SQL Server Management Studio/*/SqlStudio.bin')).Path | Sort-Object -Descending | Select-Object -First 1 | |
| if ($settingsFilePath) { | |
| try { | |
| [System.IO.MemoryStream]$ms = [System.IO.File]::ReadAllBytes($settingsFilePath) | |
| [System.Runtime.Serialization.Formatters.Binary.BinaryFormatter]$formatter = New-Object -TypeName 'System.Runtime.Serialization.Formatters.Binary.BinaryFormatter' | |
| [Microsoft.SqlServer.Management.UserSettings.SqlStudio]$sqlStudio = $form |
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
| $source = '\\path\to\source' | |
| $destination = '\\path\to\dest' | |
| robocopy "$source" "$destination" /zb /e /xf * | |
| <# | |
| See https://ss64.com/nt/robocopy.html for notes | |
| /zb - If you get access denied on a folder, try using backup mode to access it (see http://www.rainingforks.com/blog/2015/suggested-robocopy-switches-explained.html for detail) | |
| /e - Copy subfolders (/s), including empty ones. | |
| /xf * - exclude files matching a filename pattern; in this case any filename, so only copy directories | |
| Note: dest will contain the child folders of source; not source itself. |
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
| #based on code from https://stackoverflow.com/questions/113542/how-can-i-uninstall-an-application-using-powershell | |
| function Uninstall-Application { | |
| [CmdletBinding(SupportsShouldProcess = $true)] | |
| Param ( | |
| [Parameter(Mandatory = $true)] |
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
| copy-item 'C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe' 'c:\windows\system32\' | |
| copy-item 'C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui' 'c:\windows\system32\en-US\' |
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
| #Simulation of https://youtu.be/6JwEYamjXpA?t=1870 | |
| function Get-CoinTossPossibleValues {@('H','T')} | |
| function Get-CoinToss { | |
| [CmdletBinding()] | |
| Param ( | |
| [Parameter()] | |
| [int]$NumberOfTosses = 1 | |
| , | |
| [Parameter()] | |
| [string[]]$PossibleValues = (Get-CoinTossPossibleValues) |
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
| [string[]]$Assemblies = @( | |
| 'C:\AOSService\webroot\bin\Microsoft.Dynamics.AX.Framework.EncryptionEngine.dll' | |
| ) | |
| [string]$CSSource = @" | |
| using System; | |
| using Microsoft.Dynamics.Ax.Xpp.Security; | |
| namespace n201903071243 //use an odd namespace so I don't have to reload powershell each time I want to tweak this code; just tweak the NS | |
| { | |
| public class Dfo365CertificateThumbprintProvider: Microsoft.Dynamics.Ax.Xpp.Security.ICertificateThumbprintProvider |