My PowerShell skills are not very strong so I am struggling with something that I suspect is fairly straight-forward. I have the following simple code:
$User = Read-Host "Enter the User ID"
Get-ADUser -Identity $User | Select ObjectGUID | Set-Clipboard
This almost does what I want. The below line is what I am getting for output (I have sanitized the GUID out of an abundance of caution, but the code does pull the actual GUID):
@{ObjectGUID=##a###a#-a#aa-##aa-#aaa-###aaa#a####}
What I would really like is to get rid of everything up to and including the "=" and the trailing "}" bracket, so that only the actual GUID is copied to the clipboard.
What am I missing?
Thanks in advance for any help that you can offer!
--Tom