I have a bash script with following:
USERLIST="/tmp/adusers.list.names.only.txt"
cat $USERLIST | while read users
do
num=$[$num+1]
USR=`echo $users | awk '{print $1}'`
STATUS=`winexe -U DC/ID%"PASS" //10.0.0.1 'powershell.exe -command "import-module activedirectory; Get-ADUser $USR -Properties * | select Enabled"'`
echo "$USR : $STATUS"
done
But command not getting user name, instead its showing $USR
variable.
winexe -U DC/ID%"PASS" //10.0.0.1 'powershell.exe -command "import-module activedirectory; Get-ADUser $USR -Properties * | select Enabled"'
I tried to double quote like "$VAR"
but no use.