Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Get domain\username from field "Assigned To"

$
0
0

Hi Folks

I can get "domain\username" from "Assigned To" field in SharePoint's List !? I have this code:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$web = Get-SPWeb -Identity http://site/somesite
$list = $web.Lists.TryGetList("Test")
$Count = 0

foreach ($Item in $list.Items){

$Count = $Count+1
$Item = $list.GetItemByID($Count)
Write-Host $Item["Assigned To"].tostring()

}

But this show "Name Lastname" per example "Jimmy Cespedes" and I need get LoginName "domain\username"

Thanks for your feedback


Jimcesse
Principal: http://sysadmin-cr.com/
Alterno: http://blogs.itpro.es/jimcesse



Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>