This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Disclaimer: | |
This module is provided AS IS without warranty of any kind. This work is based off work by | |
other talented individuals, and should not be considered an original work. | |
Modified into module by Shannon Graybrook | |
Modified by Graeme Bray | |
Original Content by Steve Lee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filter for server core | |
$Query = 'SELECT * FROM Win32_OptionalFeature WHERE Caption = "Microsoft-Windows-Server-Gui-Shell-Package-DisplayName" AND InstallState = "2"' | |
Get-WmiObject -Query $Query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the same script as a one liner: | |
# shutdown -r -t ( [math]::Ceiling( ([datetime]"1PM").Subtract((Get-Date)).TotalSeconds ) | |
param( | |
[Parameter(Mandatory=$true)] | |
[datetime] | |
$When | |
) | |
$Now = Get-Date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET mytime=%time: =0% | |
SET dtstamp=%date:~-4%%date:~4,2%%date:~7,2%%mytime:~0,2%%time:~3,2%%time:~6,2% | |
notepad %TEMP%\cert_%dtstamp%.req | |
certreq -submit -attrib "CertificateTemplate:WebServer10Y" %TEMP%\cert_%dtstamp%.req %TEMP%\cert_%dtstamp%.cer | |
notepad %TEMP%\cert_%dtstamp%.cer | |
SET /P answer=Save the generated certificate? (y/N) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ie4uinit.exe -ClearIconCache | |
taskkill /IM explorer.exe /F | |
DEL "%localappdata%\IconCache.db" /A | |
explorer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] | |
param( | |
[string] | |
$NewProfileName = 'Outlook' | |
) | |
Add-Type -AssemblyName PresentationFramework -Verbose:$false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Signs a PS1 script with the local users code signing certificate. | |
.DESCRIPTION | |
Takes a PS1 file as an argument and signs with the local user's code signing certificate. | |
Optionally allows specification of a timestamp server. | |
.PARAMETER Path | |
A PS1 file to sign. Accepts pipeline input. | |
.PARAMETER TimestampServer | |
An optional parameter specifying a timestamp server. The default is 'http://timestamp.comodoca.com/authenticode'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#PSScriptInfo | |
.VERSION 2018.10.02.1248 | |
.GUID 75bfca34-ff9c-4cac-beab-51a685d42c44 | |
.AUTHOR Shannon Brooks | |
.COMPANYNAME Brooksworks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compile command: | |
# ps2exe.ps1 -inputFile .\Submit-OutlookMessageToHelpdesk.ps1 -outputFile .\Submit-OutlookMessageToHelpdesk.exe -runtime40 -x86 -noConsole -iconFile .\forward_email.ico | |
$ForwardTo = "Help Desk <helpdesk@domain.com>" | |
$SmtpServer = "smtp.corp.domain.com" | |
$SmtpUseSSL = $true | |
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
Add-Type -AssemblyName System.Drawing | |
Add-Type -AssemblyName Microsoft.Office.Interop.Outlook |