Created
December 7, 2022 01:14
-
-
Save SweetAsNZ/3809db9d0920ded76c0be24e2dd43a02 to your computer and use it in GitHub Desktop.
Get UPN User Principal Name/UserPrincipalName
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
# Requires no Active Directory Module or rights. | |
$UPN = (([ADSISEARCHER]"samaccountname=$($env:USERNAME)").Findone().Properties).userprincipalname ; $UPN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment