Skip to content

Instantly share code, notes, and snippets.

View jd-raymaker's full-sized avatar
623267754c69426f61534230614756795a53453d

JayDee Raymaker jd-raymaker

623267754c69426f61534230614756795a53453d
View GitHub Profile
@jd-raymaker
jd-raymaker / ranked-mirrorlist
Last active June 9, 2022 10:08
Personal Arch mirrorlist
##
## Arch Linux repository mirrorlist
##
Server = https://mirror.archlinux.no/$repo/os/$arch
Server = http://mirror.archlinux.no/$repo/os/$arch
Server = https://mirror.neuf.no/archlinux/$repo/os/$arch
Server = http://mirror.neuf.no/archlinux/$repo/os/$arch
Server = http://archlinux.uib.no/$repo/os/$arch
Server = http://mirror.terrahost.no/linux/archlinux/$repo/os/$arch
#!/bin/bash
git clone --bare https://github.com/jd-raymaker/dotfiles.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
@jd-raymaker
jd-raymaker / Get-AllGroupMembers.ps1
Last active December 15, 2019 11:13
Get all members from an AD group with name username and principal name
Get-ADGroupMember -Identity "AD Group Name" | ForEach-Object { Get-ADUser -Identity $_.SamAccountName | select name,SamAccountName,UserPrincipalName }
@jd-raymaker
jd-raymaker / Search-ADGroup.ps1
Last active June 5, 2019 19:47
AD wildcard supported search
#No need to replace any variables. Copy and paste, then enter the search string.
#Supports wildcards anywhere. Example: *somegroup*
$search = Read-Host "Search for AD Group"; Get-ADGroup -Filter {Name -like $search} | Select name
@jd-raymaker
jd-raymaker / Get-LastLogon.ps1
Created October 29, 2018 13:46
Gets last AD logon time from user
#No need to replace any variables. Just copy and paste this into your Powershell, then enter the username you wish to get the last logon time from
$username=Read-Host "Enter username"; $user=Get-ADUser -Identity $username | Get-ADObject -Properties LastLogon; [DateTime]::FromFileTime($user.LastLogon)