SharePoint Dragons

Nikander & Margriet on SharePoint

Getting values of SharePoint Hyperlink and Person or Group columns

The next PS script shows how to do it:

$ProjectWeb = Get-SPWeb -Identity $ProjectWebName

foreach ($Item in $ProjectList.Items)
{
$SiteCollLink = New-Object Microsoft.Sharepoint.SPFieldUrlValue($Item[“SiteCollectionURL”])
$Url = $SiteCollLink.Url

$Owner = New-Object Microsoft.Sharepoint.SPFieldUserValue($ProjectWeb, $Item[“Owner”])
$OwnerName = $Owner.User.LoginName
$OwnerEmail = $Owner.User.Email
}

 

Please Note SiteCollectionURL is the name of a Hyperlink column, Owner is the name of a Person or Group column.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: