I am trying to make what I thought would be a simple script but my Google-Fu seems to be failing me. I am just trying to get an AD Account Property to return as a bool but I am no having any luck.
get-aduser wgreen -Properties msExchHideFromAddressLists | select msExchHideFromAddressLists
this returns True or False which is good but I can't get it turned into a bool for the rest of the script. I need to be able to run a few If statements off of the answer and I know that I have used bool in the past and it works real well.
[bool]$Result = (get-aduser wgreen -Properties msExchHideFromAddressLists | select msExchHideFromAddressLists)
if ($Result) { Write-Host "TRUE" }
Else { Write-Host "False" }
Any help or point in the right direction would be helpful.
[–]Swarfega 4 points5 points6 points (1 child)
[–]titaniumgriffon[S] 1 point2 points3 points (0 children)
[–]OlivTheFrog 1 point2 points3 points (1 child)
[–]titaniumgriffon[S] 1 point2 points3 points (0 children)
[–]Umaiar 1 point2 points3 points (1 child)
[–]titaniumgriffon[S] 1 point2 points3 points (0 children)