Happy Friday Everyone. I am horrible with remembering phone numbers so this is a good little one-liner to know.
Obviously, this relies on (1) OfficePhone being populated in AD (2) knowing the last name of the person you are trying to call. But it’s faster than several mouse clicks in Outlook Address Book, if you’re already in PowerShell, which I tend to be.
Get-ADUser -filter 'Surname -like "Lastname"' -Properties Officephone | Select Name, Officephone