Will be going through a migration shortly and I need to identify any file/pages that have a title/page name over 200 charcters long.

I don't have access to power shell so looking for any alternatives ??

  • You can do this remotely via Web Services and it is reasonably easy to do via PowerShell so it can be executed remotely and not on the server. (I only say this because most people say no PS because they can't run code on the server.) Failing that you could write a console app. Failing that you will need to buy a third party tool.
    – Bunzab
    Jun 2 '17 at 9:57
  • Thanks for the suggestion - didn't realise you could do it remotely - any suggestions or could you point me in the dorection of this option.
    – Webezine
    Jun 2 '17 at 13:46

This is a pretty basic script but should get you started. Comments in line but feel free to ask any questions:

#Specify creds or use current creds
#$password = Read-Host -Prompt "Password:" -AsSecureString
#$creds = New-Object System.Management.Automation.PSCredential ("domain\user", $password)
#$ws = New-WebServiceProxy -uri "http://sharepoinurl.com/_vti_bin/lists.asmx?WSDL" -Credential $creds
#use Windows creds
$ws = New-WebServiceProxy -uri "http://sharepoint-test.com/sites/a-site/_vti_bin/lists.asmx?WSDL" -UseDefaultCredential
#Get a list
$listGuid = $ws.GetList("Documents")
#Build your query
$xml = New-Object System.Xml.XmlDocument
$query = $xml.CreateElement("Query")
#if you need a CAML query add it here:
#$query.InnerXML ="
#   <Where>
#       <Eq>
#           <FieldRef Name='ContentType' />
#           <Value Type='Text'>Document</Value>
#       </Eq>
#   </Where>"
$viewFields = $xml.CreateElement("ViewFields")
$queryOptions = $xml.CreateElement("QueryOptions")
#modify scope if required (this will recurse folders)
$queryOptions.InnerXml = "<ViewAttributes Scope='RecursiveAll' IncludeRootFolder='False' />"
#Row limit. For large lists you will want to do this recursively. I would normally use a rowlimit of about 2k but test your own.
$rows = 10
try {
    #call get items WS here
    $items = $ws.GetListItems($listGuid.name, $null, $query, $viewFields, $rows, $queryOptions, $null)
catch {
    $ex = $_.Exception
    $detail = $ex.InnerException.Detail.Errorstring | select '#text'
    Write-Host $detail
foreach ($i in $items.data.row) {
    #This is the filename. You could export it to csv or whatever.
    $i.ows_LinkFilename + "`t" + $i.ows_LinkFilename.Length
  • As OP said: "I don't have access to power shell so looking for any alternatives ??". Edit: well that might be something which can be edited out, assuming it was a misunderstanding you were able to clarify on the comments above.
    – moe
    Jun 2 '17 at 15:07
  • Yeah, this will work remotely from any machine assuming PS is installed...
    – Bunzab
    Jun 2 '17 at 15:28
  • Never really used powershell before so struggling but will give it sometime tonight
    – Webezine
    Jun 5 '17 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.