Hyper-V Tips

 
Posted in Uncategorized | Leave a comment

WGET new Sysinternals Suite

 

setlocal
mkdir sysinternals
cd sysinternals

set UNZIP=7z x
set WGET=wget
set DELETE=del
set REMOVEDIR=rmdir /q/s
set TMPDIR=tmp
set BINDIR=.

mkdir %TMPDIR%
mkdir %BINDIR%

set ZIPNAME=Suite
%WGET% http://download.sysinternals.com/Files/SysinternalsSuite.zip -O %TMPDIR%\%ZIPNAME%.zip
%UNZIP% %TMPDIR%\%ZIPNAME%.zip -o%BINDIR%
%DELETE% %TMPDIR%\%ZIPNAME%.zip

%REMOVEDIR% %TMPDIR%

cd..

 
Posted in Uncategorized | Leave a comment

Scripting for user info

Some times out of the blue. Mostly in haste to see if an account has been changed or locked.

I usually use a couple of things.

$User = Read-Host 'User'
Get-ADUser -Identity $User -Properties * |ft Name,PasswordLastSet,PasswordNeverExpires,PasswordExpired,PasswordNotRequired

Easy 2 lines of code in Powershell.

@echo off
title User password state check tool - Max
color 0A
:start
Set /p name=Hello! Please input a username:
cls
echo This is what i managed to find...
net user %name% /domain | FIND /I "Full Name"
net user %name% /domain | FIND /I "Password last set"
net user %name% /domain | FIND /I "Password expires"
net user %name% /domain | FIND /I "Account expires"
echo - Press ENTER to try another username -
pause >nul
cls
goto start

15 Lines in VB script.
Credit

 

 
Posted in Powershell, Scripting, VbScript | Leave a comment