# Grab a Member Definition from Get-WinEvent

**URL:** <https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058>\
**Category:** PowerShell Help\
**Created:** [September 5, 2014, 1:57am UTC](https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058 "2014-09-05T01:57:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric-bronnert](https://avatars.discourse-cdn.com/v4/letter/e/6bbea6/32.png) [@eric-bronnert](https://forums.powershell.org/u/eric-bronnert)\
**Post date:** [September 5, 2014, 1:57am UTC](https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058/1 "2014-09-05T01:57:55Z")

</div>

Me again. Getting sick of me yet?

In a month of lunches I read about Member Definitions and I would like to use one. Specifically for the cmdlet Get-WinEvent. I want to pull the UserID Property from Get-WinEvent through it’s Member Definitions . Basically I’m pulling a log and Event ID’s from Get-WInEvent, and I want to add UserID’s to these logs. How would I do this?

UserId Property System.Security.Principal.SecurityIdentifier UserId {get;}

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [September 5, 2014, 2:08am UTC](https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058/2 "2014-09-05T02:08:16Z")

</div>

Um… having written the book, I’m not sure what you mean about “member definitions” and “pull the UserID property through it’s member definitions.”

A member definition describes what a member, such as a property or event, looks like. In this case, UserId is a property of the type System.Security.Principal.SecurityIdentifier, and it is read-only (“get”). You don’t “pull information through a member definition.”

Now… are you asking, “how do I get the user id into the command output?” It’s already there. It may not be showing by default, because many properties don’t show by default in PowerShell. So, you could use Select-Object to tell the shell what properties you want to see, and that could include UserId.

---

<div class="post-metadata">

**Author:** ![eric-bronnert](https://avatars.discourse-cdn.com/v4/letter/e/6bbea6/32.png) [@eric-bronnert](https://forums.powershell.org/u/eric-bronnert)\
**Post date:** [September 5, 2014, 2:35am UTC](https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058/3 "2014-09-05T02:35:24Z")

</div>

You nailed it. That is exactly what I was asking. Learning how to ask the right questions is a learning experience in itself. I will refer to the book and re-read chapter 8, but everything you just explained really set my mind straight on how these member definitions work… As always thank you for your time.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:47pm UTC](https://forums.powershell.org/t/grab-a-member-definition-from-get-winevent/3058/4 "2024-05-16T20:47:34Z")

</div>

Closed on May 16, 2024, 8:47pm UTC


