# Add SharePoint PowerShell Snapin
#Add-PSSnapin Microsoft.SharePoint.PowerShell
# File and Drectory Location
$date = get-date -Format yyyyMMdd
$dirLocation = "\\server\share\Taxonomy\Terms\"
New-Item ($dirLocation + $date) -type directory | Out-Null
# Connect to Central Admininistration Site
$taxonomySite = Get-SPSite
http://ussecavdspdwk27:2010/ # Connect to Term Store in the Managed Metadata Service Application
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$termStore = $taxonomySession.TermStores["Managed Metadata Service (Enterprise)"]
# Connect to the Profiles Term Group
$termStoreGroup = $termStore.Groups["EY Terms"]
# Export Terms as .csv for each Term Set
foreach ($termSet in $termStoreGroup.TermSets.GetEnumerator())
{
$termSet.Terms | select Name, Owner, CreatedDate, LastModifiedDate | Export-Csv
($dirLocation + $date + "\Terms-" + $termStore.Groups["Profiles"].Name + "-" + $termSet.Name + ".csv")
} # Connect to the System Term Group
$termStoreGroup = $termStore.Groups["System"]
# Export Terms as .csv for each Term Set
foreach ($termSet in $termStoreGroup.TermSets.GetEnumerator())
{
$termSet.Terms | select Name, Owner, CreatedDate, LastModifiedDate | Export-Csv
($dirLocation + $date + "\Terms-" + $termStore.Groups["System"].Name + "-" + $termSet.Name + ".csv")
}