Skip to content

Instantly share code, notes, and snippets.

/* INSTRUCTIONS:
NOTE: This only works for positions in the active
montage specified in the scripts. If you navigate
to another symbol auto-liquidate will not occur. So
before moving to another symbol be sure to set a
manual stop!
1. Create Montage Button Hokey as defined below.
Best to create 3 or more - A, B, C with different risk
function Start-Workout {
param(
[string]$Path = 'E:\OneDrive - IT Aid\Documents\Health\LetsGo.mp3',
[int]$IntervalSec = 120,
[int]$WarmupSec = 60,
[int]$FfplayVolume = 100
)
if (-not (Test-Path $Path)) { throw "MP3 not found: $Path" }
@Zeckrin
Zeckrin / GetRegStatus.ps1
Created January 16, 2019 17:34
Get Registry Key Status
#---------------------------------------------------------
<# Get Co-Sign Registry Key Status
Created 01/14/19 By Mike L>#>
#---------------------------------------------------------
  
Remove-Item -Path C:\Scripts\CoSign\Registry_Fix_Status.csv -ErrorAction Ignore
Import-Csv .\Computers.csv | ForEach-Object {
 
$Computer = $_."Computer"
$OnlineStatus = Test-ComputerConnection $Computer | Select -ExpandProperty Online
<# Import users from Deltek Export into AD groups
Created 11/21/18 By Mike #>
#---------------------------------------------------------
# Remove Existing Group Members
$GroupName = "CustPMGroup-BayCity","CustPMGroup-Cleveland", `
"CustPMGroup-Cincinnati","CustPMGroup-Columbus", "CustPMGroup-Detroit", `
"CustPMGroup-GrandRapids","CustPMGroup-Indianapolis", `
"CustPMGroup-Kalamazoo","CustPMGroup-Lansing", `
@Zeckrin
Zeckrin / CompareFilesStrings.ps1
Created October 19, 2018 15:24
Compare two text files and find what strings are in both or just in one or the other
<# Compare two text files and find what strings
are in both or just in one or the other
Created 10/18/19 By: Mike #>
 
$File1 = Get-Content "clientinsccm.txt"
$File2 = Get-Content "clientinportal.txt"
 
$Lookup = @{
"=>" = "Present in File2"
"<=" = "Present in File1"
@Zeckrin
Zeckrin / AD_Group_Update.ps1
Last active October 15, 2018 20:31
Update AD Group Names & Email Addresses with ProxyAddress
## Import AD Group information from the .csv sheet:
Import-Module ActiveDirectory
Import-Csv ".\AD_Group_List.csv" | ForEach-Object {
## Define all variables from imported csv:
$OldGroupName = $_."OldGroupName"
$NewGroupName = $_."NewGroupName"
$DisplayName = $_."DisplayName"
$Mail = $_."Mail"
$OldProxy = get-adgroup $OldGroupName -pr proxyaddresses |
select -ExpandProperty proxyaddresses | ? {$_ -cmatch '^SMTP'}
@Zeckrin
Zeckrin / Backup_Scheduled_Tasks.ps1
Last active October 9, 2018 18:32
PowerShell script to backup all scheduled tasks from the task root folder on multiple servers.
$taskpath = "\"
$savefolder = "\\fileshare"
$TaskServers = Get-Content "C:\Scripts\TaskBackup\TaskServers.txt"
ForEach ($Computer in $TaskServers) {
Get-ScheduledTask -CimSession $Computer -TaskPath $taskpath |
Foreach-Object { $_ | Export-ScheduledTask |
Out-File (Join-Path $savefolder "$Computer-$($_.TaskName).xml") }
}
Get-Credential | Export-CliXml -Path C:\IT\MyCredential.xml
$UserCredential = Import-CliXml -Path C:\IT\MyCredential.xml
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Connect-MsolService -Credential $UserCredential
@Zeckrin
Zeckrin / Delete_AD_Users_From_OU.ps1
Created August 17, 2018 20:13
Delete all AD Users from a Particular OU
##Delete AD Users from "Deleted User" OU
$OU="OU=Deleted_User,OU=AAA_Deleted_Users,DC=aaa-inc,DC=net"
$UsersToDelete = Get-ADUser -SearchBase $OU -Filter *
ForEach($user in $UsersToDelete) {
Remove-ADUser -Identity $user -Confirm:$false -WhatIf}
@Zeckrin
Zeckrin / ExportADUsers.ps1
Created August 10, 2018 19:13
Export AD Users with Phone & Email File
##Get Users and Attributes
$file = "C:\Scripts\AD_User_Info\AD_Users.csv"
Get-AdUser -Filter * `
-Properties GivenName, SurName, EmailAddress, MobilePhone, DistinguishedName | Where MobilePhone |
select GivenName, SurName, EmailAddress, MobilePhone, DistinguishedName | Sort-Object GivenName |
export-csv C:\Scripts\AD_User_Info\AD_Users.csv -NoTypeInformation
Send-MailMessage `
-to "mike@sss","tom@sss" `
-Subject "AD User List" `
-body "Attached is a CSV of current AD Users with Mobile #'s & their information." `