How to get the current context user name #578
Answered
by
ToddKlindt
SP-Support
asked this question in
Q&A
-
I run my PNP with my SharePoint Admin account as does the rest of my team. To make our scripts a bit more flexible can you explain how to get the current context user. If you use [Enivronment]::UserName it gives the computer user name not the user name the script is running as. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
ToddKlindt
Apr 12, 2021
Replies: 1 comment 5 replies
-
I use this to see who is connected to M365, |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
veronicageek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this to see who is connected to M365,
(Get-PnPConnection | select -ExpandProperty pscredential).username