►
Description
This community demo is taken from the SharePoint General SIG community call recording on 17th of October 2019. In this video, Erwin van Hunen (Rencore) is showing how to create reusable templates from existing modern SharePoint sites using PowerShell (or code).
Presenter - Erwin van Hunen (Rencore) @erwinvanhunen
See more on the open-source provisioning engine and tenant templating model from https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-remote-provisioning
More details on the SharePoint dev community calls from http://aka.ms/sppnp.
A
A
What
are
we
looking
at
so
when
I
know,
there's
a
couple
of
things
here
is
that,
like
we
have
an
menu
here
at
the
top,
and
then
my
next
question
is:
is
there
like,
for
instance,
a
food
or,
if
there's
coal,
all
the
way
down,
and
yes,
there
are
the
foods
are
here.
So
that's
important
to
know
it's
obviously
a
more
insight.
There's
a
bunch
of
red
parts.
Here
we
have
the
vertical
section
I'm
just
scrolling
down
through
the
pace.
A
If
I
see
something
that
jumps
out
to
me
and
right
now,
it's
just
a
bunch
of
bad
parts
here,
some
text
here
and
there.
So
the
next
step
I'll
take
is
that
I
go
to
my
to
decide
contents,
and
that
is
interesting
for
me
because
there
I
see
which
lists
are
there
and
if
there
actually
are
items
in
those
lists.
You
see
that's
conveniently
at
this
place,
and
that
means
that
I
can
actually
limits
what
I
extract
from
this
site
to
those
lists.
A
A
This
is
totally
undocumented
right
now
this
will
come,
but
if
you're
interested
on
how
you
use
this
file
just
re-watch,
the
video,
the
recording
of
this
session
should
get
you
up
running.
So
if
we
open
this,
the
configuration
file,
which
is
containing
a
lot
of
squigglies
and
boring,
brackets
go
here.
Then
you
see
that
we
actually
follow.
A
If
you
carefully
watch
them.
If
you
need
to
Jason,
if
you
listen
to
the
session
from
from
Chris,
then
you
should
totally
understand
what
you're
looking
at
right
now
here.
So
here
we
have
a
schema
if
I
look
here,
so
we
actually
officially
a
schema
now
located
it's
on
the
Developer
tab
microscope,
which
describes
this
configuration
file.
So
when
I
first
tell
the
engine
is
what
should
it
actually
parse
what
she
did
actually
start
to
extract
and
I
wanted
to
extract
lists
pages
navigation
sites
with
your
site,
header
and
web
settings.
A
A
Then,
if
we
go
to
the
pages,
I
say:
okay,
listen,
I'm,
for
instance,
you're
extracting
a
template
from
a
specific
tenants
and
you're
going
to
apply
the
template
to
another
tenants,
it's
very
often
that
the
users
are
not
present
on
the
other
tenants.
So
what
you'll
say
what
we're
saying
here
is:
okay,
clear
out
the
author
information,
where
we
can
find
it
in
the
modern
pages.
A
So,
for
instance,
web
parts
sometimes
have
references
to
authors
pages
itself
as
a
reference
to
an
author,
so
clear,
that's
value
out
so
remove
all
those
usernames
and
we're
also
telling
it
the
engine
to
include
all
client-side
page.
It's
not
just
a
home
page.
It's
just
a
default
behavior,
but
just
take
give
me
all
client-side
pages.
A
A
Then
you
create
data,
rows,
skip
the
empty
fields
fields
and
have
no
value,
just
don't
put
them
in
the
result,
a
template,
we
don't
need
them
and
then
I
can
actually
apply
a
specific
query
to
deaths
list
when
I
extract
that
information
and
I
say
I
only
want
the
title,
category,
location,
etc.
Fields,
then,
if
I
scroll
a
bit
down
here,
say,
ok,
give
me
the
documents
give
me
all
the
documents
on
the
document.
Library
include
the
items
and
include
the
attachments
so
download
the
attachments.
Now
you
can
set
the
page
sites
here.
A
You
don't
necessarily
have
to
do
that,
but
this
is
just
for
performance
reasons.
If
you
have
like
thousands
of
documents,
you
don't
want
to
query
all
thousand
documents
in
one:
go.
You
won't
even
page
by
page
by
page
my
plates
and
the
page
size
you
can
define
here
so
what
I
have
set
it
now
4
to
10.
So
this
is
my
configuration
very
important.
Is
that
you
also
flick
the
persist
asset
files
to
true?
A
If
you
set
this
one
to
true,
we
will
try
to
extract
images
from
the
modern
pages
and
add
them
to
your
templates.
So
this
is
the
configuration
file,
so
if
I
now
go
to
PowerShell
and
I
as
weird
thing
with
the
latest
version
of
codes,
but
if
I
go
to
powershell
now
and
say,
get
C&P
original
template
output
to
an
XML
file
and
I
say
configuration
extract
filtration
on
the
press,
enter
and
sit
back
and
relax,
and
what
it
will
do
now
is
the
typical
extraction
process
will
go
through
all
the
artifacts
it
finds.
A
A
There's
the
demo
folder
demo,
the
landing
the
landing
and
it's
a
bit
small.
Maybe
so
it's
hard
to
see,
but
you
see
there's
now
already
a
shared
documents
folder
here
and
there
is
a
subfolder
in
there
and
there
we
have
the
documents
it's
actually
currently
downloading,
from
the
the
server
or
from
this
from
your
site.
So
if
we
continue
see
now
their
site
assets
popping
up
here
and
there
we
have
the
assets
inside
pages
and
there
are
some
home
plates
and
images
are
coming
down
now
and
are
being
extracted
to
the
to
the
file
system.
A
A
So
what
I
did
then
is
I
created
a
like
a
template
of
a
tenant
template
and
that's
here
and
this
basically
I
took
an
existing
template.
An
existing
templates,
tenant
template
and
I
just
removes
a
lot
of
things
and
cleaned
it
up
a
bit
and
this
tenant
template.
If
you
won't
fight
one
of
those
she
can
find
them
in
our
free
posters,
where
we
have
the
little
templates
located
there,
you
can
find
you
standard
templates.
So
if
I
open
this
from
its
official
studio,
because
I
want
schema
support
there
we
go.
A
This
is
my
base
templates
and-
and
there
are
some
things
missing
here
so,
for
instance,
here
the
templates
is
empty.
So
what
I
do
now
is
if
I
open,
that's
other,
it's
fine.
The
template
that
this
has
been
recently
extracted
get
my
scene
here
there
and
we
say
there
is
my
template,
so
I
think
that's
intense
side,
HTML
the
clipboard.
A
There
and
I
paste
that
in
and
there
we
have
my
templates
located
now,
there's
a
bit
of
things
around
it.
You
see
here
some
duplicates
things
that
you
have
to
take
away.
So
we
take
the
smell
away:
provisioning
templates,
this
one
go
away
and
I'm
scrolled
down,
and
we
have
to
clean
up
a
bit
smooth
here
that
one
goes
and
they
should
do
it.
I
think,
and
it's
complaining
about
bad
Specter,
so
Oh
some
red
thing
here.
A
A
And
you
see
here,
the
title
is
being
set
to
the
this
parameter:
the
site
title.
If
it's
called
a
bit
to
the
right,
then
we
see
in
the
description
is
empty.
The
URL
is
being
set
to
the
value
of
the
site:
URL
parameter,
it's
not
a
half
site
and
we
use
the
current
user
login
name
as
the
owner,
the
current
user,
that
is
running
technically
commandlets,
and
here
we
have
the
the
template.
A
It's
running
and
you
see
here,
provisioning
template
references,
main
templates,
and
what
this
means
is
that
when
we
create
the
site
collection
after
the
site,
collection
has
be
created.
We
apply
this
template
that
should
be
in
this
file
and
in
this
case
the
template
is
called
like
this.
So
I
replace
this
one
with
me.
A
But
nobody
engine
knows
which
template
to
apply
and
if
we
scroll
down
into
this
template
and
collapse
on,
you
think
you
see
here
all
the
files.
For
instance,
all
the
reference
to
the
files
are
there
with
the
correct
target
location.
So
if
the
documents
we
have
the
images
there,
we
have
the
client-side
pages
here
we
have
all
the
the
the
things
here
and
let
me
double
check
here,
because
I
think
I
might
see
an
issue
yeah.
Okay,
there
we
go
so
schema
of
my
tenant.
Template
was
wrong.
A
It
was
0,
3
and
flipped
it
now
to
0-9,
and
now
there
should
not
be
any
references
anymore.
That's
are
failing.
No
all
good
done.
What
was
three?
Oh,
not
green.
Actually
so
if
I
safety
standard
template
so
now,
I
have
a
tenant
template
that
I
could
actually
apply
to
my
tenant.
Afraid
I
wanted
to
test
it,
but
I
want
to
grabbed
it
all
together
and
make
it
a
single
file.
So
I
want
all
the
files
to
share
documents
to
site
assets
and
the
the
tenet
template
file
into
one
single
PDF
file.
A
So
what
I
do
then
is
I?
Read
it
into
a
variable,
I,
say
three:
tenants
template
specify
the
tenant
template
and
there
we
go.
So
if
I
just
go
away,
I
can
okay,
so
we
have
a
template
or
property.
So
if
I
want
I
could
just
start
to
tweak
things
here
and
add
things,
but
all
bit
code
if
you
want
to,
but
you
don't
want
that.
A
We
just
want
to
save
this
as
a
pinky
file,
so
I
say
no
safe
out
and
it's
the
landing
peek
template
that
variable
that
I
just
put
my
template
in
there
and
press
ENTER
and
there
we
go
and
now
the
result
is
a
PP
phone
with
all
the
files
in
there.
You
see
it's
actually
pretty
big
one,
because
there's
a
lot
of
images
there
and
some
of
the
images
are
actually
very
large.
So
now
I
could
actually
apply
this
template.
So
if
I
say,
if
I
connect
to
my
roots
of
my
tenants.
A
A
A
A
B
B
A
B
A
The
way
to
around
this
is
to
is
to
resist
opening
the
site
before
the
engine
has
been
finished,
provisioning
your
templates
intesity
with
caching.
So
if
you
do
not
go
to
the
site
before
the
site
has
been
proved,
it
fully
provisioned
and
then
navigate
to
the
site,
you
will
notice
that
the
off-site
navigation
is
just
there
normally
without
any
problem,
so
we're
going
nicely
on
here.
So
if
I
go
to
my
site
contents,
let's
see
if
there's
already
some
data
there,
you
see
their
site
assets
coming
into
the
five.
The
five
documents
they're
already
there.
A
B
A
B
A
Yes
and
every
time
it
has
a
fixed
structure,
so
information
he'll,
you
finds
the
green
pea
file.
If
you
go
into
the
source,
folder
you'll
find
the
actual
XML
version
with
all
the
assets
that
is
needed
for
that
specific
template.
So,
let's
see
where
this
one
is,
it's
done
running.
So
let's
hope
this.
If
I
reload
this
page
now
I'm
using
the
content,
you
see
there's
two
events
for
a
site
pages,
five
documents
etc,
and
if
I
go
to
my
site,
there
we
go
now.
A
What
I
didn't
do
is
I
modified
the
theme,
so
you
see
it
gets
evil
theme.
There's
a
bit
of
a
problem
with
the
current
API
actually
can
extract
an
existing
theme
from
a
modern
theme
from
the
site.
So
I
want
to
show
you
how
you
can
actually
extract
the
theme
from
your
tenant.
That's
the
last
thing:
I'll
show
you
each
day.
So
if
you
go
to
change
the
look
and
you
go
to
scene,
you
can
pick
one
of
the
themes
that
are
provisioned
to
your
tenant,
say:
I
want
to
I
want
to.
A
Instead
of
using
a
tenant,
sculpt
theme
I
want
a
theme
that
is
specific
to
this
site
collection.
What
you
can
do
is
take
an
existing
tendency
like
control
your
team
scene,
for
instance
here
and
extract
that
bump.
So,
if
you
can
see
II
go
to
u-dub
again,
you
say
get
pinky
penalty,
and
if
you
just
enter
this
as
this,
it
will
enumerate
all
the
themes
from
your
own
from
your
tenants
and
it
was
the
control,
so
team
theme
that
I
want
it.
So
what
I
do
then
is.
A
There
we
go
and
this
one
has
a
parallax
property
and
it's
just
a
list
of
I'll
tell
you
keys,
are
the
key
value,
so
what
I
can
do
now?
Recent
convert
to
Jason
and
I
got
adjacent
version.
I
click!
That's
into
my
clipboard
copied
it
to
my
clipboard,
then
I
go
to
my
templates.
I,
go
to
my
provisioning,
template,
I,
say
TMP,
clean
name
so
required
parameter.
We
just
leave
it
empty.
It
doesn't
require
any
name.
Let
me
paste
this
in
and
that's
it,
and
this
is
how
you
create
your
act.
A
Your
theme
to
your
templates
into
your
site
and
from
now
on
you
just
repack,
it's
the
PP
file.
By
reading
the
template,
save
and
apparent
then
pay
there's
a
PNP
file
and
the
result.
This
is
that
you
did
actually
a
full
round-trip
and
all
the
web
parts
that
I
met
that
were
in
the
original
are
now
still
there
and
everything
is
over
and
works
s.
Let
me
see
some
images
here.
That's
fails
for
some
reason.
I
would
have
to
check
that.