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
# Note that standard binary computing floating point numbers cannot exactly represent simple decimal floating point numbers. | |
# This is the expected behavior for IEEE-754 compliant binary floating point processors | |
# https://en.wikipedia.org/wiki/IEEE_floating_point | |
# Case in point, 0.1 (1/10 = 10^-1) is between 1/8=2^-3 and 1/16=2^-4 | |
# Since binary fraction cannot exacly store 1/10, accuracy of associated arithmetic is adversely impacted | |
# https://docs.python.org/3.5/tutorial/floatingpoint.html | |
# See the following example using Python 3.x | |
def test_binary_fraction(): | |
mySum = 0 |
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
# comment allowed before script param() statement | |
param([Parameter(Mandatory=$true)] $a, $b) | |
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version Latest | |
"`$a = $a, `$b = $b" | |
$args | |
$MyInvocation | |
$PSBoundParameters |
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
# NOTE: param() MUST BE FIRST STATEMENT in script file!!! | |
param([Parameter(Mandatory=$true)] $csvPath) | |
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version Latest | |
Import-Module ActiveDirectory | |
# Get the CSV file path from an input parameter ($csvPath) | |
$people = Import-CSV $csvPath | |
# CONVERT EMPTY STRING FIELDS TO $null |
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
echo "Q" | openssl s_client -connect "your.fqdn.com:443" \ | |
| openssl x509 -noout -text |
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
import-module activedirectory | |
# Substitute correct values in place of * and com below. | |
cd "AD:\CN=Databases,CN=Exchange Administrative Group (*),CN=Administrative Groups,CN=*,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=*,DC=com" | |
get-item * -Properties msExchHomePublicMDB | ` | |
foreach { | |
# Show name of mailbox database | |
$_.Name; | |
if ($_.msExchHomePublicMDB -eq $null) { | |
"NULL PF DB" | |
} else { |
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
REM Change the filter and column list as needed to match your query needs. | |
set filter="Disposition = 20,NotAfter > 11/29/2017" | |
set columns="NotAfter,CommonName,DistinguishedName,DispositionMessage,Disposition,CertificateTemplate,NotBefore,SerialNumber" | |
certutil -view -restrict %filter% -out %columns% >certutil_view_issued_notexpired.txt | |
REM see https://blogs.technet.microsoft.com/pki/2008/10/03/disposition-values-for-certutil-view-restrict-and-some-creative-samples/ |
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
$ErrorActionPreference = "Stop" | |
# Put usernames one-per-line in a text (CSV) file with header first-line: Username | |
# Set this to the path of your input csv file. | |
$CSVFilePath = "TroubleUsers.csv" | |
# This script will Clear the adminCount property and Enable Inheritance on the object Access Control List (ACL) in AD | |
$users = import-csv $CSVFilePath | sort Username | |
$groups = @() | |
foreach ($user in $users) { |
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
# List Native Architecture Drivers Installed (64-bit if Windows is x64) | |
Get-Item 'HKLM:\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers' | |
# List 32-Bit Drivers Installed on 64-bit Windows (not applicable to 32-bit Windows) | |
Get-Item 'HKLM:\software\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers' | |
# Alternatively use Get-ItemProperty | |
# Windows 8, Server 2012 and newer have Get-OdbcDriver cmdlet available (easier to use) |
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
' Based on Stack Overflow Answer by @Fionnuala | |
' https://stackoverflow.com/questions/12606326/linked-table-ms-access-2010-change-connection-string | |
' NOTE: If a linked table is no longer valid, delete it and Restart Access or Compact the database | |
Function ChangeODBCDriver() | |
Dim tdf As TableDef | |
Dim oldDriver As String, newDriver As String | |
oldDriver = "SQL Server Native Client 10.0" | |
newDriver = "ODBC Driver 17 for SQL Server" | |
For Each tdf In CurrentDb.TableDefs | |
If tdf.Connect <> vbNullString Then |
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
# Show Special Folder Paths (Windows PowerShell) | |
function Show-SpecialPaths () { | |
foreach ($fName in [System.Enum]::GetNames([System.Environment+SpecialFolder])) { | |
New-Object PSObject -Prop ([ordered]@{ 'Name'=$fName; 'Value'=[System.Environment]::GetFolderPath($fName) }) | |
} | |
} | |
# Shows if desktop, documents, etc are redirected. | |
Show-SpecialPaths |
OlderNewer