Thursday, January 19, 2017

Office 365 SharePoint Online Updating The Value Of Author Field Or Created By Field Using PowerShell Via CSOM 

Assume you have a SharePoint list/Document Library/Document Set or document  and you need to update Author/Editor or Created By and Modified values remotely using PowerShell via CSOM. I faced the similar situation and used PnP commands with CSOM to complete the task. I achieved this with the help of Kirk Liemohn article https://goo.gl/zUE8Jt making some changes. Thanks Kirk 



    

Friday, October 16, 2015

PowerShell To Get Document Libraries Information

Export Sorted CheckedOut Files Using PowerShell

Sometimes in SharePoint When we need to get all the documents from SharePoint Libraries including all the sites and subsides, its resource intensive job specially in big environments with huge list contents and documents. But we can achieve or get these type of information using PowerShell and can schedule script execution at time when minimum load is on the servers. Following script will get all the checkedout files with version and export into CSV with heading sorted as required.


$url = "http://portal.contoso.com"
$site = New-Object Microsoft.SharePoint.SPSite($url)
$web = $site.OpenWeb()


function GetCheckedOutFiles($web)

{
Write-Host "Started Processing Web: $($web.Url)"
        foreach ($list in ($web.Lists | ? {$_ -is [Microsoft.SharePoint.SPDocumentLibrary]})) {
            
            Write-Host "Started Processing List: $($list.RootFolder.ServerRelativeUrl)"
                                
            foreach ($item in $list.Items) {
           
                $modifiedTime = $web.RegionalSettings.TimeZone
                if ($item.File.CheckOutStatus -ne "None") {
                    if (($list.CheckedOutFiles | where {$_.ListItemId -eq $item.ID}) -ne $null) { continue }
                    $data = @{
                        "Library" = $list.Title
                        "Folder Name"= $item.Url.Substring(0,$item.Url.LastIndexOf("/"))
                        "Title" = $item.File.Name
                        "Version" = $item["Version"]
                        "Created By"= $item.File.Author.Name                        
                        # Get Created Time date with local time zone
                        "Date Created"= $modifiedTime.UTCTolocalTime($item.File.TimeCreated)
                        "Modified By" = $item.File.ModifiedBy.Name                        
                        # Get Modified Time date with local time zone
                        "Date Modified" = $modifiedTime.UTCTolocalTime($item.File.TimelastModified)
                                                
                    }
                    New-Object PSObject -Property $data | Select "Library", "Folder Name", "Title", "Version", "Created By", "Date Created", "Modified By", "Date Modified”
                }
            }
        }
foreach($subWeb in $web.Webs)
{
GetCheckedOutFiles($subweb)
}
        $web.Dispose()
}



#GetCheckedOutFiles | Out-GridView

GetCheckedOutFiles($web) | Export-Csv -NoTypeInformation -Path D:\CheckedOutFiles.csv


Friday, January 28, 2011

Microsoft Exams Retiring On March 31, 2011

·         70-271: Supporting Users and Troubleshooting a Microsoft Windows XP Operating System
·         70-272: Supporting Users and Troubleshooting Desktop Applications on a Microsoft Windows XP Operating System
·         70-284: Implementing and Managing Microsoft Exchange Server 2003
·         70-285: Designing a Microsoft Exchange Server 2003 Organization
·         70-351: TS: Microsoft Internet Security and Acceleration Server 2006, Configuring
·         70-500: TS: Microsoft Windows Mobile 5.0, Implementing and Managing
·         70-510: TS: Visual Studio 2005 Team Foundation Server
·         70-540: TS: Microsoft Windows Mobile 5.0 – Application Development
·         70-543: TS: Visual Studio 2005 Tools for Office
·         70-557: TS: Microsoft Forefront Client and Server, Configuring
·         70-621: PRO: Upgrading Your MCDST Certification to MCITP Enterprise Support
·         70-631: TS: Microsoft Windows SharePoint Services 3.0, Configuring