Skip to content

Instantly share code, notes, and snippets.

View pcdoyle's full-sized avatar

Patrick Doyle pcdoyle

View GitHub Profile
@pcdoyle
pcdoyle / SetLoginShell.ps1
Created November 17, 2022 17:53
These are the commands to change the login shell for Windows.
# To set the login shell on a Windows Core server to powershell instead of cmd:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name Shell -Value powershell.exe
# To set the login shell on a Windows Core server back to cmd instead of PowerShell:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name Shell -Value powershell.exe
# To set a regular Windows computer back to the desktop if you accidently set it to log in with powershell or cmd:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name Shell -Value explorer.exe
@pcdoyle
pcdoyle / Get-AzureADUserByUPN.ps1
Created November 17, 2022 00:42
This command will get the Azure AD User by their UPN's domain.
Get-AzureADUser -All $true | `
where-object {($_.UserPrincipalName -like "*@example.com") -and ($_.AccountEnabled -eq $true)} | `
Select-Object -property UserPrincipalName,DisplayName,AccountEnabled | `
Export-Csv -Path .\ActiveERISUsers.csv
@pcdoyle
pcdoyle / openmsedgeprofilemacos.sh
Created November 1, 2022 19:37 — forked from ciphertxt/openmsedgeprofilemacos.sh
Opens a specific Microsoft Edge profile by name on macOS
# Navigate to the profiles directory
cd ~/Library/Application\ Support/Microsoft\ Edge
# List out the profile directories. Note that the directory name is what is used in the launch command, *not* necessarily the friendly name of the profile you see in Microsoft Edge.app
find ./ -type f -name Preferences
# Let's say "Profile 1" is one of our directories
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" --profile-directory="Profile 1"
@pcdoyle
pcdoyle / curl-smtp-tls-send.sh
Created October 25, 2022 18:50
Send Email with SMTP using TLS
curl --ssl smtps://smtp.example.com:465 --mail-from from@example.com \
--mail-rcpt to@example.com --upload-file email.txt \
--user 'username:password'

Keybase proof

I hereby claim:

  • I am pcdoyle on github.
  • I am pcdoyle (https://keybase.io/pcdoyle) on keybase.
  • I have a public key whose fingerprint is 68EE 659A 1BA0 01B9 89FB 0D1F 8606 0730 1E9C 19EC

To claim this, I am signing this object: