Iterate through a site collections subsites and retrieve users with full control

The following code iterates through all the site collections in my SharePoint Online account, and prints the Admin of each. What I want is to iterate through each subsite in one site collections and print users that have full control. Can someone advise? Thanks

# Input Parameters      $  credentials=Get-Credential    $  URL="https://myDomain.sharepoint.com/"    # Connect to SharePoint Online    Connect-PnPOnline -Url $  URL -Credentials $  credentials    # Get the site collections   $  siteColl=Get-PnPTenantSite  -Recurse  # Loop through the site collections   foreach($  site in $  siteColl)   {       write-host -ForegroundColor Green "Getting SCA from site: " $  site.Url       Connect-PnPOnline -Url $  site.Url -Credentials $  credentials        # Get the site collection administrators       $  scaColl=Get-PnPSiteCollectionAdmin        foreach($  sca in $  scaColl)       {                   $  sca       }   }  

Retrieve the first few lines from testing result with head -n

I am testing a python program and desire to retrieve its first two lines of results

$   python twoSum.py   DEBUG-MainProcess:31921-MainThread:140190102726464 find: 151  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 194  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 247  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 192  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 206  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 171  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 170  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 190  DEBUG-MainProcess:31921-MainThread:140190102726464 j: None DEBUG-MainProcess:31921-MainThread:140190102726464 find: 132  DEBUG-MainProcess:31921-MainThread:140190102726464 j: 63 [8, 63] . ---------------------------------------------------------------------- Ran 1 test in 0.001s  OK 

Employ head to tackle the text

$   python twoSum.py  | head -n 1 DEBUG-MainProcess:31978-MainThread:140699277834048 find: 259  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 235  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 133  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 274  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 265  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 257  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 280  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 134  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 138  DEBUG-MainProcess:31978-MainThread:140699277834048 j: None DEBUG-MainProcess:31978-MainThread:140699277834048 find: 145  DEBUG-MainProcess:31978-MainThread:140699277834048 j: 75 . ---------------------------------------------------------------------- Ran 1 test in 0.001s 

It does not work,
How could I retrieve the first few lines which I want to see.

Jqeury datatable to retrieve SharePoint list items

I am trying to build Jquery datatable to retrieve the list items depending on two filer dropdown boxes and a button. I have a custom list with Title, District, Organization, Number of Tasks as columns.

Organization and District are Drop Down boxes, upon selection of Organization drop down value district values should show up and then we hit button to retrieve the results in datatable. Please check the screen shot below for what I am looking for. Suggestions on this please.enter image description here

Recursive bisection search to retrieve the index of a target

I tried to search the index of a find with bisection algorithms

def bi_search(nums: List[int], find: int) -> int:     """     Return the index of the find      """     if len(nums) == 0:         return -1     else:         mid = len(nums) // 2  #testEntry         if find == nums[mid]:             return mid          if find < nums[mid]:             sub_nums = nums[:mid]             return bi_search(sub_nums, find)            if find > nums[mid]:             sub_nums = nums[mid:]             return bi_search(sub_nums, find) #recursive case. 

but it does not work as expected

In [26]: bi_search(list(range(1000)), 777)                      Out[26]: 4 

It return the mid of the base case.

I noticed that a correct index could be retrieve using iteration methods as in bisect — Array bisection algorithm — Python 3.7.3rc1 documentation

Is it possible to get a correct index in a recursive solution?

Drupal 8 + DB select to retrieve medias from a reference field (in nodes)

Inside a node type, I have a reference field to target a media. With a db select, I need to load all related medias of the nodes. For this I use this code:

$  database = \Drupal::database(); $  result = $  database->select('media_field_data', 'm') ->fields('m', ['mid']) ->condition('m.bundle', 'gallery') ->leftjoin('node__field_related_gallery', 'n', 'media_field_data.mid = node__field_related_gallery.field_related_gallery_target_id') ->leftjoin('field_related_gallery_media_field_data', 'd', 'node__field_related_gallery.entity_id = field_related_gallery_media_field_data.nid') ->range(0, 5) ->execute() ->fetchAllKeyed(0, 0); dpm($  result); 

But with this code I get an error and don’t get the related mids. If I remove the line with the leftjoin I get the mids.

How can I proceed to verify if a media is related to a node and get only the media with a related node?

With views I can get easily the results with this query:

SELECT media_field_data.mid AS mid,  field_related_gallery_media_field_data.nid AS  field_related_gallery_media_field_data_nid FROM {media_field_data} media_field_data LEFT JOIN {node__field_related_gallery} node__field_related_gallery ON   media_field_data.mid =   node__field_related_gallery.field_related_gallery_target_id AND   node__field_related_gallery.deleted = '0'  LEFT JOIN {node_field_data} field_related_gallery_media_field_data ON   node__field_related_gallery.entity_id =   field_related_gallery_media_field_data.nid  WHERE (media_field_data.status = '1') AND (media_field_data.bundle IN   ('gallery')) AND (field_related_gallery_media_field_data.nid IS NOT NULL)  LIMIT 26 OFFSET 0 

Thanks.

Recursive bisection search to retrieve the index of a target

I tried to search the index of a find with bisection algorithms

def bi_search(nums: List[int], find: int) -> int:     """     Return the index of the find      """     if len(nums) == 0:         return -1     else:         mid = len(nums) // 2  #testEntry         if find == nums[mid]:             return mid          if find < nums[mid]:             sub_nums = nums[:mid]             return bi_search(sub_nums, find)            if find > nums[mid]:             sub_nums = nums[mid:]             return bi_search(sub_nums, find) #recursive case. 

but it does not work as expected

In [26]: bi_search(list(range(1000)), 777)                      Out[26]: 4 

It return the mid of the base case.

I noticed that a correct index could be retrieve using iteration methods as in bisect — Array bisection algorithm — Python 3.7.3rc1 documentation

Is it possible to get a correct index in a recursive solution?

Retrieve fund price from Vanguard website using importxml in Google Sheets

This was working in Google Sheets but now I get #N/A message:

Imported Content is Empty

A1: https://institutional.vanguard.com/web/c1/product-details/fund/1680
A2: //*[@id='dailyNavValue']
A3: uimportxml(A1, A3) which results in: #N/A Imported Content is Empty.

I just want to retrieve the mutual fund price.

Problem with QUERY(IMPORTRANGE()) to retrieve data

I’m having a problem with the =QUERY(IMPORTRANGE()) formula while retrieving a column data from one spreadsheet to another.

=QUERY(IMPORTRANGE("spreedsheetURL","Sheet1!A2"),"select Col2 WHERE Col1 Contains B3") 

I want to retrieve data from the column2 spreadsheet(A) to column2 spreadsheet(B) where column1 spreadsheet(A) is equal to the column1 spreadsheet(B).

The error I get is:

Formula parse error.

How to retrieve context in SPFx 1.1.0?

Good morning,

I need to create a spfx element to sharepoint 2016. the project dependencies are:

"react": "15.4.2", "react-dom": "15.4.2", "@types/react": "0.14.46", "@types/react-dom": "0.14.18", "@types/react-addons-shallow-compare": "0.14.17", "@types/react-addons-update": "0.14.14", "@types/react-addons-test-utils": "0.14.15", "@microsoft/sp-core-library": "~1.1.0", "@microsoft/sp-webpart-base": "~1.1.0", "@microsoft/sp-lodash-subset": "~1.1.0", "@microsoft/sp-office-ui-fabric-core": "~1.4.0-0", "@types/webpack-env": "1.13.1", "@types/es6-promise": "0.0.33" 

How do I get the pageContext and the httpClient?

Thanks