Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
The script requires SharePoint Online SDK.



What does it do?

The script finds all the checked out files in a single library and checks them in.



How to use?

1. Download and open the file.

2. Refer the paths to the SDK:



PowerShell
#Paths to SDK
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"


```PowerShell
#Paths to SDK
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
```
3. Enter your credentials, the url of the site and the name of the list

PowerShell
#Enter the data
```PowerShell
#Enter the data
$AdminPassword=Read-Host -Prompt "Enter password" -AsSecureString
$username="AwesomeMachine\administrator"
$username="AwesomeMachine\administrator"
$Url="http://ThisIsSharePoint/sites/site1"
$ListTitle="Documents"
$ListTitle="Documents"
```
4. Save the file, close, and run the script in Powershell.



The files will have the following check-in in their version history:



If you want to change the comment's content, modify the following line in the script:

PowerShell
$file.CheckIn('Checked in automatically', 'MajorCheckIn')
```PowerShell
\$file.CheckIn('Checked in automatically', 'MajorCheckIn')
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This is a Powershell module with a single function. Not very useful, it would make more sense as a function, 2019-me may say to 2014-me, but it was one of the first steps to create SPOMod and I keep it out of sentiment.
>#

function Set-Checkout{
function Set-Checkout {
param (
[Parameter(Mandatory=$true,Position=1)]
[string]$Username,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,55 @@ It corresponds to the following GUI option:
<img src="../Force your users to checkout documents using Powershell/RequireCheckout.png">

After import you can use Set-Checkout cmdlet with the following parameters:

```powershell
[string]$Username
```
```

The string specifies admin of a given site collection where you want to enforce Checkout Requirement or disable the enforcement

```powershell
[string]$Url
```
Specifies the url of a site where you want to enable or disable Checkout Requirement for all lists

Specifies the url of a site where you want to enable or disable Checkout Requirement for all lists

```powershell
[bool]$IncludeSubsites=$false,
```
```

Specifies whether the cmdlet should also change the Checkout Requirement in the subsites

```powershell
[string]$AdminPassword,
```

Admin' password

```powershell
[bool]$ForceCheckout=$true
```

Specifies whether the documents should be checked out ($true) or disables the Checkout Requirement ($false).

<hr>

## ***Example:***
## **_Example:_**

**PS C:\Windows\system32**> **Import-Module d:\Powershell\CheckOutModule2.psm1**

PS C:\Windows\system32> Set-Checkout -Username trial@trialtrial123.onmicrosoft.com -Url https://trialtrial123.sharepoint.com/sites/teamsitewithlibraries -IncludeSubsites $true -AdminPassword Password -ForceCheckout $true

It uses the following prerequisites. If those libraries are in different location on your computer, please edit the ```.psm1``` file!


It uses the following prerequisites. If those libraries are in different location on your computer, please edit the `.psm1` file!

```PowerShell
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
```

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
```

### Results:

<img src="../Force your users to checkout documents using Powershell/RequireCheckoutResults.png">

<br/><br/>
<br/><br/>
<b>Enjoy and please share feedback!</b>
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
A short script that retrieves all lists from a site that haven't been modified for a while.

Please mind the difference between used and modified. A list of countries or client contacts that serve as lookup for other lists may not be changed often but is still widely used.

Please mind the difference between used and modified. A list of countries or client contacts that serve as lookup for other lists may not be changed often but is still widely used.
You need SharePoint Online SDK to run it.





You need SharePoint Online SDK to run it.

Please do NOT enter your password in the file! You will be asked for it during script execution.
Please do NOT enter your password in the file! You will be asked for it during script execution.

Please adjust the following parameters before execution:


```PowerShell
#Paths to SDK
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

PowerShell
#Paths to SDK
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Enter the data
#Enter the data
$username="ana@etr56.onmicrosoft.com"
$Url="https://etr56.sharepoint.com/sites/demigtest11-2"
$olderThan = "2019-09-30"



$Url="https://etr56.sharepoint.com/sites/demigtest11-2"
\$olderThan = "2019-09-30"
```
Sample results