This file contains hidden or 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 New-DotGraph { | |
param( | |
[Parameter(Mandatory)] | |
[string]$Name, | |
[Parameter()] | |
[ValidateSet('Letter','Legal','11x17')] | |
$PageSize, |
This file contains hidden or 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 New-PSObjectFromArrays { | |
param( | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[array]$Values, | |
[Parameter()] | |
[ValidateNotNullOrEmpty()] | |
[string[]]$PropertyNames | |
) |
This file contains hidden or 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 Select-DsEntry | |
{ | |
param( | |
[Parameter(ParameterSetName='AutoQuery')] | |
[string]$Name = '*', | |
[Parameter(ParameterSetName='AutoQuery')] | |
[ValidateSet('User','Group','Computer','Organizational-Unit')] | |
[string]$ObjectCategory = '*', | |
This file contains hidden or 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 Get-GoogleShortURL { | |
param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[ValidateScript({ | |
[System.Uri]::TryCreate($_, [System.UriKind]::RelativeOrAbsolute , [ref]$_) | |
})] | |
[string]$longUrl | |
) | |
PROCESS | |
{ |
This file contains hidden or 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 Invoke-MailTo { | |
param( | |
[OutputType([bool])] | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string]$To, | |
[Parameter(Mandatory)] | |
[string]$Subject, | |
This file contains hidden or 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 Set-WindowState { | |
param( | |
[Parameter()] | |
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE', | |
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED', | |
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')] | |
[Alias('Style')] | |
[String] $State = 'SHOW', | |
[Parameter(ValueFromPipelineByPropertyname='True')] |
This file contains hidden or 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 -Version 3 | |
[CmdletBinding()] | |
param( | |
[Parameter()] | |
[string]$TokenFile = (Join-Path $env:LOCALAPPDATA 'PushoverModule_CachedToken.xml') | |
) | |
#region Functions | |
function ConvertTo-UnixDateTime { | |
param( |
This file contains hidden or 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
-- Change Kerberos Renew Launch Agent to use -R instead of -B | |
-- Fixes an issue of tickets not renewing. | |
do shell script "defaults write /System/Library/LaunchAgents/com.apple.Kerberos.renew ProgramArguments -array '/usr/bin/kinit' '-R'" with administrator privileges | |
do shell script "chown root:wheel /System/Library/LaunchAgents/com.apple.Kerberos.renew.plist" with administrator privileges | |
do shell script "chmod +r /System/Library/LaunchAgents/com.apple.Kerberos.renew.plist" with administrator privileges | |
This file contains hidden or 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
-- Security Control: Enable 'Use secure virtual memory' | |
do shell script "defaults write /Library/Preferences/com.apple.virtualMemory UseEncryptedSwap -bool yes" with administrator privileges | |
-- Security Control: Disable remote control infrared receiver | |
do shell script "defaults write /Library/Preferences/com.apple.driver.AppleIRController DeviceEnabled -bool no" with administrator privileges | |
-- Security Control: Disable automatic login | |
do shell script "defaults write /Library/Preferences/.GlobalPreferences com.apple.autologout.AutologoutDelay -int 0" with administrator privileges | |
-- Security Control: Set the login options to display name and password in the login window. |
This file contains hidden or 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
# ================================================================== | |
# | |
# This file should be imported with the following command: | |
# ldifde -i -u -f test3.ldf -s server:port -b username domain password -j . -c "cn=Configuration,dc=X" #configurationNamingContext | |
# LDIFDE.EXE from AD/AM V1.0 or above must be used. | |
# This LDIF file should be imported into AD or AD/AM. It may not work for other directories. | |
# | |
# ================================================================== | |
# ================================================================== |