How to get username from AssignedTo item using Powershell with CSOM?

Hi all:
I have a Powershel script with CSOM to extract some information from a list in SP2010, however I can’t get the user name associated to the field ‘AssignedTo’. It seems that in order to extract information from this field you need to use ‘Microsoft.SharePoint.Client.FieldLookupValue’
however I don’t know how to do that with Powershell.
Thank you very much for your help
Regards

Hi Jaydeep:
The sentence "New-Object Microsoft.SharePoint.SPFieldUserValue" failed, however, I just added this to get the User Name:
$item["AssignedTo"].lookupvalue
I don't know if it is the best solution but it shows the UserName.
Thank you very much
Regards
Carlos Negroni

Similar Messages

  • How to get username from customer email id.

    Hi experts,
    How to get username from customer email id.I am using transaction XD02.
    I would be thankful for your kind replies .
    Regards,
    Sachin Hada

    Hi sachin,
    Re: Email id field
    Regards,
    Sravanthi

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • How to get file from FTP Server using File Control

    Hi,
    Any one did getting file from FTP Server?
    Please let me know any one help me.
    I would need to get file from FTP Server.
    Thanks,
    Madhu

    Yes I have done that. But In FTP Server I cannt read file, because no previliges. Only I need to copy file from FTP Server to local server then only I can read that file.
    I tried all options using FileConrol(getFiles(),read()).
    getFiles() - It wont copy the file, it give information about file.
    read() - I dont have previliges to read the file.
    Please tell me any other procedure would be there for getting file from FTPServer.
    Thanks,
    Madhu

  • How to get listitems from Sharepoint online using REST based on webid and listid

    In my JavaScript code I have a webid and a listid in a sharepoint form page.
    I'm trying to construct a rest url to get to the infomation in the list.
    I cant figure out the url to get at the lists items.
    My WebID is 33213c5c-30e5-468c-87f7-52b48a7b6a3d
    My ListID is d38444af-dd7f-404b-9e75-b1f8c6cdee7d
    When i go to
    https://xxx.sharepoint.com/_api/web/webs?$expand=lists,lists/items&$filter=(iD eq guid'33213c5c-30e5-468c-87f7-52b48a7b6a3d' )
    I get all items in all lists on the specified web. But when i go to
    https://xxx.sharepoint.com/_api/web/webs?$expand=lists,lists/items&$filter=((iD eq guid'33213c5c-30e5-468c-87f7-52b48a7b6a3d' ) and (Lists/Id eq guid'd38444af-dd7f-404b-9e75-b1f8c6cdee7d'
    Sharepoint complains saying  'Field or property "Id" does not exist'
    I can probably do this using multiple requests (get the web, then get the list), but the component I am working on needs a single url to access the listitems,
    Can this be done?

    Unfortunately, this cannot be done. The best you can do is to bring back the lists collection of the sub site.
    https://xxx.sharepoint.com/_api/web/webs&$filter=(id eq guid '33213c5c-30e5-468c-87f7-52b48a7b6a3d')&$select=lists&$expand=lists
    The unfortunate part here is that the webs (web collection) object does not implement an indexer. Why? Don't know. It should just like the lists (list collection).
    https://xxx.sharepoint.com/_api/web/webs(guid '33213c5c-30e5-468c-87f7-52b48a7b6a3d')/lists(guid'd38444af-dd7f-404b-9e75-b1f8c6cdee7d');
    With a web collection indexer it would be that easy.
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • How to get data from live site using C# on grid view

    hi, how am I able to get data from a website and display it in a grid view ?
    Can anyone show me how I would do this? Thanks

    Hello,
    This post does not fit to this forum, read the
    stickies.
    Regards, Eyal Shilony

  • How to get information about cluster disk using powershell

    Hi
    How can I list all cluster disks in my Hyper-V cluster using Powershell? I see two cluster disk "Cluster Disk 1" and "Cluster Disk 1" in my cluster management console but I would like to see them using powershell.
    Kind Regards Tomasz

    http://tinyurl.com/mfro3q5
    Get-ClusterResource
    Get-ClusterQuorum
    Get-ClusterSharedVolume
    . : | : . : | : . tim

  • How to get listitems from different lists using Js

    Hi,
    I want to search my web for all the lists that contains a certain checkbox column (get it by name).
    Once I have this list, I want to iterate through all of them and get the list items with this column checked.
    I got the lists, but when I tried to get the fields - I got an error - the system doesn't recognizes the fields.
    To be more specific - in the code I've posted below in method onGetFieldsSuccess I'm getting an error in the first line, as I can't retrieve the enumerator.
    In the MSDN I saw how to retrieve list's fields, but there it was a specific list. Is there a way to get the lists who have a specific field?
    Any help will be appreciated
    <script> 
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    var ctx;
    var lists;
    function showFavorites()
         ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         ctx.load(web);
         lists = ctx.get_site().openWeb("/legal").get_lists();
         ctx.load(lists);
         ctx.executeQueryAsync(Function.createDelegate(this, this.onGetListSuccess), Function.createDelegate(this, this.onFail));
    var list;
    var fields;
    function onGetListSuccess(sender, args) {
              var listEnumerator = lists.getEnumerator();
              while (listEnumerator.moveNext()) {
                   list = listEnumerator.get_current();
                   ctx.load(list);
                   fields = list.get_fields();
                    ctx.load(fields , 'Include(Title)');
                   ctx.executeQueryAsync(Function.createDelegate(this, this.onGetFieldsSuccess), Function.createDelegate(this, this.onFail));
    function onGetFieldsSuccess(sender, args)
          var fieldEnumerator = fields.getEnumerator();
        while (fieldEnumerator.moveNext()) {
            var field = fieldEnumerator.get_current();
            var name = field.get_staticName();
            if (name == "MyFavorite") {
                alert(list.get_title()); 
                break;
    function onFail(sender, args) {
        console.log(args.get_message());
    </script>​​​​​​​​​​​​​​​​​​​​​​​​​

    Thanks a lot Thriggle,
    I've used your advise, and other then some syntax problems (as you predicted :) everything worked just fine!
    (I had to add another executeQueryAsync to get the listItems files - but that wasn't a problem).
    The only issue that I have is that it takes FOREVER to load, and once it does load - it returns duplicates of the same results (sometimes 3, sometime up to 10).
    I only have 13 tables with about 50 list items in each table, and from that only 6 tables have the specified field - so it shouldn't have taken THAT long (sometimes I see the results after 45 seconds after the page finished loading).
    should I have used a new client context for each query? or is there a place where I'm getting unnecessary loops (I've made sure that I have only 1 list item that matches the 
    I'm resending the complete code. maybe there's something I've missed here.
    <cfheader name="X-XSS-Protection" value="0"></cfheader>​​​​​ ​​​<script>
    ExecuteOrDelayUntilScriptLoaded(showFavorites, "sp.js"); 
    function showFavorites()
         var displayTable = document.getElementById("myFavoritesTable");
         for(var i = displayTable.rows.length - 1; i > 0; i--)
                displayTable.deleteRow(i);
       var fieldToLookFor = "MyFavorite";
         var ctx = new SP.ClientContext.get_current();
         var web = ctx.get_site().openWeb("/legal");
         var lists = web.get_lists();
         ctx.load(web);
         ctx.load(lists, 'Include(Title,Fields)');
         ctx.executeQueryAsync(Function.createDelegate(this, function(){
         var matchingLists = [];
         var listEnum = lists.getEnumerator();
         while(listEnum.moveNext()){
              var currList = listEnum.get_current();
              var containsField = false;
              var fields = currList.get_fields();
              var fieldEnum = fields.getEnumerator();
              while(fieldEnum.moveNext()){
                   if(fieldEnum.get_current().get_staticName() == fieldToLookFor){ containsField = true; break;}
              if(containsField){
                  matchingLists.push(currList.get_title());            
         //alert(matchingLists);
         var i = 0;
         while(i < matchingLists.length){
              var list = lists.getByTitle(matchingLists[i]);
              i++;
              var camlQuery = new SP.CamlQuery();
              var camlString = '<View><Query><FieldRef Name=\'' + fieldToLookFor + '\' /><Value Type=\'Integer\'>1</Value></Query></View>';
              camlQuery.set_viewXml(camlString);
              var items = list.getItems(camlQuery);
              ctx.load(items);
              ctx.executeQueryAsync(Function.createDelegate(this,function(){
                   var itemEnum = items.getEnumerator();
                   while(itemEnum.moveNext()){
                        var item = itemEnum.get_current();
                        var file = item.get_file();
                        ctx.load(file);
                        ctx.executeQueryAsync(Function.createDelegate(this,function(){
                        var table = document.getElementById("myFavoritesTable");
    // Create an empty <tr> element and add it to the 1st position of the table:
    var row = table.insertRow(-1);
    // Insert new cells (<td> elements) at the 1st and 2nd position of the "new" <tr> element:
    var cell1 = row.insertCell(0);
    var cell2 = row.insertCell(1);
    var cell3 = row.insertCell(2);
    var cell4 = row.insertCell(3);
    cell1.innerHTML = "XX";
    cell2.innerHTML = item.get_id();
    cell3.innerHTML = "<a href='" + item.get_file().get_serverRelativeUrl() + "' alt=''>" + item.get_file().get_name() + "</a>" ;
    cell4.innerHTML = "";
                     }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
              }),Function.createDelegate(this,function(sender, args){
                  alert(args.get_message());
    }), Function.createDelegate(this, function(sender, args){ 
         alert(args.get_message()); 
    </script>​​​​​ 
    <table id="myFavoritesTable">
       <tbody> 
          <tr valign="top" class="ms-viewheadertr"> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">שם טבלה 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">ID 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">כותרת 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> </td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
             <th nowrap="nowrap" class="ms-vh"> 
                <table> 
                   <tbody> 
                      <tr> 
                         <td width="100%" nowrap="nowrap" class="ms-vb">מסמך ​ 
                            <img src="/_layouts/15/images/blank.gif" height="1" width="13" alt="" style="visibility: hidden;"/> ​​​​​​​</td> 
                      </tr> 
                   </tbody> 
                </table> 
             </th> 
          </tr>
       </tbody> 
    </table>​ 
    <p>​​​​​​​​​</p>

  • How to get username from Form-based login

    I am using form-based login in my web.xml file.
    When I attempt to access a protected .jsp page, I get sent to my login page as expected.
    When I enter my username/password successfully it forwards me to the .jsp page I was trying to go to, as expected.
    From that .jsp page, how do I get the username/password info from the login form? I looked at the session attributes, request attributes, and request parameters, but I don't see anything. Does the form-based authentication remove these variables?
    I need the username that is filled out in the login form, so that I can do custom work with it. I cannot ask the user for it again after they login, as that is inefficient and sloppy.

    Found it.
    request.getUserPrincipal().getName()

  • How to get folders from your server using IMAP and push, 3G.

    After looking all over this forum looking for an answer, I found out on my own. here's how:
    Step 1: Login to your email server.
    - If you can, log into your email server via webmail. This ensures that you are in fact connected to your email server and your folders are being created. If your email server doesn't have webmail, then create the folders using whatever email app you have on your PC or Mac.
    Step 2: Creating the folders.
    - All the folders you want to have show up on your iphone must be created as sub-folders under your Inbox folder on the server. Here's what mine looks like for example.
    Mailbox
    -Inbox
    ++-Sent Messages
    ++-Deleted Messages
    ++-Friends
    ++-Work
    ++-Others
    -Drafts
    -Sent
    -Deleted
    -Junk Email
    *you may be wondering why I have 2 sent and Deleted folders. I have it set up so that the folders in the inbox are for the iphone, and the ones outside are from Outlook.
    Step 3: Getting the folders to show up on the iphone.
    - Once you set up your IMAP account on the iphone 3g, simply log into the account, wait for it to finish checking for emails, then tap the Inbox button. Give it a few seconds to load if it's loading something. After it finishes, back out by tapping the 'Mailboxes' in the top-left corner, and your folders should be there.

    So you'd use Java to send the WebDAV protocol. Since this is a Java forum, it would help if you provided the WebDAV part of the equation and we can help with the Java part. Okay? Let us know when you have the WebDAV information.

  • How to get values from resultset when using subquery???

    Hi ,
    I have a problem in executing sql query from java.
    I am executing an sql query which return a intersection of values from 3 tables.
    Here is the query I am using
    select id from dps_user where id in (select b.id from dps_user b,laserlink c
    where c.userid='univ.'||b.login and c.status in(1,3,8,9,10)
    intersect
    select b.id from dps_user b,laserlink c
    where c.userid=b.login and c.status in(1,3,8,9,10)).
    this query is working fine from sql .
    when I am trying to excute the same query from java nothing is coming into resultset.
    String ISP_AND_EMAIL="select id "+
                             " from dps_user where id in (select b.id from dps_user b,laserlink c "+
                                  "where c.userid='"+"univ.'"+" ||b.login and c.status in(1,3,8,9,10)"+
                                  " intersect "+
                                  " select b.id from dps_user b,laserlink c"+
                                  " where c.userid=b.login and c.status in(1,3,8,9,10))";
              System.out.println(ISP_AND_EMAIL);
              rs=stmt.executeQuery(ISP_AND_EMAIL);
    How to use concatinate string (|| ) in java.
    can anyone help to retrieve the values from this resultset...
    Thanks

    concatnation is done using + in java.
    I am doubtful about the following line where there may be error
    "where c.userid='"+"univ.'"+" ||b.login and c.status in(1,3,8,9,10)"+
    I don't know if the univ. is a string or some variable.I need more clarification on this line,then i may help u.
    thx

  • How to get file from temp foldre using StorageFile.GetFileFromPathAsync()

    Hi,
    I am trying to download a .pdf in the temp folder.
    Here is the code
    var uri = new Uri("http://www.nakcollection.com/uploads/7/7/7/4/7774039/the_man_in_the_red_underpants_book.pdf");
    StorageFolder folder = ApplicationData.Current.TemporaryFolder;
    StorageFile file = await folder.CreateFileAsync("one.pdf");
    BackgroundDownloader download = new BackgroundDownloader();
    DownloadOperation downloader = download.CreateDownload(uri, file);
    StorageFile file1 = await StorageFile.GetFileFromPathAsync("");
    Now I want to use that file how can I get that file using
    StorageFile.GetFileFromPathAsync("");
    samEE

    Thanks, a lot it worked :)
    Here is the revised version of the code. It might help others too. :)
    var uri = new Uri("http://www.nakcollection.com/uploads/7/7/7/4/7774039/the_man_in_the_red_underpants_book.pdf");
    StorageFolder folder = ApplicationData.Current.TemporaryFolder;
    StorageFile file = await folder.CreateFileAsync("one.pdf",CreationCollisionOption.ReplaceExisting);
    if(file !=null)
    //Download form uri to file
    BackgroundDownloader download = new BackgroundDownloader();
    DownloadOperation downloader = download.CreateDownload(uri, file);
    //set download priority
    downloader.Priority = BackgroundTransferPriority.High;
    //request uncontrained download
    UnconstrainedTransferRequestResult result = await
    BackgroundDownloader.RequestUnconstrainedDownloadsAsync(new DownloadOperation[] { downloader });
    // start downloading
    await downloader.StartAsync();
    //the download is now finished
    var tempUri = new Uri("ms-appdata:///temp/one.pdf");
    StorageFile file1 = await StorageFile.GetFileFromApplicationUriAsync(tempUri);
    if (file1 != null)
    //user defined function for further usage of file
    LoadFile(file1);
    samEE

  • How to get agreement from promotion number ( using BAPI_AGREEMENTS)

    Hi experts,
    I have a requirement where  I need to  generate agreement from promotion number( As in transaction WAK2) programatically, 
    I have tried using 'BAPI_AGREEMENTS' but could not pass promotion number in it , would appreciate any help on this.
    If any other BAPI OR Function module can be used please intimate.
    Thanks
    Koyel

    If you are using the PDFL, there is not current page number - you are not
    displaying the document, so there is no way to get from a PDDoc to a page
    number. If you do have the PDPage, you can just use PDPageGetNumber() to
    get the page number.

  • How to get username from audible account if one is associated with the store account

    So, I noticed, while de-authorizing a previous computer of an itunes store account, that an audible account was available for deauthorization as well.  I never authorized an audible account, and I'm not getting any help from apple about retaining a username if you never created one.  shady

    Have you ever had an account with audible.com ? If not then you won't have one to deauthorise - the option to deauthorise one shows in the Advanced menu on my iTunes, even though I haven't currently got one authorised on it. If you have got an audible account and you have authorised it on that computer then Apple won't know what it is, as the account would be with audible.com, not Apple.

Maybe you are looking for

  • HT1846 Windows 7 64 bit on a macbook 2.1 ????

    I have a white macbook 2.1 I think that its early 2007. i recently put lion on it but now i want to try the developer preview for windows. I have a legitimate copy of windows 7 but it is the 64 bit version. I see some people say yes and some people s

  • Cannot place filename error 0

    Created a flash file of a product image with 360 rotation. Tried to place it and it gives me an error: 0 The swf file was created 3DRT. I can import normal flash files made in Adobe Flash no problem. Any ideas? Really need to have these 360 product i

  • Select only one type of field using JavaScript in Acrobat X

    Looking for a way to select all fields of the same type on a form at once? Such as selecting all text fields to modify the font type, or all buttons to modify display values. Prior versions 6,7, & 8 were able to do this. Would prefer a script for eac

  • Is it possible to call a Crystal Report from Oracle Forms.

    Hi Everybody, I got a Dout about Crystal Reports. Is it possible to call Crystal Reports from Oracle Forms.

  • TEXT IN SCRIPT

    HAI,        HOW CAN PRINT TEXT VERTICALLY IN SCRIPT ?         IS IT , PRINT-CONTROL ZM200 ....TEXT PRINT-CONTROL ZM300 IF IT IS PRINT-COMTROL IS COMMAND ( /: ) OR SOMETHING ELSE THANK YOU ASHOK KUMAR