WSUS Database maintenance

Install ‘SQL Server Management Studio Express’ Run ‘SQL Server Management Studio Express’ as Administrator. Server is \\.\pipe\MICROSOFT##WID\tsql\query Backup your SUSDB. Check this: Short: Create a project, Create custom indexes (ONLY BEFORE YOUR FIRST REINDEXING, once in a databases lifetime), reindex ( HINT: Never distribute drivers via WSUS. Exclude them in WSUS. I […]

WSUS CLEANUP via Powershell

$WSUS = Get-WsusServer -Name SERVERNAME -PortNumber 8530Invoke-WsusServerCleanup -UpdateServer $WSUS -CleanupObsoleteComputers -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -CleanupObsoleteUpdates -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -CleanupUnneededContentFiles -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -DeclineExpiredUpdates -VerboseInvoke-WsusServerCleanup -UpdateServer $WSUS -DeclineSupersededUpdates -Verbose

GPO | Create a scheduled task

Create the task on a computer. Set the executional principal to ‘NT AUTHORITY\SYSTEM’. Type the string directly or search for ‘SYSTEM’ in the computers local branch. Test it locally. Export the Task as xml. Copy the xml to an accessable network share. Create a powershell script to install the task out of this xml. Example […]

Linux | bash | script | i am running self test

Linux: # FLOCK STUFF PIDFILE=/var/run/$(basename $0) exec 100>$PIDFILE flock -n 100 || exit 1 echo $ > $PIDFILE # … your code … test -r $PIDFILE && rm -f $PIDFILE FreeBSD: Install flock Other BSD: THATSME=”$(ps wwaux | grep -w $ | grep -v grep | awk ‘{$1=$2=$3=$4=$5=$6=$7=$8=$9=$10=””;print $0}’ | sed ‘s|^\s*||’)” && ps wwaux […]

bsh // create syllabeled passwords

function createPassword () { CNTSYLL=$1 CNTNUM=$2 test “x$1” == “x” && return 1 test “x$2” == “x” && return 1 PASS=”” YYY=( a e i o u ei au ai eu iu ui oi) ZZZ=( b c d f g h j k l m n p q r s t v w x y […]

Bash // dialog scripting

Create some functions: function prepare_dialog () { # DIALOG STDOUT exec 3>&1 } function d_selectOneGender () { C_GEND_LIST=”$(getexistinggenders)” D_STRG=”” for C_GEND in $C_GEND_LIST; do D_STRG=”${D_STRG} $C_GEND Gender OFF $C_GEND” done dialog \ –backtitle “$VERSION” \ –clear \ –title “$1” \ –item-help \ –radiolist ‘Select one:’ \ $H $W $MH \ $D_STRG return $? } … […]

script/console ftp upload one liner

With curl: curl -o /dev/null -s –connect-timeout 5 -T $TMPDIR/z_id.$CH_ID -u LOGIN:PASS ftp://URL:PORT/FILE.txt With ncftpput /usr/bin/ncftpput -u LOGIN -p PASS -P PORT -t 30 -F -T ‘UPLOADPREFIX’ -S ‘UPLOADSUFFIX’ -z -V URL /dls “FILE” ATTENTION: Add -DD to delet the local file afterwards. ATTENTION2: Quote ‘$’ in password with ‘\\\’ like ‘mypasscontains\\\$’