Hello All,
I can see someone on the internet has written some code which following this
$Username = $Account.Username
Now I understand $username is a variable and it is a product of the variable $account however what does the .username mean ? what is the coder trying to achieve by adding a .extension (.username)
For example he includes it in his loop but this .username is new to me.
$Username = $Account.Username
If (Get-ADUser -Filter {Name -eq $Username})
{
$account | Select Username,SamAccountName | Out-File C:\temp\exist.txt -append
Write-Host “$Username already exists in Active Directory” -ForegroundColor RED
}
Else
{
Write-Host “I am sorry, $Username does not exist.”
}
}
Thanks