TLDR<\/p>\n
Running the command Get-aduser -identity username | select givenname<\/p>\n
Results in the following output = @{givenname=givenname}<\/p>\n
Or in excel it will have a header with givenname and the users name underneath but I want powershell to only output the users givenname by itself so that I can utilize the text of the users first name without it being wrapped in @{givenname=}.<\/p>\n
The longer version of the problem is that I am integrating some basic commands with a windows forms interface.<\/p>\n
I have a text box for the user ID<\/p>\n
$objUIDBox = New-Object System.Windows.Forms.TextBox
\n$objUIDBox.Location = New-Object System.Drawing.Size(10,40)
\n$objUIDBox.Size = New-Object System.Drawing.Size(260,20)
\n$objUIDBox.TabIndex = 0
\n$objForm.Controls.Add($objUIDBox)<\/p>\n
Then I have a command attached to a button $objUIDBox.text=get-aduser user | select givenname, but the short of the issue is that the text provided by<\/p>\n
get-aduser user | select givenname ends up populating the text box with @{givenname=givenname}<\/p>","upvoteCount":4,"answerCount":5,"datePublished":"2019-03-08T13:43:34.000Z","author":{"@type":"Person","name":"williambricker","url":"https://community.spiceworks.com/u/williambricker"},"acceptedAnswer":{"@type":"Answer","text":"