Skip to main content

You can use the following code:

function CheckInDocument([string]$url)
{
    $spWeb = Get-SPWeb $url
    $getFolder = $spWeb.GetFolder("Shared Documents")
    $getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
    {
        Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
        $_.CheckIn("Checked In By Administrator")
        Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
    }
    $spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

OR you can Try :

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
 $list = $spWeb.Lists |? {$_.Title -eq $listName}
  foreach ($item in $list.Items) 
  {
    $itemFile = $item.File
    if( $itemFile.CheckOutStatus -ne "None" )
    { 
        $itemFile.CheckIn("Automatic CheckIn. (Administrator)")
  }
  }
}
$spWeb.Dispose()

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder("Shared Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
{
Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn("Checked In By Administrator")
Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
}
$spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

OR you can Try :

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
 $list = $spWeb.Lists |? {$_.Title -eq $listName}
  foreach ($item in $list.Items) 
  {
  $itemFile = $item.File
  if( $itemFile.CheckOutStatus -ne "None" )
  { 
      $itemFile.CheckIn("Automatic CheckIn. (Administrator)")
  }
  }
$spWeb.Dispose()

You can use the following code:

function CheckInDocument([string]$url)
{
    $spWeb = Get-SPWeb $url
    $getFolder = $spWeb.GetFolder("Shared Documents")
    $getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
    {
        Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
        $_.CheckIn("Checked In By Administrator")
        Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
    }
    $spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

OR you can Try :

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
$list = $spWeb.Lists |? {$_.Title -eq $listName}
foreach ($item in $list.Items) 
{
    $itemFile = $item.File
    if( $itemFile.CheckOutStatus -ne "None" )
    { 
        $itemFile.CheckIn("Automatic CheckIn. (Administrator)")
    }
}
$spWeb.Dispose()
added 393 characters in body
Source Link
Aanchal
  • 7.9k
  • 1
  • 17
  • 20

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder("Shared Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
{
Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn("Checked In By Administrator")
Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
}
$spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

OR you can Try :

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
 $list = $spWeb.Lists |? {$_.Title -eq $listName}
  foreach ($item in $list.Items) 
  {
  $itemFile = $item.File
  if( $itemFile.CheckOutStatus -ne "None" )
  { 
      $itemFile.CheckIn("Automatic CheckIn. (Administrator)")
  }
  }
$spWeb.Dispose()

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder("Shared Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
{
Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn("Checked In By Administrator")
Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
}
$spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder("Shared Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
{
Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn("Checked In By Administrator")
Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
}
$spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP

OR you can Try :

$spWeb = Get-SPWeb http://prinhyltphp0317/
$listName = "text"
 $list = $spWeb.Lists |? {$_.Title -eq $listName}
  foreach ($item in $list.Items) 
  {
  $itemFile = $item.File
  if( $itemFile.CheckOutStatus -ne "None" )
  { 
      $itemFile.CheckIn("Automatic CheckIn. (Administrator)")
  }
  }
$spWeb.Dispose()
Fixed markup and wrong ""
Source Link
Robert Lindgren
  • 24.5k
  • 12
  • 55
  • 79

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder(“Shared"Shared Documents”Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne “None”"None" } | ForEach
{
Write-Host “$"$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn(“Checked"Checked In By Administrator”Administrator")
Write-Host “$"$($_.Name) Checked In”In" -ForeGroundColor Green
}
$spWeb.Dispose()
}
 
Here’s an example on running the function:

Here’s an example on running the function:

CheckInDocument http://SP

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder(“Shared Documents”)
$getFolder.Files | Where { $_.CheckOutStatus -ne “None” } | ForEach
{
Write-Host “$($_.Name) is Checked out To: $($_.CheckedOutBy)
$_.CheckIn(“Checked In By Administrator”)
Write-Host “$($_.Name) Checked In” -ForeGroundColor Green
}
$spWeb.Dispose()
}
 
Here’s an example on running the function:

CheckInDocument http://SP

You can use the following code:

function CheckInDocument([string]$url)
{
$spWeb = Get-SPWeb $url
$getFolder = $spWeb.GetFolder("Shared Documents")
$getFolder.Files | Where { $_.CheckOutStatus -ne "None" } | ForEach
{
Write-Host "$($_.Name) is Checked out To: $($_.CheckedOutBy)"
$_.CheckIn("Checked In By Administrator")
Write-Host "$($_.Name) Checked In" -ForeGroundColor Green
}
$spWeb.Dispose()
}

Here’s an example on running the function:

CheckInDocument http://SP
Source Link
Aanchal
  • 7.9k
  • 1
  • 17
  • 20
Loading