Challenger: GilGrenade
Santa's business card reveals usernames for his Twitter and Instagram social media sites.
<# | |
.SYNOPSIS | |
Creates an access control entry (ACE) and adds it to an access control list (ACL). | |
.DESCRIPTION | |
Creates an access control entry (ACE) and adds it to an access control list (ACL). | |
.PARAMETER Rights | |
A right or list of rights to be allowed or denied by the ACE. | |
$Public = @(Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue) | |
$Private = @(Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue) | |
foreach ($import in @($Public + $Private)) { | |
try { | |
. $import.fullname | |
} catch { | |
Write-Error -Message "Failed to import function $($import.fullname): $_" | |
} | |
} |
function Set-CustomUserMailboxPermission { | |
[cmdletbinding()] | |
param ( | |
[parameter(ValueFromPipeline,Mandatory)] | |
[string]$User, | |
[parameter(ValueFromPipeline,Mandatory)] | |
[string[]]$Mailbox, | |
[parameter(Mandatory)] |
@{ | |
Something = 'this' | |
SomethingElse = 'that' | |
} |
# Get some events
$Computer = 'dc01'
$User = 'rob'
$Events = Get-WinEvent -ComputerName $Computer -LogName Security -FilterXPath "*[System[(EventID='4776']][EventData[Data='$User']]"
$xml = [xml]$Events[0].ToXml()
The document looks like this.
[CmdletBinding()] | |
param( | |
[string[]]$ComputerName, | |
[string]$SamAccountName | |
) | |
PROCESS { | |
foreach ($computer in $ComputerName) { | |
$events = Get-WinEvent -ComputerName $computer -LogName Security -FilterXPath "*[System[(EventID='4771' or EventID='4776')]][EventData[Data='$SamAccountName']]" | |
foreach ($event in $events) { |
if ($ComputerName) { | |
$GetADRootDSESplat['Server'] = $ComputerName | |
$GetADObjectSplat['Server'] = $ComputerName | |
$SetADObjectSplat['Server'] = $ComputerName | |
} |
$Html = @" | |
<html> | |
<head> | |
<style> | |
body { | |
font-family: Calibri, sans-serif; | |
font-size: 11pt; | |
} | |
h2 { |