Skip to content

Instantly share code, notes, and snippets.

@Doug-Moody
Doug-Moody / FindADUserGroups.cmd
Created February 17, 2020 19:58
Batch file that creates powershell file to handle username lookup requests. Displays MemberOf AD Groups quickly
@echo off
Title FindGroups
REM #######################################
echo [CmdletBinding()]>%CD%\findgroups.ps1
echo Param(>>%CD%\findgroups.ps1
echo [Parameter(Mandatory=$True,Position=1)]>>%CD%\findgroups.ps1
echo [string]$user>>%CD%\findgroups.ps1
echo. >>%CD%\findgroups.ps1
echo )>>%CD%\findgroups.ps1
echo. >>%CD%\findgroups.ps1
@Doug-Moody
Doug-Moody / cpuMhz.ps1
Created February 5, 2020 19:10
Find the average CPU Mhz over a short period of time. Function
#Present the Mhz of a CPU over a short period of time. Quick dirty average of 5 seconds
function Get-WorkArea {
if (![System.IO.Directory]::Exists("C:\support\")) {
[system.io.directory]::CreateDirectory("c:\Support")
}
if ([System.IO.Directory]::Exists("C:\support\UpToStandard")) {
$FileTime = Get-Date -format 'MM.dd.yyyy'
$Script:Rando = Get-Random -Maximum 100
Rename-Item -Path "C:\support\UpToStandard" -NewName "C:\support\UpToStandard-$FileTime-$Rando"
@Doug-Moody
Doug-Moody / FindPerson-DSGet.cmd
Created January 31, 2020 16:36
A CMD Batch file to quickly locate anyone on the domain that has any matching letters in name
@echo off
:START
color 0
setlocal
cls
echo.
set user=
set /p user=Enter First or Last name, or part of a name:
cls