This is what I have so far:
$username = $env:USERNAME
$Filter = "(&(objectCategory=User)(SamAccountName=$UserName))"
$Searcher = New-Object System.DirectoryServices.DirectorySearcher
$Searcher.Filter = $Filter
$ADUserPath = $Searcher.Findone()
$ADUser = $ADUserPath.GetDirectoryEntry()
$ADDisplayName = $ADUser.displayName
$ADEmailAddress = $ADUser.mail
$ADTitle = $ADUser.title
$ADDescription = $ADUser.description
$ADTelePhoneNumber = $ADUser.TelephoneNumber
#$ADMobile = $ADUser.mobile
$ADStreetAddress = $ADUser.streetaddress
#$ADCity = $ADUser.l
$ADDepartment = $ADUser.department
The only one that works and returns a value is displayname. Can someone help me fix it