Skip to content

Instantly share code, notes, and snippets.

@waldekmastykarz
Created February 24, 2019 15:59
Show Gist options
  • Save waldekmastykarz/f66e7154a96a60ff65bc96cdcc7af425 to your computer and use it in GitHub Desktop.
Save waldekmastykarz/f66e7154a96a60ff65bc96cdcc7af425 to your computer and use it in GitHub Desktop.
Sets the specified user as site owner for a number of test sites
for i in {1..10000};
do
label="$i"
if (( $i < 10 )); then
label="0$label"
fi
if (( $i < 100 )); then
label="0$label"
fi
if (( $i < 1000 )); then
label="0$label"
fi
if (( $i < 10000 )); then
label="0$label"
fi
label="PublicTeam$label"
echo "Updating owners $label..."
o365 spo site classic set --url "https://contoso.sharepoint.com/sites/$label" --owners admin@contoso.onmicrosoft.com
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment