Created
April 5, 2020 02:03
-
-
Save maravedi/e083d90a45da2b05d77964dfd8e6297a to your computer and use it in GitHub Desktop.
PowerShell function to get specific details for an AD user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Employee { | |
param( | |
[String]$Username, | |
[String]$ProxyAddressesFilter | |
) | |
If($Username) { | |
Get-ADUser -Identity $Username -Properties Department, Title, Manager, Office, LockedOut, officePhone, telephoneNumber | |
} Else { | |
Get-ADUser -Filter "proxyAddresses -like `"*$($ProxyAddressesFilter)*`"" -Properties Department, Title, Manager, Office, LockedOut, officePhone, telephoneNumber | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment