While ($GoodEmail -eq $false)
{
# See if our proposed address is in use anywhere in Exchange
$EmailCheck = Get-Recipient $ProposedEmailAddress
If ($EmailCheck -eq $null)
{
# If we get nothing back from the Get-Recipient, set our good flag and ignore the
# the rest of the code in the loop
$GoodEmail = $true
continue
}
While ($GoodEmail -eq $false)
{
# See if our proposed address is in use anywhere in Exchange
$EmailCheck = Get-Recipient $ProposedEmailAddress
If ($EmailCheck -eq $null)
{
# If we get nothing back from the Get-Recipient, set our good flag and ignore the
# the rest of the code in the loop
$GoodEmail = $true
continue
}