Powershell Script - Convert Managed Metadata column Value to string

HI,
I have written a small PowerShell Script to pull records from a SP List and put them in a csv file. Here is the script:
$MyWeb = Get-SPWeb "http://dev-apps:8800/applications/PA"
$MyList = $MyWeb.Lists["Alist"]
$exportlist = @()
$Mylist.Items | foreach {
$obj = New-Object PSObject -Property @{
“PName” = $_["Port Name"]
"AName" = $_["Agent Name"]
"Address 1" = $_["Address 1"]
"Address 2" = $_["Address 1"]
"Address 3" = $_["Address 3"]
"Address 4" = $_["Address 4"]
$exportlist += $obj
$exportlist | Export-Csv -path 'C:\Filename.csv'
The script is running all right, the output file is also created, data is also correct for all columns but 1. This PName is a
Managed metadata type column and the output values I am getting for this column are like this:
"ERICA|a6d1e8fd-1f6b-4e09-9830-d21e35950881"
"CLIVE|24dff17f-a1b5-4abe-ae86-57299e1e098b"
viz. the ["Actual Value"|"its GUID"] (seems so). I do not want this GUID to be included in the result csv. Is there a way to remove it.
P.S. Choice column values are being fetched just file.

Try this (you'll need to add in your other properties)
$items = New-Object psobject
$items | Add-Member -MemberType NoteProperty -Name "AName" -value "" ;
$items | Add-Member -MemberType NoteProperty -Name "PName" -value "" ;
$items | Add-Member -MemberType NoteProperty -Name "Address1" -value "" ;
$items | Add-Member -MemberType NoteProperty -Name "Address2" -value "" ;
$items | Add-Member -MemberType NoteProperty -Name "Address3" -value "";
$exportlist = @();
$Mylist.Items | foreach {
$pname = $_["PName"] -as [Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue];
$obj = $items | Select-Object *;
$obj.AName = $_["AName"];
$obj.PName = $pname.Label;
$obj.Address1 = $_["Address 1"];
$obj.Address2 = $_["Address 2"];
$obj.Address3 = $_["Address 3"];
$exportlist += $obj
$exportlist | Export-Csv -path 'C:\AData.csv'
Regards, Matthew
MCPD | MCITP
My Blog
View
Matthew Yarlett's profile
See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
Upload and Crop User Profile Photos

Similar Messages

  • Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

    Hi,
    I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM.
    I get "Object Object" rather than actual value.
    I tried:-
    var newsCat = item.get_item('NewsCategory');
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label();
    var newsCatId = newsCat.get_termGuid();
    But, I get the error "Object doesn't support property or method get_label()"
    I also tried :-
    var newsTags = item.get_item(' NewsCategory ');
    for (var i = 0; i < newsTags.get_count() ; i++) {
    var newsTag = newsTags.getItemAtIndex(i);
    var newsTagLabel = newsTag.get_label();
    var newsTagId = newsTag.get_termGuid();
    Even now I get the error "Object doesn't support property or method get_count()"
    I have included " NewsCategory " in the load request:- context.load(items, 'Include(File, NewsCategory)');
    Any idea what the issue is? Do I have to add any *.js file using $.getScript?
    I added following .js files
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    Thanks in Advance,

    Hi Patrick,
    I already added those references. I just pasted the parts of script snippet in my initial post. To avoid confusion I am pasting here complete script.
    2.1.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    function getdata() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle('Documents');
    var camlQuery = new SP.CamlQuery();
    var filterCategory = 'Solutions';
    var IDfromTaxonomyHiddenList = 15;
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef LookupId="TRUE" Name="'+filterCategory+'" /><Value Type="ID">' + IDfromTaxonomyHiddenList +'</Value></Eq></Where></Query></View>');
    /*the above CAML query successfully gets all the list items matching the criteria including "NewsCategory" managed metadata column values
    But when I try to display the value it retrieved it ouputs/emits Object Object rather than actual values */
    var items = list.getItems(camlQuery);
    context.load(items, 'Include(File,NewsCategory)');
    context.executeQueryAsync(
    Function.createDelegate(this, function (sender, args) {
    if (items.get_count() > 0) {
    var listItemEnumerator = items.getEnumerator();
    while (listItemEnumerator.moveNext()) {
    var oListItem = listItemEnumerator.get_current();
    var file = oListItem.get_file();
    var name = file.get_name();
    var newsCat = oListItem.get_item('NewsCategory'); alert(newsTags.constructor.getName());
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label(); // Here it errors out with message "Object doesn't support property or method get_label()"
    var newsCatId = newsCat.get_termGuid();
    } //end while
    }//end if
    Function.createDelegate(this, function (sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(getdata, "SP.Core.js");
    </script>
    In the above script "var name = file.get_name(); " gets the exact file name.
    But the line "var newsCat = item.get_item('NewsCategory');
           alert(newsCat) //Displays [Object Object]  rather than actual value.
    Issue resolved replace "oListItem.get_item('NewsCategory');" with oListItem.get_item('NewsCategory').get_label();"
    Thanks

  • Issue when filtering with Managed Metadata Columns in Share Point Document Library

    Hi All
    I have a document library, and a four Metadata Columns in it, with each column having a number of term in it. I have no issues in adding a document or in term sets. We have set property of Managed Metadata Column as Allow Multiple Values. So some of the items
    in library contains values with only one term set. While other documents contains values with multiple values.
    We have a number of country sites having the document library  with same metadata columns. In document library default view i am showing Metadata column, User want to filter the documents (view) based on Metadata column selected.
    The filtering is giving inconsistent behavior. In production server it is giving in error with some correlation ID. On our development machine some times it is working fine and some other times it is given error of Validation of Viewstate MAC failed. i tried
    on different countries sites.
    I checked we have already kept the Metadata Navigation and Filtering under site action feature as activated. It was even more weird when i deactivated the feature on one country site and the filtering was working fine. And on other country site where i
    kept the feature as activated and the filtering was giving an error.
    Thanks & Regards
    Amit

    Hi Amit,
    Have you checked the ULS error message for more information with correlation ID?
    Please try using the library metadata navigation to filter these managed metadata columns value via configuring library "Metadata navigation settings" after you enabled the "Metadata Navigation and Filtering" feature,
    then check if the issue would still persist.
    Please see more information from below article with similar issue.
    http://blog.tippoint.net/filter-by-managed-metadata-field-in-asset-picker-dialog/
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you havefeedback for TechNet Subscriber Support, contact [email protected] 
    Daniel Yang
    TechNet Community Support

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • Updating a managed metadata column from choice column value

    I am trying loop through
    all lists in a web, and for each list, 
    1. create a managed metadata column->Working
    2.
    Pull value from choice column->Working
    3. Move
    choice column value to managed metadata column->Not Working
    Point number 3 is not working. Please advise
    Here is the code:
    static void Main(string[] args)
    //Pulling the rootweb of the Site
    const string SPLocationListColumn = "CHECK6";
    SPSite site = new SPSite("http://sp2010:8080");
    SPWeb rootweb = site.RootWeb;
    //Setting up the taxonomy terstore, termset and term
    Microsoft.SharePoint.Taxonomy.TaxonomySession taxonomySession = new Microsoft.SharePoint.Taxonomy.TaxonomySession(site);
    TermStore termStore = taxonomySession.TermStores["Managed Metadata Service"];
    Console.WriteLine(termStore.Name);
    Group group = termStore.Groups["KM Metatags"];
    Console.WriteLine(group.Name);
    TermSet termSet = group.TermSets["Document Classification"];
    Guid termsetid = termSet.Id;
    Console.WriteLine(termSet.Name);
    Term term = termSet.Terms["Document subclassification"];
    TermCollection terms = termSet.Terms;
    Console.WriteLine(term.Name);//Looping through all webs of the input website
    SPWebCollection collWebsite = site.AllWebs;
    for (int i = 0; i < collWebsite.Count; i++)
    using (SPWeb oWebsite = collWebsite[i])
    //Looping through all lists in web
    SPListCollection collList = oWebsite.GetListsOfType(SPBaseType.DocumentLibrary); ;
    for (int j = 0; j < collList.Count; j++)
    SPList list = collList[j];//if the list name is Documents, create a new field of MMS type
    if (list.Title == "Documents")
    Console.WriteLine(list.Title);
    TaxonomyField field = list.Fields.CreateNewField("TaxonomyFieldType", SPLocationListColumn) as TaxonomyField;
    field.SspId = termSet.TermStore.Id;
    Console.WriteLine(termSet.TermStore.Id);
    field.TermSetId = termSet.Id;
    Console.WriteLine(termSet.Id);
    field.AnchorId = Guid.Empty;
    try
    {//Add the newly added MMS field to default view
    Console.WriteLine("Entering");
    Console.WriteLine("Entering");
    list.Fields.Add(field);
    Console.WriteLine("Entering");
    Console.WriteLine("Entering1");
    SPView view = list.DefaultView;
    Console.WriteLine("Entering2");
    list.Update();
    SPViewFieldCollection collViewFields = view.ViewFields;
    collViewFields.Add("CHECK6");
    Console.WriteLine("Entering3");
    view.Update();
    Console.WriteLine("Entering4");
    catch (Exception e1)
    Console.WriteLine(e1.Message);
    }//Capture a choice field by name subclass and move it to the newly added MMS field
    for (int f = 1; f < list.ItemCount; f++)
    if (list.Title == "Documents")
    Console.WriteLine(list.Title);
    SPListItem item = list.Items[f];
    if (item.Fields.ContainsField("subclass"))
    SPField field9 = item.Fields["subclass"];
    String subclassvalue = field9.GetFieldValueAsText(item["subclass"]);
    Console.WriteLine(subclassvalue);
    TaxonomyField taxonomyField = item.Fields["CHECK6"] as TaxonomyField;
    TaxonomyFieldValue taxonomyFieldValue = new TaxonomyFieldValue(taxonomyField);
    taxonomyFieldValue.TermGuid = term.Id.ToString();
    taxonomyFieldValue.Label = subclassvalue;
    taxonomyField.Update();
    item.Update();
    list.Update();

    From here:
    http://www.c-sharpcorner.com/uploadfile/anavijai/programmatically-set-value-to-the-taxonomy-field-in-sharepoint-2010/
    taxonomyFieldValue.TermGuid = term.Id.ToString();
    taxonomyFieldValue.Label = term.Name;
    SPListItem item = list.Items.Add();
    # item["Title"] ="Sample";
    item["TaxonomyField"] = taxonomyFieldValue;
    item.Update();
    list.Update();
    it appears you're missing the point where you assign that taxonomyFieldValue to the item's taxonomy field in question.

  • Not able to update multiple values in a managed metadata column.

    Hi ,
    I have an issue, where my user wants to add multiple values in managed metadata column. I tried to check out "allow multiple values option in list column settings, But it is throwing  an error "Cannot
    change this column to allow multiple values because it is currently being indexed."
    Could someone please help me , how to enable add multiple values option to the managed metadata list column.
    Thanks
    Badri

    HI Badri,
    Please manually remove the column from indexing.
    Refer the below article
    http://support.microsoft.com/kb/2015261/en-us

  • No values for refiners for managed properties based managed metadata columns in SharePoint 2013 on premise

    On a SharePoint Server 2013 setup (on premise) we want to use a number of managed metadata columns in the search as refiner. The managed metadata column is called "Document Language" and so it automatically creates a managed property called owstaxidDocumentx002Language
    which I can use to do a keyword query by typing owstaxiDocumentx0020Language:"NL" in the search box and it returns results. I also marked this managed property as refineable (in the service search application) and it appears in the
    seach refiners selection box but it states that there are no values for this refiner.
    So I decided to create a new managed search property "DocumentLanguage" and maps this to "ows_Document_x0020_Language" - I marked it as queryable, searchable, refineable, retrievable and sortable but this managed search property
    is not being filled up.
    I already executed a number of full crawls but this does not seem to work. Anyone know what to do next?
    Rgds,
    Joris [http://jopx.blogspot.com]

    It happened with me many times that the automatically generated managed property is not properly mapped to the crawled property and to get the correct crawled property  get the document item 
    $web=Get-SPWeb http://webUrl
    $list=$web.Lists["documentLibrary"]
    $list.Items[0].Xml>>item.xml
    View the item.xml and check if the ows_Document_x0020_Language contains data
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • Provision a document library definition with managed metadata column using Visual Studio 2010 designer

    hi all,
    how can i create a document library with a managed metadata column and lookup column .
     what  should be the  type for managed metadata column ? is it "Taxonomy", if yes how can i enter the term set values which should be populated by default.
    also would like to know how to refer the parent list / column[field] in the loopkup field
    help is appreciated!
    thnx

    Hi,
    To add a Managed Metadata field into the list definition, you can take a look at the link below with steps in details about the same requirement.
    http://gheckoplus.blogspot.com/2011/10/how-to-sharepoint-2010-list-definition.html
    For the Lookup field:
    http://abdulazizfarooqi.wordpress.com/2012/08/17/provisioning-lookup-field-in-sharepoint-2010-lookup-field-in-the-list-in-sharepoint-2010/
    http://ronsp.wordpress.com/2011/04/27/declaratively-adding-a-lookup-field-to-a-list-schema-using-customschema-attribute-in-listinstance/
    What’s more, if you have several questions to ask, I suggest you post them into every single thread to make them easier to be discussed in the forum.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Set Empty Managed Metadata Column - Working in 2010 and not in 2013

    I have seen posts similar to mine below but am still not finding a solution. I understand that setting an already populated managed metadata column can be problematic using SPD. However, my column is empty, and what works in 2010 is not working in 2013.
    Issue: In SharePoint 2010 On-premises, I am able to set an empty Managed Metadata column on a file in a document library via SPD workflow using the following format:
    ID;#Term|IdForTerm
    In SharePoint 2013 Online, I am attempting to create a SPD workflow to do the exact same thing (ID;#Term|IdForTerm) and am experiencing the following results depending upon the type of workflow I try:
    - SP 2010 Workflow - The workflow status result is Completed, but the managed metadata column remains empty.
    - SP 2013 Workflow - The workflow internal status becomes Started and effectively remains this way until I end the workflow.
    Any thoughts on what needs to change for 2013 when doing this? 
    Thanks in advance for any help or guidance.
    Alan

    Hi,
    I try to reproduce the issue in my SharePoint Online environment, however, everything works well.
    I create term set as below:
    Then start the workflow and the value in the browser view. The result is as below:
    I recommend to create another managed metadata column to check whether it works.
    Or you can create another library to check whether it works.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Caml query using managed metadata column

    hi,
     I am having a console appln, where i want  to pass the one paramater in the form of siteCol1:subsite1:subsite2  where  siteCol1:subsite1:subsite2 is the path of subsite which is in MMS.
    Can i pass this string paramter to the splist which contains a taxonomy column   and match this paramter in the listitemcollection and fetch only those recordw which matches this crirteria.
    and it should fetch the values which matches in a splist. the caml query it expects contains the taxonomy -managed metadata column - , but i am stuck with
    SPList splistLIST = parenttWeb.Lists.TryGetList("LIST1");
                          if ((splistLIST.Items.Count > 0 && splistLIST!= null))
                              SPQuery   objnodeQuery = new SPQuery();
                              objnodeQuery.Query =
                                  string.Format(
           "<OrderBy>" +
              "<FieldRef Name='ID' />" +
           "</OrderBy>" +
           "<Where>" +
              "<Eq>" +
                 "<FieldRef Name='myTaxonomy' />" +
                 "<Value Type='Text'>{0}</Value>" +
              "</Eq>" +
           "</Where>", _mcurrentPathTermSet);
                              SPListItemCollection nodeItemCollection = splistLIST1.GetItems(objnodeQuery);
    am not able to retrieve the listitems which passes this as a parameter and retrieve those records where it matches this taxonomy column.
    my doubt is, how to pass a string parameter to the splist contains taxonomy column and fetch those records

    Hi,
    Managed metada column does not supported in lookup column as the thread below:
    https://social.technet.microsoft.com/Forums/en-US/0dee5ba4-9648-445f-a774-8c59cf01b81c/confirmation-needed-cant-lookup-managed-metadata-field-with-lookup-column?forum=sharepointgeneralprevious
    If you prefer managed metadata in Search, then I'd suggest you find workaround to use managed metadata column in lookup column. You could use a workflow to copy the managed metadata column to a text field, make the text field to be hidded from the list if
    necessary. Then lookup this text field in other list.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Refiners for managed metadata column

    Hi,
    I have followed the procedure outlined here  to set the search schema for metadata column that I want to show as the refiners: 
    http://blogs.technet.com/b/sharepoint_made_easy/archive/2013/03/19/step-by-step-configuration-to-add-custom-refiners-in-the-refinement-panel-of-search-results-page-for-sharepoint-online.aspx
    My managed property is showing in the available "refiners", however, there are no values returned from it. Please note that I am mapping "RefinableString00" to a managed metadata column crawled property. What am I doing wrong?

    Resolved it. i just have to initiate a crawl.

  • How to create a managed metadata column that allows terms from several term sets or groups ?

    My requirement is to create a a Managed Metadata column that allows terms that come from several term sets (or possibly from one group containing several term sets).
    Would it be possible ?
    Thanks.

    Hi,
    I don't know if this is possible, however the design of your managed metadata term sets should be that you don't have a type of value coming from two different sets. For example, departments in your organization, offices of your company. Let me know if you
    get a solution. It would be helpful to others.

  • Managed metadata columns in document information panel with multiple content types

    Hi everyone,
    The problem I have is that for custom content types not all managed metadata columns are displayed in Document Information Panel (DIP) for the document in the Office client application. 
    However, everything works fine with 1 specific content type. Even though the others using exactly the same site columns. The content types are deployed using visual studio to the content type hub, and after this the content types are correctly published to
    the site collections, there are no publish issues here. 
    When I create a document based on the second content type in the same library, all fields are showed in the document information panel, except the managed metadata columns.
    Detailed explanation:
    Library: procedures
    Content types:
    - simple procedure (with 4 managed metadata fields and some other text fields)
    - procedure with approval (with the same 4 managed metadata fields and some other text fields)
    Scenario 1: I add the 'simple procedure' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 2: I add the 'procedure with approval' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 3: I add the 'simple procedure' and 'procedure with approval' content types to the document library procedures (added simple procedure first). When I create a new document based on the 'simple procedure'
    content type, everything works fine and he shows all metadata fields. When I add a new document based on the 'procedure with approval' content type, the document information panel shows correctly, except all managed metadata fields. These are not visible at
    all. Though they worked perfectly in scenario 1 and 2.
    Is this a known issue or is there a workaround for this? 
    Thanks in advance! 
    Kind regards, Davy

    Yes!
    This problem is solved right now.
    My issue was that I'm using custom content types deployed by Visual Studio in the content type hub. To create a managed metadata site column in visual studio, you need to have first of all your managed metadata field, but also a hidden field accompagnied
    to make the actual mapping like the example below:
    <Field ID="{B654D984-187A-471B-8738-F08F3356CFDA}"
    Type="TaxonomyFieldType"
    DisplayName="Countries"
    ShowField="Term1033"
    EnforceUniqueValues="FALSE"
    Group="Demo"
    StaticName="Countries"
    Name="Countries">
    <Customization>
    <ArrayOfProperty>
    <Property>
    <Name>TextField</Name>;
    <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{67308AC2-9556-456B-BF9E-43E8F23EBEE6}</Value>
    </Property>
    </ArrayOfProperty>
    </Customization>
    </Field>
    <Field Type="Note"
    DisplayName="Countries_0"
    StaticName="CountriesTaxHTField0"
    Name="CountriesTaxHTField0"
    ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}"
    ShowInViewForms="FALSE"
    Required="FALSE"
    Hidden="TRUE"
    CanToggleHidden="TRUE"
    Group="Demo"
    RowOrdinal="0"
    />
    </Elements>
    VERY important here is that when you create your content type using visual studio, you not only have to add the managed metadata site column in your xml (which let the content type work already perfectly) but also add the hidden field to your content type
    xml !! This way, SharePoint knows that when you have multiple content types with the same site columns in the same library, the second content type also need to get the hidden field from this site columns like in the example below!
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Document (0x0101) -->;
    <ContentType ID="0x010100571ebc0f478a49d5a775039347ee1535"
    Name="Document Location"
    Group="Demo"
    Description="A content type containing Managed Metadata Column."
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{B654D984-187A-471B-8738-F08F3356CFDA}" Name="Countries"/>
    <FieldRef ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}" Name="CountriesTaxHTField0"/>
    <FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" Name="TaxCatchAll"/>
    <FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" Name="TaxCatchAllLabel"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    I'm very happy I found this solution, because in the whole project i'm implementing, this was used a lot!
    Special thanks to the blog of @cann0nf0dder (http://cann0nf0dder.wordpress.com/2013/04/01/creating-a-site-column-with-managed-metadata) which let me think about this! 
    This ticket is answered now! :-)
    Kind regards,
    Davy

  • Powershell script Information output in column instead of rows

    Dear All,
    I am required powershell script Information output  in column instead of rows.
    $usr= get-aduser -filter * | select sAMAccountName,homeDrive,TerminalServicesProfilePath,homeDirectory,physicalDeliveryOfficeName,userAccountControl,displayName,l,mail, profilepath
    $myarray = @()
    Foreach($usr1 in $usr)
    $userDN = (Get-ADUser $usr1.samaccountname).distinguishedName
    $userInfo = [ADSI]"LDAP://$userDN" | select sAMAccountName,homeDrive,TerminalServicesProfilePath,homeDirectory,physicalDeliveryOfficeName,userAccountControl,displayName,l,mail, profilepath
    $ts=$userInfo.TerminalServicesProfilePath
    $sn=$userInfo.samaccountname
    $hm=$userinfo.homeDrive
    $hd=$userinfo.homeDirectory
    $pd=$userinfo.physicalDeliveryOfficeName
    $ua=$userinfo.userAccountControl
    $dp=$userinfo.displayName
    $ll=$userinfo.l
    $ml=$userinfo.mail
    $pp=$userinfo.profilepath
    $myarray += New-Object psobject -Property @{
        Sam = $userInfo.samaccountname
        TerminalServicesProfilePath = $userInfo.TerminalServicesProfilePath
      homeDrive = $userinfo.homeDrive
        homeDirectory=$userinfo.homeDirectory
        physicalDeliveryOfficeName=$userinfo.physicalDeliveryOfficeName
        userAccountControl=$userinfo.userAccountControl
        displayName=$userinfo.displayName
         l=$userinfo.l
         mail=$userinfo.mail
         profilepath=$userinfo.profilepath
    $myarray |fl
    $myarray | Out-File "c:\final.txt"

    Hey this is such a sweet small script compared to everything else out there and I guess you can edit it to return any value you wish. One LARGE problem however: the TerminalServicesProfilePath comes back empty on all accounts regardless of whether the field
    is populated or not. This is basically because this setting is not stored in an Active Directory attribute but Terminal Services information is stored in the userParameters schema attribute as a BLOB.
    I got this script:
    $Users = ([ADSISearcher]"(&(objectCategory=person)(objectClass=user))").findall() | select path
    foreach ($user in $users) {
    $userSearch = [adsi]"$($user.path)"
    # get logon name
    $userSearch.psbase.InvokeGet(“SamAccountName”)
    # Profile Attributes
    $userSearch.psbase.InvokeGet("ProfilePath")
    # Remote Desktop Services Attributes
    $userSearch.psbase.InvokeGet("TerminalServicesProfilePath")
    which returns the value but the output is terribly unformatted. If we could integrate the two to ensure that it is correctly formatted, AND returns the TSProfile that would be awesome!
    Can anyone help me do that?
    Life is dangerous, no one has ever survived. So enjoy!
    Please do not tag an unrelated quesiton onto the end of an old and answered question.  Please read the forum guidelines before posting.
    We do not do custom scripts on demand.
    ¯\_(ツ)_/¯

  • SharePoint Designer - Data Source Details doesn't show all Managed Metadata Columns

    Hello all,
    I've an issue with SharePoint Designer in combination with managed metadata columns.
    I use content type which uses it total 7 managed meta data (site) columns and additional 20 columns for data.
    I use a dataview and I'm aligning the XSLT for the display of the data.
    In the Data Source Details all other columns will be displayed but from the managed metadata columns 3 columns are missing, they are not shown. So it seems impossible to me to access the data in the XSLT.
    During my investigations i've found out that the columns will be displayed if I change the DataSourceMode="List" to DataSourceMode="ListItems". Nevertheless, the missing columns are still empty even they should contain data.
    Do you have any idea what causes the issue?
    It seems like there is a restriction in SharePoint Designer 2010 and/or SharePoint 2010 with regards to the count for the use of managed metadata columns.
    Would appreciate any help and idea.
    Thanks in advance,
    Stefan

    Hello all,
    I've an issue with SharePoint Designer in combination with managed metadata columns.
    I use content type which uses it total 7 managed meta data (site) columns and additional 20 columns for data.
    I use a dataview and I'm aligning the XSLT for the display of the data.
    In the Data Source Details all other columns will be displayed but from the managed metadata columns 3 columns are missing, they are not shown. So it seems impossible to me to access the data in the XSLT.
    During my investigations i've found out that the columns will be displayed if I change the DataSourceMode="List" to DataSourceMode="ListItems". Nevertheless, the missing columns are still empty even they should contain data.
    Do you have any idea what causes the issue?
    It seems like there is a restriction in SharePoint Designer 2010 and/or SharePoint 2010 with regards to the count for the use of managed metadata columns.
    Would appreciate any help and idea.
    Thanks in advance,
    Stefan

Maybe you are looking for

  • Running application in full screen mode

    Hi, everyone. I want to write an application (extends JFrame) which runs in full screen mode. It normally runs as a window with minimize, maximize, and close buttons on the top right corner of the window. I want to run it in full screen mode, or at l

  • DB to use stand alone Softwares ? Need Help

    Hi friends, My Housing Society has asked me to develop a software for their accounting purpose. As I am well versed with JAVA I would using it for GUI thing. But I could not decide on DB software. I would like to open source softwares and it should b

  • Interactive Commands in NetConfig for Cisco ASA

    Hi, Maybe anyone knows, does CiscoWorks LMS supports this feature for Cisco ASA or I'm doing something wrong? I've sent interactive command "copy tftp: flash: <R>ip_address<R>asa841-k8.bin<R><R>"  to my ASA using netconfig tool and recived error "Com

  • Jdk1.4,a problem

    I have used jdk1.3.1 write a application,in it,chinese can be shown well,but when i use jdk1.4,chinese changed to square,why? Is this a bug in jdk1.4? How to resolve it? thanks!

  • Reader X Folder redirection / Roaming Profiles supported ? by

    Are Folder redirection / Roaming Profiles supported in Reader X ? (that's in systems that use Active Directory in Windows) Its only been a bug for about 10 years ;-) cheers pb...