diskpart
list disk
select disk <the disk number>
clean
Check when Active Directory password expires
net user /domain <username> | findstr /i expires
Disable the Windows “Shake” feature
Shaking the mouse while dragging another window’s title bar minimizes all other Windows. The UI to disable this “feature” is no longer obvious and I was able to disable it by making the following registry change. Note: This worked even on a gpo machine since it only modified CURRENT_USER.
registry location
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
Add the following DWORD key with value 1
DisallowShaking
Show environmental PATH variable in Windows cmd / terminal
echo %PATH:;=&echo.%
Get Windows AD Groups for user (PowerShell)
([ADSISEARCHER]"samaccountname=$($env:USERNAME)").Findone().Properties.memberof -replace '^CN=([^,]+).+$','$1'
ref: Stack Overflow
Clear NuGet cache
#Clear local nuget cache
C:\tools\nuget.exe locals all -clear
Get user credentials securely in PowerShell
#Get user credentials securely
Try {
$credentials = Get-Credential "$env:username"
}
Catch {
$log += "`n- " + $_.Exception.Message
Output-Result
}
#Get current domain to use for authentication. ADSI = Active Directory
$currentDomain = "LDAP://" + ([ADSI]"").distinguishedName
#Authenticate
$activeDirectoryEntry = New-Object System.DirectoryServices.DirectoryEntry($currentDomain,$credentials.GetNetworkCredential().UserName,$credentials.GetNetworkCredential().Password)
if ($activeDirectoryEntry.name -eq $null)
{
$log += "`n- Failed to authenticate that username and password."
Output-Result
} else {
$log += "`n- Authentication was successful."
}
#Display Results
$log = "Results:"
function Output-Result {
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") > null
$oReturn=[System.Windows.Forms.Messagebox]::Show($log)
Break
}
Add dll to GAC
gacutil.exe -i -f C:\pathtodll\my.dll
Convert Python to Exe
#Install if needed
pip install pyinstaller
#Generate exe
C:/>pyinstaller -w -F myfile.py
Reset IIS
iisreset /noforce