#!/bin/sh alias un64='awk '\''BEGIN{FS=":: ";c="base64 -d"}{if(/\w+:: /) {print $2 |& c; close(c,"to"); c |& getline $2; close(c); printf("%s:: \"%s\"\n", $1, $2); next} print $0 }'\''' ldapsearch -x -Hldap://<DOMAINCONTROLLER> -b "ou=Workstations,ou=PCs,dc=<WINDOMAIN>,dc=<DOMAIN>,dc=<TLD>" -Dldapuser@<WINDOMAIN>.<DOMAIN>.<TLD> -w <PASSWORD>| grep -v Defaultcontainerforupgradedcomputeraccounts| un64| egrep 'description:|dNSHostName:'|sed 's/ \+//g'|sed -e '/^description/{h;d};/^dNSHostName/{H;s/^.*$//;x;s/\n/ /g}'| sed 's/description:/\t/g'| sed 's/dNSHostName:/\t/g'|sed 's/:\"\(.*\)\"/\1/' |sed 's/\t\(.*\)\t\(.*\)/\2/g' | sed 's/\t//g' | sed 's/ \+//g';
Retrieve computers via linux from active directory
Recent changes
BruderSpektrum • 3 months ago
BruderSpektrum • 3 months ago
BruderSpektrum • 3 months ago
BruderSpektrum • 3 months ago