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
base: | |
'*': | |
- is_test_computer | |
dev: | |
'is_test_computer:True': | |
- match: pillar | |
- apps.dsconfigad | |
- apps.munki |
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 | |
Get Computers by Last Logged on User via SCCM. | |
.DESCRIPTION | |
Queries SCCM for the list of computer’s whose last logged on user matches the supplied SamAccountName. | |
.PARAMETER SamAccountName | |
For users, this is typically their EUID. Non-user accounts may vary. | |
.PARAMETER SiteName | |
SCCM Server Site Name. | |
.PARAMETER SCCMServer |
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
$forestName = ([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).Name | |
$ADsPath = [ADSI]"GC://$forestName" | |
$Search = New-Object System.DirectoryServices.DirectorySearcher($ADsPath) | |
$Search.Filter = "(&(objectCategory=User)(SamAccountName=user0123))" | |
$Search.FindAll() |
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
try { | |
foreach ($res in $Search.FindAll()) | |
{ | |
$User = $res.GetDirectoryEntry() | |
$NewObject = New-Object PSObject | |
Add-Member -InputObject $NewObject NoteProperty 'DistinguishedName' $User.DistinguishedName | |
Add-Member -InputObject $NewObject NoteProperty 'SamAccountName' $User.SamAccountName | |
$OutputList += $NewObject | |
} |
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
[string](0..9|%{[char][int](32+("54698284737179506589").substring(($_*2),2))})-replace "\s{1}\b" |
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
[System.Collections.ArrayList] $already_done = @() | |
Get-Content .\AppData\Local\CloudStation\log\daemon.log -Wait | ?{ $_ -match '\[ERROR\]' } | %{ | |
$_ -match '(\\Users\\[^\\]+\\CloudStation\\[^\]]+)' | Out-Null | |
if ($Matches[1] -and ($already_done -inotcontains $Matches[1])) { | |
Write-Host ($Matches[1] | Out-String) | |
Rename-Item (Resolve-Path $Matches[1]) "_$(Split-Path $Matches[1] -Leaf)" | |
while (-not (Test-Path $Matches[1])) { | |
Start-Sleep -Seconds 1 | |
} | |
Remove-Item "$(Split-Path $Matches[1] -Parent)\_$(Split-Path $Matches[1] -Leaf)" -Force |
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
C:\Temp>env\Scripts\python.exe manage.py shell | |
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from myapp.settings import EMAIL_KEY_EXPIRY_TIME | |
>>> from user.helpers import signing_dumps_w_entropy, signing_loads_w_entropy, get_uri | |
>>> import urllib.parse | |
>>> | |
>>> email = 'VertigoRay@example.com' | |
>>> key = signing_dumps_w_entropy(email) |
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 ( | |
[parameter( | |
Position = 0, | |
Mandatory = $true, | |
HelpMessage = 'This is the version number, such as "22.0". Valid version numbers can be found here: http://mzl.la/1c9hPmo' | |
)] | |
[string] $version, | |
[parameter( | |
Position = 1, | |
Mandatory = $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
function a { | |
param( | |
[string]$UninstallString = 'thing' | |
) | |
$MyInvocation | |
Write-Host -Fore Cyan "$($here.File) $($MyInvocation.MyCommand):$($MyInvocation.ScriptLineNumber)" | |
b | |
try { | |
Throw('Thing!!!!') |
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
Option Explicit | |
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
' FIRST THINGS FIRST: | |
' Change this DeploymentTypeName to match the Deployment Type Name used in the Application. | |
' - It's just used to for the log file name. | |
' - For Uninstall action, append ".x" to name, such as: Application - Install.x | |
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
Dim DeploymentTypeName | |
DeploymentTypeName = "CAS Remote - Install" | |
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |