Skip to content

Instantly share code, notes, and snippets.

View MSAdministrator's full-sized avatar
💭
Building Thangs

Josh Rickard MSAdministrator

💭
Building Thangs
View GitHub Profile
<#
.Synopsis
This function will convert a Saba CSV for University Campus
.DESCRIPTION
This function will import a CSV, modify the values, and export it to a new CSV.
We rename the following headers:
Person EMPID to EMPID
Completed Courses (Transcript) Ended/Completed On Date to Completed On Date
Course Course ID to Course ID
.EXAMPLE
@MSAdministrator
MSAdministrator / Setup-NewComputer.ps1
Last active June 30, 2023 20:22
Setup-NewComputer.ps1
# Set your PowerShell execution policy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
function Invoke-ComputerSetup {
[CmdletBinding(DefaultParameterSetName='Parameter Set 1',
SupportsShouldProcess=$true,
PositionalBinding=$false,
<#
.Synopsis
A PowerShell function to expand IP Ranges with dashes
.DESCRIPTION
This function will take an array of IP address ranges and
split them out into single IP addresses
.EXAMPLE
Expand-IPRange -Range '192.0.0.1-192.0.0.100','192.0.0.150-192.0.10.1'
.EXAMPLE
Expand-IPRange -Range '192.0.0.1-192.0.0.100','192.0.0.140','172.0.0.1-172.0.1.240'
function Write-WindowsLogo
{
[CmdletBinding()]
[Alias()]
Param()
Write-Host -Object ("")
Write-Host -Object ("")
Write-Host -Object (" ,.=:^!^!t3Z3z., ") -ForegroundColor Red
Write-Host -Object (" :tt:::tt333EE3 ") -ForegroundColor Red
@MSAdministrator
MSAdministrator / Create-NewProfile.ps1
Last active February 21, 2024 21:09
PowerShell functions to create a new user profile
<#
.Synopsis
Rough PS functions to create new user profiles
.DESCRIPTION
Call the Create-NewProfile function directly to create a new profile
.EXAMPLE
Create-NewProfile -Username 'testUser1' -Password 'testUser1'
.NOTES
Created by: Josh Rickard (@MS_dministrator)
Date: 24MAR2017
@MSAdministrator
MSAdministrator / SNAPSHOT.BAT
Created February 23, 2017 01:19
SNAPSHOT.BAT
@ECHO OFF
REM **********************************************************************
REM Name: SNAPSHOT.BAT
REM Version: 3.3
REM Date: 2.Apr.2013
REM Author: Jason Fossen (http://www.sans.org/windows-security/)
REM Purpose: Dumps a vast amount of configuration data for the sake
REM of auditing and forensics analysis. Compare snapshot
REM files created at different times to extract differences.
REM Usage: Place the script into a directory where it is safe to
################################################################################
# Script: Generate-RandomUsersAndComputers.ps1
# Purpose: Creates random user and/or computer accounts in Active Directory
# with somewhat realistic properties in the top-level OU of your
# choice. If the OU does not exist, it will be created; the OU
# defaults to "NewEmployees" if another target OU is not given.
# Requires: PowerShell 2.0 or later, Server 2008-R2 or later domain controller,
# and you must run the script on the controller as a Domain Admin
# for the domain in the forest where you want the accounts created.
# Version: 1.0
@MSAdministrator
MSAdministrator / Write-LogEntry
Created October 4, 2016 14:36
Write-LogEntry
#requires -Version 1
Function Write-LogEntry
{
param (
[string]$type,
[string]$message,
[string]$Folder,
[string]$CustomMessage
)
@MSAdministrator
MSAdministrator / Startup.pss
Created October 4, 2016 14:36
Startup Function for PowerShell Studio
function Main {
<#
.SYNOPSIS
The Main function starts the project application.
.PARAMETER Commandline
$Commandline contains the complete argument string passed to the script packager executable.
.NOTES
Use this function to initialize your script and to call GUI forms.
#this is the actual call, but for this scripts focus it should be commented out
#$CalEvents = Invoke-RestMethod -Uri "https://outlook.office365.com/api/v1.0/users/me/calendarview?startDateTime=$(Get-Date)&endDateTime=$((Get-Date).AddDays(7))&`$top=10" -Credential $cred
#You an grab this from here: https://gist.github.com/MSAdministrator/bb18fa1d764aaaa64368edcdb36af35c
$CalEvents = Import-CliXML 'C:\users\$($env:username)\Desktop\CalEventsObject.xml'
$i = $(Get-Date)
foreach ($item in $CalEvents)