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
function Copy-File { | |
param( | |
#Path to the source file | |
[Parameter( | |
Mandatory = $True, | |
Position = 0 | |
)] | |
[String]$SourceFilePath, |
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
param ( | |
[string]$TextQualifier = $null | |
#[string]$TextQualifier = 'None' | |
#[string]$TextQualifier = (0xFE -as [char]) #TEMPORARY HARD-CODED BS. REMOVE LATER | |
) | |
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null | |
Do { | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
#$OpenFileDialog.Filter = "DAT (*.dat)| *.dat" |
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
<# | |
First, use Outlook to create an email template. | |
Save it as a .msg file in the same folder as this script. | |
Include placeholder text to find and replace if you want to dynamically use code to update the email. | |
Then, this function will extract the Html and the attachments from the template .msg file | |
#> | |
param ( | |
# Placeholder text and replacement text to insert into the template. |
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
# Requires -Module virtualmachinemanager | |
using namespace Windows.Storage | |
using namespace Windows.Graphics.Imaging | |
using namespace System.Runtime.WindowsRuntime | |
param ( | |
[string]$VMMServer, | |
[string]$OutputDir = 'C:\ProgramData\Get-SCVMConsoleOCR' | |
) |
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
declare @COLLID AS nvarchar(8) = 'ABC12345' | |
declare @Today DateTime = GetDate() | |
declare @30DaysBeforeToday DateTime = DateAdd("d",-30,GetDate()) | |
declare @31DaysBeforeToday DateTime = DateAdd("d",-31,GetDate()) | |
declare @60DaysBeforeToday DateTime = DateAdd("d",-60,GetDate()) | |
declare @61DaysBeforeToday DateTime = DateAdd("d",-61,GetDate()) | |
declare @90DaysBeforeToday DateTime = DateAdd("d",-90,GetDate()) | |
declare @91DaysBeforeToday DateTime = DateAdd("d",-91,GetDate()) | |
declare @10YearsAgo DateTime = DateAdd("d",-3650,GetDate()) |
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 | |
Identify computer certificates on a Windows computer that will expire within the next 30 days. | |
.DESCRIPTION | |
Functions as a Custom EXE sensor for PRTG to monitor certificate expiration. | |
#> | |
param( | |
# Name of the computer to search for expiring certificates |
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
param ( | |
# Name of the group whose members to retrieve | |
[string]$GroupName | |
) | |
function Search-Directory { | |
# Uses the .NET System.DirectoryServices Namespace to perform an LDAP search | |
param ( |
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
On Error Resume Next | |
strOldHostname = InputBox ("Enter the hostname to be removed from DNS. Just the hostname, please; not the FQDN.","Enter the host name to be removed","") | |
'Track when the script began | |
StartTime = Now | |
'Begin the log file | |
Set objShell = CreateObject("WScript.Shell") | |
strLocalAppDataPath = objShell.ExpandEnvironmentStrings("%LocalAppData%") |
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
$AssemblyFullName = 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' | |
$Assembly = [System.Reflection.Assembly]::Load($AssemblyFullName) | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.AddExtension = $false | |
$OpenFileDialog.CheckFileExists = $false | |
$OpenFileDialog.DereferenceLinks = $true | |
$OpenFileDialog.Filter = "Folders|`n" | |
$OpenFileDialog.Multiselect = $false | |
$OpenFileDialog.Title = "Select folder" | |
$OpenFileDialogType = $OpenFileDialog.GetType() |
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
function Copy-File { | |
param( | |
#Path to the source file | |
[Parameter( | |
Mandatory = $True, | |
Position = 0 | |
)] | |
[String]$SourceFilePath, |
NewerOlder