SharePoint Online-- Update a site owner with csv file. The two column headers are simply: url and owner. The url can vary between parent and child and even child of the child (ie google.com ; google.com/sites/page1 ; google.com/after/hero/superman/cape)
Thanks in advance folks
So, which are you having a problem with - the command to update a site owner, or reading in and enumerating the contents of a CSV file?
Hey there Don! I am a bit green to SharePoint powershell. After further digging, I was not looking to change the owner per se. The end result was being able to use my csv file to update the access request email for each site and subsite. This is particularly tricky in SPOnline being that the SPOWeb cmdlet was not included in the management shell. I have since knocked out most of what I needed to do however my spreadsheet is only applied to the target sites if they are in parent child order in the spreadsheet. Meaning, row 1 has to be site.com/sites/Hello while row two must be site.com/site/Hello/Goodbye OR ELSE no dice. Any clue on how I can make this work irregardless of order?
None whatsoever - I’m not a SharePoint guy at all. You could probably sort the CSV on that field, though, to get them in order.
Thanks for the suggestion Don. I initially tried ‘-descending’ (no ascending available) but this output a child to parent order which changed the parent sites and pushed the parent email down to the child. I ended up using ‘Sort-Object’ to get this done.
Ascending is the default. -Descending flips it.
True but I am talking about using -descending as such:
Import-Csv file.csv | sort URL -Descending
Import-Csv file.csv | Sort-Object
You’ve been a big help Don! Your time and assistance has been greatly appreciated.