Skip to content

Instantly share code, notes, and snippets.

View infamousjoeg's full-sized avatar
🙊
I'm really good at keeping secrets.

Joe Garcia infamousjoeg

🙊
I'm really good at keeping secrets.
View GitHub Profile
@infamousjoeg
infamousjoeg / PACLI-AddSvcAcctUsage.bat
Last active January 27, 2022 16:49
PACLI EXAMPLE - How to add Usage/Dependency to Vaulted Service Account using CyberArk PACLI
@ECHO OFF
:: Method 1: Run a command prompt from the directory PACLI.exe is located in and type each command out line-by-line
:: Method 2: Store into a .bat BATCH script and run that from the same directory as PACLI.exe
:: Starts PACLI.exe to start receiving commands
PACLI INIT
:: Set Vault connection parameters
PACLI DEFINEFROMFILE VAULT="CAMainVault" PARMFILE="Vault.ini"
@infamousjoeg
infamousjoeg / SteakSauce.md
Last active January 27, 2022 17:05
Steak Sauce Recipe

Ingredients

  • ½ cup water
  • ½ cup balsamic vinegar
  • ¼ cup Worcestershire sauce
  • ¼ cup ketchup
  • ¼ cup dijon mustard
  • ¼ cup seedless raisins/sultanas
  • ½ teaspoon salt
  • ¼ teaspoon black pepper
@infamousjoeg
infamousjoeg / XMLWatcher.ps1
Last active January 27, 2022 17:15
For directory monitoring and collection of XML files...
# VARIABLES
## XMLWatcher Variables
$XMLWatcher = New-Object System.IO.FileSystemWatcher
$XMLWatcher.Path = "C:\Program Files (x86)\CyberArk\PasswordManager\tmp"
$XMLWatcher.Filter = "*.xml"
# REGISTER PSJOB TO MONITOR FOR FILE SYSTEM CHANGES
Register-ObjectEvent $XMLWatcher -EventName Created -Action {
$datestamp = Get-Date -UFormat "%Y%m%d%H%M%S"
Write-Host "[${datestamp}] $($eventArgs.FullPath)"
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<settings>
<location>
<safename>P-SVR-WIN-DA</safename>
<foldername>Root</foldername>
<objectname>Operating System-WinDomain-joe-garcia.local-EPVTestUser</objectname>
</location>
<policy>
@infamousjoeg
infamousjoeg / aim_example.bat
Last active September 21, 2017 15:54
AIM Example
@echo off
REM Declare and set variables
set Admin_ID=Svc_CyberArkREST
set AIM_AppID=AIM-CP-Test
set AIM_Safe=T-APP-CYBR-RESTAPI
REM Make sure the Object Name is the "Name" value of the account stored in EPV
set AIM_Object=Operating System-WinDomain-joe-garcia.local-Svc_CyberArkREST
REM Set AIM CP CLI command to run
@infamousjoeg
infamousjoeg / aim_explanation.bat
Last active January 27, 2022 17:11
Explanation of using AIM via Batch
Your batch script is currently:
===========================
set scmd="C:\Program Files (x86)\CyberArk\ApplicationPasswordSdk\CLIPasswordSDK.exe" password /p AppDescs.AppID=APP_AIM-TEST /p query=Safe=LNC-CMOD_DF_T;Folder=Root;Object=ARSTLOD /o Password
for /f %%A in ('"%scmd%"') do @echo pass is: %%A
arsload -fnv -u ARSTLOD -p %scmd -h ondemand-test.lnc.lfg.com,1444 -g %1 -a %2 %3
====================================
It should be:
@infamousjoeg
infamousjoeg / KeepAlive.au3
Last active September 29, 2017 12:24
Keep Alive PC
Opt("GuiOnEventMode",1)
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1); no default tray menuitems
#NoTrayIcon
#include <GUIConstants.au3>
Global $infolabel
Global $sleepTime
Global $pause = 1
@infamousjoeg
infamousjoeg / CreateTestUsers.ps1
Created March 31, 2017 19:28
Create 1,000 Test Users for Home Lab
Import-Module ActiveDirectory
$total = 1000
for ($userIndex=0; $userIndex -lt $total; $userIndex++)
{
$userID = "{0:0000}" -f ($userIndex + 1)
$userName = "test.user$userID"
Write-Host "Creating user" ($userIndex + 1) "of" $total ":" $userName
@infamousjoeg
infamousjoeg / PACLIexec.ps1
Last active January 27, 2022 16:48
Safely Executes PACLI Commands from PowerShell using temporary bat files. Also throws on Error. Author: Ben Floyd
<#
Author: Ben Floyd
Date: 2017-05-08
Desc: Safely Executes PACLI Commands from PowerShell using temporary bat files. Also throws on Error.
TODO: Put into a module.
#>
param(
$baseDir = "C:\dev\somedirectory",
$pacliDir = "$baseDir\PACLI",
$vaultIni = "$baseDir\vault.ini",
@infamousjoeg
infamousjoeg / sqlplus.sh
Last active January 27, 2022 17:10
AIM Kornshell to SQLPlus Example
#/bin/ksh
# SET AIM VARIABLES #
appID = "<Application ID>"
safe = "<Safe Name>"
folder = "Root"
name = "<Name of Account in Vault>"
# BEGIN AIM CALL #
password = CLIPasswordSDK GetPassword -p AppDescs.AppID=$appID -p Query="Safe=$safe;Folder=$folder;Object=$name" -o Password