Author Archives: admin

Disable TLS 1.0, TLS 1.1 and weak ciphers with Powershell

Posted in Powershell, Windows | Comments Off on Disable TLS 1.0, TLS 1.1 and weak ciphers with Powershell

Split PFX into cert and key without password

Posted in Uncategorized | Comments Off on Split PFX into cert and key without password

Set Powershell to ignore certificate check

Posted in Uncategorized | Comments Off on Set Powershell to ignore certificate check

Powershell JEA Just Enough Administration Session client IP

To get the IP from inside a session you can use Get-WSManInstance. If you run the endpoint as a group managed service account it has to be administrator on the local machine. Otherwise you will get access denied. The variable … Continue reading

Posted in Powershell | Tagged , | Comments Off on Powershell JEA Just Enough Administration Session client IP

Powershell Force TLS 1.2

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Posted in Uncategorized | Comments Off on Powershell Force TLS 1.2

Smartcard – Force reading all certificates on smartcard

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SmartCardCredentialProvider] “ForceReadingAllCertificates”=dword:00000001 

Posted in PKI, Windows | Comments Off on Smartcard – Force reading all certificates on smartcard

Powershell Hash and Arrays

Two ways of making a table of hash tables and arrays. [codesyntax lang=”powershell”] #Alt1 $Array = New-Object System.Collections.ArrayList #Foreach () { $Hash = New-Object -TypeName PSObject -Property @{ Status = “Ok” DisplayName = “Test” } $Array.Add($Hash) | Out-Null Remove-Variable $Hash -ErrorAction … Continue reading

Posted in Powershell | Comments Off on Powershell Hash and Arrays

Search inside Powershell scripts

[codesyntax lang=”powershell”] Cls #Path $Files = Get-ChildItem “Path to your scripts i.e C:\Powershell” -File Foreach ($File in $Files) { $SearchString = “*Text*” #Enter search pattern here If (Select-String -Path $File -Pattern $SearchString) {Write-Host “Found $SearchString in $File $(($File.LastWriteTime).DateTime)”} } [/codesyntax]

Posted in Powershell | Comments Off on Search inside Powershell scripts

Generate a new pkcs12 ( p12 or pfx) from your public and private key

Start Openssl. Normally in “C:\Program Files (x86)\GnuWin32\bin” Execute openssl>pkcs12 –export –in MyCertificate.crt –inkey MyKey.key –out MyNewCert.pfx

Posted in OpenSSL | Tagged , | Comments Off on Generate a new pkcs12 ( p12 or pfx) from your public and private key

Write CSR with SAN-attributes

Openssl.cnf[ req] distinguished_name = req_distinguished_name req_extensions = v3_req [req_distinguished_name] countryName = Country Name (2 letter code) countryName_default = US stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = MyProvince localityName = Locality Name (eg, city) localityName_default = Mycity 0.organizationName … Continue reading

Posted in OpenSSL, PKI | Tagged , , | Comments Off on Write CSR with SAN-attributes