Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: spo site archive #6018

Open
Tracked by #5982
milanholemans opened this issue May 3, 2024 · 3 comments · May be fixed by #6031
Open
Tracked by #5982

New command: spo site archive #6018

milanholemans opened this issue May 3, 2024 · 3 comments · May be fixed by #6031

Comments

@milanholemans
Copy link
Contributor

milanholemans commented May 3, 2024

Usage

m365 spo site archive [options]

Description

Archives a site collection

Options

Option Description
-u, --url <url> URL of the site collection.
-f, --force Don't prompt for confirmation.

Examples

Archive a specific SharePoint site collection

m365 spo site archive --url "https://contoso.sharepoint.com/sites/Marketing"

Archive a specific SharePoint site collection without confirmation prompt

m365 spo site archive --url "https://contoso.sharepoint.com/sites/Marketing" --force

Default properties

No response

Additional Info

API request

Since the REST API request is an internal request, we prefer to use the CSOM request.

POST https://contoso-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery

<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="<CLI app name>"
	xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
	<Actions>
		<ObjectPath Id="2" ObjectPathId="1" />
		<ObjectPath Id="4" ObjectPathId="3" />
		<Query Id="5" ObjectPathId="3">
			<Query SelectAllProperties="true">
				<Properties />
			</Query>
		</Query>
	</Actions>
	<ObjectPaths>
		<Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" />
		<Method Id="3" ParentId="1" Name="ArchiveSiteByUrl">
			<Parameters>
				<Parameter Type="String">https://contoso.sharepoint.com/sites/Marketing</Parameter>
			</Parameters>
		</Method>
	</ObjectPaths>
</Request>

Remarks

Note

Info admonition: To use this command you must be a Global or SharePoint administrator.

Additional info

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR labels May 3, 2024
@Adam-it
Copy link
Contributor

Adam-it commented May 4, 2024

LGTM 👍
Only idea I had (similar like in the unarchive) was maybe to allow to specify site by name.

@Jwaegebaert Jwaegebaert added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels May 6, 2024
@Saurabh7019
Copy link
Contributor

Can I work on this one?

@milanholemans
Copy link
Contributor Author

Definitely! Thanks.

Saurabh7019 added a commit to Saurabh7019/cli-microsoft365 that referenced this issue May 6, 2024
@Saurabh7019 Saurabh7019 linked a pull request May 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants