×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Retrieve computers via linux from active directory

    Revision as of 06:18, 15 April 2011 by imported>Hundfred (Created page with "<pre> #!/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} pr...")
    (diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    #!/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';
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.