Update web - site admin (SharePoint Online)

This topic contains 7 replies, has 2 voices, and was last updated by Profile photo of Macsamust Macsamust 3 months, 1 week ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #44265
    Profile photo of Macsamust
    Macsamust
    Participant

    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

    #44709
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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?

    #44717
    Profile photo of Macsamust
    Macsamust
    Participant

    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?

    #44724
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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.

    #44736
    Profile photo of Macsamust
    Macsamust
    Participant

    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.

    #44742
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Ascending is the default. -Descending flips it.

    #44744
    Profile photo of Macsamust
    Macsamust
    Participant

    True but I am talking about using -descending as such:

    Import-Csv file.csv | sort URL -Descending

    vice

    Import-Csv file.csv | Sort-Object

    • This reply was modified 3 months, 1 week ago by Profile photo of Macsamust Macsamust.
    #44755
    Profile photo of Macsamust
    Macsamust
    Participant

    You've been a big help Don! Your time and assistance has been greatly appreciated.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.