<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SharePoint World</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/harmeetw/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/harmeetw/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 21 Jul 2017 16:04:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>PowerShell: Download Documents/Files from SharePoint OnPrem</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/powershell-download-documentsfiles-from-sharepoint-onprem</link>
      <pubDate>Fri, 21 Jul 2017 16:01:21 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/?p=335</guid>
      <description><![CDATA[$Spsite = get-spsite https://contoso.com #Replace this with Site Collection URL

$Location =...]]></description>
      <content:encoded><![CDATA[<img src="https://msdnshared.blob.core.windows.net/media/2017/07/f5bca33f-324b-4689-88c7-bab4cc6d3813.png" />
<div style="color: #000000">
<pre>$Spsite = get-spsite http:<span style="color: #008000">//contoso.com #Replace this with Site Collection URL

$Location = "C:\destination" #Replace with Folder on file level system where you want to download the files and folders

$AllWebs = $SpSite.AllWebs


function DownloadFiles ($SiteFolder , $Web , $List)
{
    $Web = Get-Spweb $Web
    $list = $web.Lists.GetList($list,$true)
    $items = $list.Items
        foreach($item in $items)
        {

        $FileBinary = $item.File.OpenBinary()
        $FileStream = New-Object System.IO.FileStream($SiteFolder + "/" + $item.url), Create
        $FileWriter = New-Object System.IO.BinaryWriter($FileStream)
        $FileWriter.write($FileBinary)
        $FileWriter.Close()

        }


}


function CreateSiteListFolder($Folder,$Web)
{
$SiteFolder = $Folder
$Web = Get-spweb $Web
$Lists = $Web.Lists|where{$_.BaseType -eq "DocumentLibrary" -and $_.Hidden -eq $false}


    foreach($List in $Lists)
    {

        $ListUrl = $list.RootFolder.ServerRelativeUrl
        $ListUrl = $ListUrl.Split("/")
        $ListUrl = $ListUrl[$ListUrl.Count -1]
        $ListUrl = $ListUrl.ToString()
        $CreateListRootFolder = $SiteFolder + "/" + $ListUrl
        $CreateListFolder = New-Item -Path $CreateListRootFolder -type directory -ErrorAction SilentlyContinue

        $ListFolders = $List.Folders
        foreach($ListFolder in $ListFolders)
        {
            $CreateListFolder = $SiteFolder + "/" + $ListFolder.Url
            $CreateLFolder = New-Item -Path $CreateListFolder -type directory -ErrorAction SilentlyContinue
        }

        DownloadFiles $SiteFolder $Web.url $list.id

    }

}


function Sitecreatefolder($AllWebs)
{


    foreach($Web in $AllWebs)
    {
        if($web.IsRootWeb)
        {
        $RootFolder = $Location + "\" + $web.title
        $CreateRootFolder = New-Item -Path $RootFolder -type directory -ErrorAction SilentlyContinue
        CreateSiteListFolder $RootFolder $Web.url

    
        }
        else
        {
        $Folder = $Web.Url.ToString() 
        $Folder = $Folder.Replace($Spsite.RootWeb.Url,$RootFolder)
        $CreateSiteFolder = New-Item -Path $Folder -type directory -ErrorAction SilentlyContinue
        CreateSiteListFolder $Folder $Web.url
        }

    }


}


Sitecreatefolder $AllWebs</span>

</pre>
</div>]]></content:encoded>
    </item>
    <item>
      <title>OneDrive–Check for Long File names</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/onedrive-check-for-long-file-names</link>
      <pubDate>Wed, 29 Mar 2017 18:02:15 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/?p=315</guid>
      <description><![CDATA[Following script will check for Long File Names,Folders and File+Folders. Any location which...]]></description>
      <content:encoded><![CDATA[<p>Following script will check for Long File Names,Folders and File+Folders. Any location which contains more then (249 – User OneDrive Folder Length) will be reported, This outout is stored in a Share with UserName_ComputerName Format. THis can be run as Scheduled tasks</p> <p>&nbsp;</p> <p>$OneDriveLocationLength =&nbsp; $Env:OneDrive.Length<br>$LengthToCheck = 249 - $OneDriveLocationLength<br>$SyncFile = "\\<font style="background-color: #ffff00">NetworkShare</font>\OneDriveSyncissues\" + $Env:USERNAME + "-" + $Env:COMPUTERNAME + ".csv" <font style="background-color: #ffff00">#Replace with Network Share<br></font>$Columns = "Name" + ";" + "Type" + ";" + "IsFolderLengthLong" + ";" + "IsFileLengthLong" + ";" + "IsFolderFileLengthLong" + ";" + "Length"<br>$columns | out-file -filepath $SyncFile -append<br>$PathExclusion = @("Windows";"Program Files")<font style="background-color: #ffff00"> # Add/Remove folders that you will like to exclude from Scan</font><br>$Drives = @("C:\" ; "D:\") <font style="background-color: #ffff00">#Add/Remove Drives from Scran</font><br>$FoldersToCheck = @()<br>foreach($Drive in $Drives)</p> <p>{</p> <p>&nbsp;&nbsp;&nbsp; $Folders = Get-ChildItem&nbsp; $Drive | Where-Object {($_.PSIscontainer -eq $true) }<br>&nbsp;&nbsp;&nbsp; foreach ($Folder in $Folders)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $i=0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Exclude = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Count = $PathExclusion.Count<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while($i -le $Count)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Folder.name -eq $PathExclusion[$i])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Exclude = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $i++<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Exclude -eq 1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $FoldersToCheck += $folder.FullName<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>}</p> <p>&nbsp;</p> <p>function FileLength ($FileLengthDir)<br>{</p> <p>$FilesForLength = @()<br>$FilesForLength&nbsp; = Get-ChildItem&nbsp; $FolderToCheck -Recurse -ErrorAction silentlycontinue | Where-Object {($_.PSIscontainer -eq $false) }</p> <p><br>&nbsp;&nbsp;&nbsp; foreach($FileForLength in $FilesForLength)<br>&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($FileForLength -eq $null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($FileForLength.name.length -ge $LengthToCheck)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output = $FileForLength.Fullname + ";" + "File" + ";" + "" + ";" + "Yes" + ";" + "" + ";" + $FileForLength.name.length<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output | out-file -filepath $SyncFile -append<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($FileForLength.Fullname.length -ge $LengthToCheck) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output = $FileForLength.Fullname + ";" + "FolderFile" + ";" + "" + ";" + "" + ";" + "Yes" + ";" + $FileForLength.Fullname.length<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output | out-file -filepath $SyncFile -append<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; }</p> <p>}</p> <p><br>function FolderLength ($FolderToCheck)<br>{<br>$FoldersForLength = @()<br>$FoldersForLength&nbsp; += Get-Item&nbsp; $FolderToCheck -ErrorAction silentlycontinue | Where-Object {($_.PSIscontainer -eq $true) }<br>$FoldersForLength&nbsp; += Get-ChildItem&nbsp; $FolderToCheck -Recurse -ErrorAction silentlycontinue | Where-Object {($_.PSIscontainer -eq $true) }</p> <p><br>&nbsp;&nbsp;&nbsp; foreach($FolderForLength in $FoldersForLength)<br>&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($FolderForLength.fullname.length -ge $LengthToCheck)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output = $FolderForLength.fullname + ";" + "Folder" + ";" + "Yes" + ";" + "" + ";" + "" + ";" + $FolderForLength.fullname.length<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Output | out-file -filepath $SyncFile -append&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($FolderForLength -eq $null)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FileLength ($FolderForLength.fullname) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; }</p> <p>}</p> <p>foreach ($FolderToCheck in $FoldersToCheck)<br>{<br>FolderLength $FolderToCheck</p> <p>}</p>]]></content:encoded>
    </item>
    <item>
      <title>Replace Invalid/Illegal/UnSupport Characters in OneDrive for Business</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/replace-invalidillegalunsupport-characters-in-onedrive-for-business</link>
      <pubDate>Wed, 29 Mar 2017 17:50:58 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/?p=306</guid>
      <description><![CDATA[&nbsp; Following Script can be set as a Scheduled task on End User Computers. This script will check...]]></description>
      <content:encoded><![CDATA[<p><font size="4"></font>&nbsp;</p> <p><font size="4">Following Script can be set as a Scheduled task on End User Computers. This script will check for Invalid File Names inside OneDrive(<font style="background-color: #ffff00">[!&amp;{}~#%]</font>) and Rename them. It also stores the Mapping file containing Old name and new name in End User OneDrive(OneDrive Mapping File.csv). Mapping file is appended and not recreated.</font></p> <p><font size="4"></font>&nbsp;</p> <p><font size="4"></font>&nbsp;</p> <p><br><font size="4">$OneDriveLocation =&nbsp; $Env:OneDrive <br>$SyncFile = $OneDriveLocation + "\OneDrive Mapping File.csv"</font></p> <p><font size="4">function CheckSyncFile()<br>{<br>&nbsp;&nbsp;&nbsp; $GetSyncFile = Get-ChildItem $SyncFile -ErrorAction silentlycontinue<br>&nbsp;&nbsp;&nbsp; if($GetSyncFile -eq $null)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; $Columns = "Orignal File Name " + ";" + "Updated File Name" + ";" + "Date"<br>&nbsp;&nbsp;&nbsp; $columns | out-file -filepath $SyncFile -append<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; }</font></p> <p><font size="4">}</font></p> <p><font size="4">function RenameFile($RenameFileTo)<br>{<br>$OrignalFile = $Item.FullName<br>Rename-Item $item.FullName -NewName ($RenameFileTo)<br>$ChangeTime = Get-Date -Format "MM-dd-yyyy_hh-mm-ss"</font></p> <p><font size="4">$output = $OrignalFile + ";" + $item.Directory.FullName.ToString() + "\" + $RenameFileTo + "," + $ChangeTime<br>$output | out-file -filepath $SyncFile -append</font></p> <p><font size="4">}</font></p> <p><font size="4">function FindDuplicate ($NewFileName)</font></p> <p><font size="4">{</font></p> <p><font size="4">$TestFile = $item.Directory.FullName + "\" + $newFileName<br>$CheckDup = Get-ChildItem $TestFile -ErrorAction silentlycontinue<br>&nbsp;&nbsp;&nbsp; if($CheckDup -eq $null)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; $RenameFileTo = $NewFileName<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; $logTime = Get-Date -displayhint time<br>&nbsp;&nbsp;&nbsp; $logTime = $logTime.Minute.ToString()&nbsp; + $logTime.Second.ToString()<br>&nbsp;&nbsp;&nbsp; $SplitExtension = $NewFileName.Split(".") <br>&nbsp;&nbsp;&nbsp; $FileName = $SplitExtension[0].ToString() + $logTime<br>&nbsp;&nbsp;&nbsp; $RenameFileTo = ($NewFileName -replace $SplitExtension[0], $FileName)<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; RenameFile $RenameFileTo </font></p> <p><font size="4">}</font></p> <p><font size="4">function CheckFileNames ($item)<br>{</font></p> <p><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Item.Name -match $UnsupportedChars)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $newFileName = $item.Name<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "&amp;") { $NewFileName = ($NewFileName -replace "&amp;", "and") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "{") { $NewFileName = ($NewFileName -replace "{", "(") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "}") { $NewFileName = ($NewFileName -replace "}", ")") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "~") { $NewFileName = ($NewFileName -replace "~", "-") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "#") { $NewFileName = ($NewFileName -replace "#", "-") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "%") { $NewFileName = ($NewFileName -replace "%", "-") } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($Item.Name -match "!") { $NewFileName = ($NewFileName -replace "!", "-") } <br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($NewFileName -ne $item.Name)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FindDuplicate $NewFileName<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></p> <p><font size="4">}</font></p> <p><font size="4"></font>&nbsp;</p> <p><font size="4"></font>&nbsp;</p> <p><font size="4">CheckSyncFile</font></p> <p><font size="4">$Items = Get-ChildItem $OneDriveLocation -Recurse -Exclude "OneDrive Mapping File.csv"<br>$UnsupportedChars = '[!&amp;{}~#%]'</font></p> <p><font size="4">&nbsp;&nbsp;&nbsp; foreach ($item in $items)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; CheckFileNames $item<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></p> <p><font size="4"></font>&nbsp;</p> <p><font size="4">Credit </font><a title="https://gallery.technet.microsoft.com/office/Check-for-unsupported-6676929a" href="https://gallery.technet.microsoft.com/office/Check-for-unsupported-6676929a"><font size="4">https://gallery.technet.microsoft.com/office/Check-for-unsupported-6676929a</font></a></p> <p><font size="4"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Replacing Everyone/Everyone except external users account with a different User/Group</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/replacing-everyoneeveryone-except-external-users-account-with-a-different-usergroup</link>
      <pubDate>Wed, 14 Dec 2016 14:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/?p=265</guid>
      <description><![CDATA[Technorati Tags: Migrate User in SPO,Replace Everyone in SPO,Replace Everyone except external users...]]></description>
      <content:encoded><![CDATA[<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0d2ae2dd-c50e-4b0b-8f43-8af673cec3b7" class="wlWriterEditableSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px">Technorati Tags: <a href="https://technorati.com/tags/Migrate+User+in+SPO" rel="tag">Migrate User in SPO</a>,<a href="https://technorati.com/tags/Replace+Everyone+in+SPO" rel="tag">Replace Everyone in SPO</a>,<a href="https://technorati.com/tags/Replace+Everyone+except+external+users+in+SPO" rel="tag">Replace Everyone except external users in SPO</a>,<a href="https://technorati.com/tags/SPO" rel="tag">SPO</a>,<a href="https://technorati.com/tags/O365" rel="tag">O365</a>,<a href="https://technorati.com/tags/SharePoint+Online" rel="tag">SharePoint Online</a></div> <p><font size="4"></font>&nbsp;</p> <p><font size="4"></font>&nbsp;</p> <p><font size="4">Recently I had couple of customers asking me for a script where they can replace <font style="background-color: #ffff00">Everyone/Everyone except external users</font> account in SPO with a different account/group.</font>  <p><font size="4">Following script will copy permissions of an account to a new account.</font>  <ol> <li><font size="4">It will check for SharePoint Group membership</font>  <li><font size="4">It will check for SPWeb unique membership</font>  <li><font size="4">It will check for SPList unique membership</font>  <li><font size="4">It will check for SPFolder unique membership</font>  <li><font size="4">It will check for SPItem unique membership</font>  <li></li></ol> <p><font size="4">After this script you can remove or even disable Everyone from showing in people picker. </font> <p><font size="4"></font>&nbsp; <p><font size="4">Let me know your suggestions in comments. I will try to add your suggestions to my script. </font> <hr>  <p><font size="3">[System.Reflection.Assembly]::LoadFile("C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll") | Out-Null </font> <p><font size="3">[System.Reflection.Assembly]::LoadFile("C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.Runtime.dll") | Out-Null </font> <p><font size="3">$username = "</font><a><font size="3">admin@MOD841120.onmicrosoft.com</font></a><font size="3">" <font style="background-color: #ffff00">#Replace this with SPO Admin </font></font> <p><font size="3">$password = "password" <font style="background-color: #ffff00">#Replace this with SPO Admin password </font></font> <p><font size="3">$password = ConvertTo-SecureString $password -AsPlainText -Force </font> <p><font size="3">$spoCred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $Password) </font> <p><font size="3">$url = "</font><a href="https://mod841120.sharepoint.com/sites/DemoPerm"><font size="3">https://mod841120.sharepoint.com/sites/DemoPerm</font></a><font size="3">" <font style="background-color: #ffff00">#URL of the SPO Site Collection </font></font> <p><font size="3">$FindUser = "c:0-.f|rolemanager|spo-grid-all-users/c1051fd0-af79-4b55-8710-a34798fbe37b" <font style="background-color: #ffff00">#User Id for External Users </font></font> <p><font size="3">$New = "</font><a><font size="3">industrytrends@MOD841120.onmicrosoft.com</font></a><font size="3">" <font style="background-color: #ffff00">#Group/User that you want to add </font></font> <p><font style="background-color: #ffff00" size="3"></font>&nbsp; <p><font style="background-color: #ffff00" size="3"></font>&nbsp; <p><font style="background-color: #ffff00" size="3">#No changes required from this point</font>  <p><font size="3">$global:AllWebs = @() </font> <p><font size="3">Function Invoke-LoadMethod() { </font> <p><font size="3">param( </font> <p><font size="3">&nbsp;&nbsp; [Microsoft.SharePoint.Client.ClientObject]$Object = $(throw "Please provide a Client Object"), </font> <p><font size="3">&nbsp;&nbsp; [string]$PropertyName </font> <p><font size="3">) </font> <p><font size="3">&nbsp;&nbsp; $ctx = $Object.Context </font> <p><font size="3">&nbsp;&nbsp; $load = [Microsoft.SharePoint.Client.ClientContext].GetMethod("Load") </font> <p><font size="3">&nbsp;&nbsp; $type = $Object.GetType() </font> <p><font size="3">&nbsp;&nbsp; $clientLoad = $load.MakeGenericMethod($type) </font> <p><font size="3">&nbsp;&nbsp; $Parameter = [System.Linq.Expressions.Expression]::Parameter(($type), $type.Name) </font> <p><font size="3">&nbsp;&nbsp; $Expression = [System.Linq.Expressions.Expression]::Lambda( </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [System.Linq.Expressions.Expression]::Convert( </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [System.Linq.Expressions.Expression]::PropertyOrField($Parameter,$PropertyName), </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [System.Object] </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ), </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $($Parameter) </font> <p><font size="3">&nbsp;&nbsp; ) </font> <p><font size="3">&nbsp;&nbsp; $ExpressionArray = [System.Array]::CreateInstance($Expression.GetType(), 1) </font> <p><font size="3">&nbsp;&nbsp; $ExpressionArray.SetValue($Expression, 0) </font> <p><font size="3">&nbsp;&nbsp; $clientLoad.Invoke($ctx,@($Object,$ExpressionArray)) </font> <p><font size="3">} </font> <p><font size="3">function CheckGroup($SPOWeb , $UserID) </font> <p><font size="3">{ </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $User = $SPOWeb.EnsureUser($New) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $Context.Load($User) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $Context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $Groups = $SPOWeb.SiteGroups </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.Load($Groups) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; foreach($Group in $Groups) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($Group) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GroupUser = $Group.Users.GetById($UserID) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($GroupUser) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.Load($Group) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.Load($Group.Users.AddUser($User)) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Catch </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">} </font> <p><font size="3">function Get-SPOWebs(){ </font> <p><font size="3">param( </font> <p><font size="3">&nbsp;&nbsp; $Url = $(throw "Please provide a Site Collection Url"), </font> <p><font size="3">&nbsp;&nbsp; $Credential = $(throw "Please provide a Credentials") </font> <p><font size="3">) </font> <p><font size="3">&nbsp; $context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)&nbsp; </font> <p><font size="3">&nbsp; $context.Credentials = $spoCred </font> <p><font size="3">&nbsp; $web = $context.Web </font> <p><font size="3">&nbsp; $context.Load($web) </font> <p><font size="3">&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp; $User = $web.SiteUsers.GetByLoginName($FindUser) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($User) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CheckGroup $Web $User.ID </font> <p><font size="3">&nbsp; $context.Load($web.webs) </font> <p><font size="3">&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp; foreach($web in $web.Webs) </font> <p><font size="3">&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get-SPOWebs -Url $web.Url -Credential $Credential </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $global:AllWebs += $web.url </font> <p><font size="3">&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Catch </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">} </font> <p><font size="3">$global:AllWebs += $url </font> <p><font size="3">Get-SPOWebs -Url $Url -Credential $spoCred </font> <p><font size="3">function ReplaceUserInWeb($SPOW , $SPOWBinding) </font> <p><font size="3">{ </font> <p><font size="3">$User = $SPOW.EnsureUser($New) </font> <p><font size="3">$Context.Load($User) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$Perm = $SPOw.RoleDefinitions.GetByName($SPOWBinding) </font> <p><font size="3">$Context.Load($Perm) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$Roleassignment = New-Object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection($Context) </font> <p><font size="3">$Roleassignment.Add($Perm) </font> <p><font size="3">$Context.Load($SPOW.RoleAssignments.Add($User,$Roleassignment)) </font> <p><font size="3">$SPOW.update() </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">} </font> <p><font size="3">function ReplaceUserInList($SPOW , $SPOLBinding , $SPOListID) </font> <p><font size="3">{ </font> <p><font size="3">$User = $SPOW.EnsureUser($New) </font> <p><font size="3">$Context.Load($User) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$List = $SPOW.Lists.GetById($SPOListID) </font> <p><font size="3">$context.Load($List) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$Perm = $SPOw.RoleDefinitions.GetByName($SPOLBinding) </font> <p><font size="3">$Context.Load($Perm) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$Roleassignment = New-Object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection($Context) </font> <p><font size="3">$Roleassignment.Add($Perm) </font> <p><font size="3">$Context.Load($List.RoleAssignments.Add($User,$Roleassignment)) </font> <p><font size="3">$List.update() </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">} </font> <p><font size="3">function ReplaceUserInListItem($SPOW , $SPOLBinding, $ListID,$ItemID) </font> <p><font size="3">{ </font> <p><font size="3">$User = $SPOW.EnsureUser($New) </font> <p><font size="3">$Context.Load($User) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$List = $SPOW.Lists.GetById($ListID) </font> <p><font size="3">$context.Load($List) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$ListItem = $List.GetItemById($ItemID) </font> <p><font size="3">$context.Load($ListItem) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$Perm = $SPOw.RoleDefinitions.GetByName($SPOLBinding) </font> <p><font size="3">$Context.Load($Perm) </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">$Roleassignment = New-Object Microsoft.SharePoint.Client.RoleDefinitionBindingCollection($Context) </font> <p><font size="3">$Roleassignment.Add($Perm) </font> <p><font size="3">$Context.Load($ListItem.RoleAssignments.Add($User,$Roleassignment)) </font> <p><font size="3">$ListItem.update() </font> <p><font size="3">$Context.ExecuteQuery() </font> <p><font size="3">} </font> <p><font size="3">function GetListItemsRoleBinding($SPOW , $UserID , $ListID,$ItemID) </font> <p><font size="3">{ </font> <p><font size="3">$LIBindings = @() </font> <p><font size="3">$List = $SPOW.Lists.GetById($ListID) </font> <p><font size="3">$context.Load($List) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$ListItem = $List.GetItemById($ItemID) </font> <p><font size="3">$context.Load($ListItem) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$SPOLIRole = $ListItem.RoleAssignments.GetByPrincipalId($UserID) </font> <p><font size="3">$context.Load($SPOLIRole) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$LIRoleBindings = $SPOLIRole.RoleDefinitionBindings </font> <p><font size="3">$context.Load($LIRoleBindings) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; foreach($LIRoleBinding in $LIRoleBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.load($LIRoleBinding) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($LIRoleBinding.Name -eq "Limited Access") </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LIBindings += $LIRoleBinding.Name </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; return $LIBindings </font> <p><font size="3">} </font> <p><font size="3">function GetListRoleBinding($SPOW , $UserID , $ListID) </font> <p><font size="3">{ </font> <p><font size="3">$LBindings = @() </font> <p><font size="3">$List = $SPOW.Lists.GetById($ListID) </font> <p><font size="3">$context.Load($List) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$SPOLRole = $List.RoleAssignments.GetByPrincipalId($UserID) </font> <p><font size="3">$context.Load($SPOLRole) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$LRoleBindings = $SPOLRole.RoleDefinitionBindings </font> <p><font size="3">$context.Load($LRoleBindings) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; foreach($LRoleBinding in $LRoleBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.load($LRoleBinding) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($LRoleBinding.Name -eq "Limited Access") </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LBindings += $LRoleBinding.Name </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $LBindings.count </font> <p><font size="3">&nbsp;&nbsp;&nbsp; return $LBindings </font> <p><font size="3">} </font> <p><font size="3">function GetWebRoleBinding($SPOW , $UserID ) </font> <p><font size="3">{ </font> <p><font size="3">$Bindings = @() </font> <p><font size="3">$SPOWRole = $SPOW.RoleAssignments.GetByPrincipalId($UserID) </font> <p><font size="3">$context.Load($SPOWRole) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$RoleBindings = $SPOWRole.RoleDefinitionBindings </font> <p><font size="3">$context.Load($RoleBindings) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; foreach($RoleBinding in $RoleBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.load($RoleBinding) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($RoleBinding.Name -eq "Limited Access") </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Bindings += $RoleBinding.Name </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; return $Bindings </font> <p><font size="3">} </font> <p><font size="3">foreach($Web in $AllWebs) </font> <p><font size="3">{ </font> <p><font size="3">$context = New-Object Microsoft.SharePoint.Client.ClientContext($web)&nbsp; </font> <p><font size="3">$context.Credentials = $spoCred </font> <p><font size="3">$SPOWeb = $context.Web </font> <p><font size="3">$context.Load($SPOWeb) </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">Invoke-LoadMethod -Object $SPOWeb -PropertyName "HasUniqueRoleAssignments" </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">$SPOWebUser = $spoweb.SiteUsers.GetByLoginName($FindUser) </font> <p><font size="3">$context.Load($SPOWebUser) </font> <p><font size="3">try{ </font> <p><font size="3">$context.ExecuteQuery() </font> <p><font size="3">} </font> <p><font size="3">catch </font> <p><font size="3">{ </font> <p><font size="3">write-host "User does not Exist in the site collection" </font> <p><font size="3">} </font> <p><font size="3">&nbsp;&nbsp;&nbsp; if ($SPOWeb.HasUniqueRoleAssignments -eq $true) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $SPOWebRoles = $SPOWeb.RoleAssignments.GetByPrincipalId($SPOWebUser.Id) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($SPOWebROles) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try{ </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GetWBindings = GetWebRoleBinding $SPOWeb $SPOWebUser.Id </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach ($GetWBinding in $GetWBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ReplaceUser = ReplaceUserInWeb $SPOWeb $GetWBinding </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp; else </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $Lists = $spoWeb.Lists </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $Context.Load($Lists) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp; foreach($List in $Lists) </font> <p><font size="3">&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.Load($List) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Invoke-LoadMethod -Object $List -PropertyName "HasUniqueRoleAssignments" </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (($List.HasUniqueRoleAssignments -eq $true) -and ($List.Hidden -eq $false)&nbsp; ) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ListRoles = $List.RoleAssignments.GetByPrincipalId($SPOWebUser.Id) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($ListROles) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GetLBindings = $null </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GetLBindings = GetListRoleBinding $SPOWeb $SPOWebUser.Id $List.id </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach ($GetLBinding in $GetLBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Type = $GetLBinding.GetType() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type.Name -eq "String") </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ReplaceLUser = ReplaceUserInList $SPOWeb $GetLBinding $List.ID </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $qry = [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ListItems = $List.GetItems($qry) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($ListItems) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($ListItem in $ListItems) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Context.Load($ListItem) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Invoke-LoadMethod -Object $ListItem -PropertyName "HasUniqueRoleAssignments" </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($ListItem.HasUniqueRoleAssignments -eq $true) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ListItemRoles = $ListItem.RoleAssignments.GetByPrincipalId($SPOWebUser.Id) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.Load($ListItemRoles) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $context.ExecuteQuery() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GetLIBindings = $null </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GetLIBindings = GetListItemsRoleBinding $SPOWeb $SPOWebUser.Id $List.id $ListItem.ID </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach ($GetLIBinding in $GetLIBindings) </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Type = $GetLIBinding.GetType() </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($Type.Name -eq "String") </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ReplaceLUser = ReplaceUserInListItem $SPOWeb $GetLIBinding $List.ID $ListItem.ID </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">&nbsp;&nbsp;&nbsp; } </font> <p><font size="3">} </font> <p><font size="3">$context.Dispose()</font></p> <p><font size="4"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013–Generating Unique Permissions Report</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/sharepoint-2013generating-unique-permissions-report</link>
      <pubDate>Thu, 21 May 2015 11:50:25 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2015/05/21/sharepoint-2013generating-unique-permissions-report/</guid>
      <description><![CDATA[&nbsp; There will be several instances when you will like to generate reports of all the unique...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <p>There will be several instances when you will like to generate reports of all the unique permissions that are present through out the site collection.</p> <p>I have written a script which will generate a CSV report with all the users and groups added on the Web, List, Item or Folder level</p> <p>Refer to the screenshot CSV report.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/image_77C3C3D1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/image_5F00_77C3C3D1.png"><img title="image" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;display:inline;padding-right:0px;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/image_thumb_59E53FD0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/image_5F00_thumb_5F00_59E53FD0.png" width="629" height="43" /></a></p> <blockquote> <p>This report </p>will contain 7 columns  <ol> <li>WebURL – Url of the Site  </li><li>List Default View URL – Default view of the List. If this is blank that means permission are broken at Web Level and the User-Group reported has been added at the web level. If this contains information then it means permissions have been broken at the list level and the user-group along with permission reported has been added at the List level.  </li><li>List Title – Title of the list. If this is blank that means permission are broken at Web Level and the User-Group reported has been added at the web level.If this contains information then it means permissions have been broken at the list level and the user-group along with permission reported has been added at the List level.  </li><li>Item URL – URL of the Item.If this is blank that means permission are broken at Web/list Level and the User-Group reported has been added at the web/list level. If this contains information then it means permissions have been broken at the Item level and the user-group along with permission reported has been added at the Item level.  </li><li>Name – Name of User or Group  </li><li>Type – If it’s a Domain Group, Domain User or SharePoint Group  </li><li>Permission – Permissions granted to the user or group. Note if the OOB permissions levels have been modified then this information might mislead. It’s not a good practice to modify OOB permission levels. </li></ol> <p>&nbsp;</p> <p> <hr />  <p> <p>Add-PSSnapin Microsoft.SharePoint.Powershell<br />$Url = &quot;<a href="https://contoso.com&quot;"><font style="background-color:#ffff00;">https://contoso.com</font>&quot;</a>&nbsp;<strong>#Replace URL with your site collection<br /></strong>$RootURL = $url.Split(&quot;/&quot;) <strong># Split function is required for Host based site collection</strong><br />$RootURL = $RootURL[0] + &quot;/&quot; + $RootURL[1] + &quot;/&quot; + $RootURL[2]</p> <p>$logTime = Get-Date -Format &quot;Mm-dd-yyyy_hh-mm-ss&quot;<br />$Columns = &quot;WebURL&quot; + &quot;;&quot; + &quot;List Default View URL&quot; + &quot;;&quot; + &quot;List Title&quot; + &quot;;&quot; + &quot;Item URL&quot; + &quot;;&quot; + &quot;Name&quot; + &quot;;&quot; + &quot;Type&quot; +&quot;;&quot;+&quot;Permission&quot; <br />$logFile = &quot;<font style="background-color:#ffff00;">C:\UniquePermissions</font>&quot; + $logtime + &quot;.csv&quot; <strong># Log Location<br /></strong>$columns | out-file -filepath $logfile -append</p> <p>$site=Get-SPSite $url </p> <p>$Webs = $site.AllWebs<br />foreach($web in $webs)<br />{</p> <p>&nbsp;&nbsp;&nbsp; if($web.HasUniqueRoleAssignments)</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $WebRoles = $Web.RoleAssignments<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($WebRole in $WebRoles)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $WebRoleBindings = $WebRole.RoleDefinitionBindings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($WebRoleBinding in $WebRoleBindings)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($webrole.Member.IsDomainGroup -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + &quot;;&quot; + &quot;;&quot; +&nbsp; &quot;;&quot; + $WebRole.member.Name + &quot;;&quot; + &quot;SharePoint Group&quot; + &quot;;&quot; + $WebRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($webrole.Member.IsDomainGroup)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + &quot;;&quot; + &quot;;&quot; +&nbsp; &quot;;&quot; + $WebRole.member.Name + &quot;;&quot; + &quot;Domain Group&quot; + &quot;;&quot; + $WebRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + &quot;;&quot; + &quot;;&quot; +&nbsp; &quot;;&quot; + $WebRole.member.UserLogin + &quot;;&quot; + &quot;Domain User&quot; + &quot;;&quot; + $WebRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; $lists = $web.Lists<br />&nbsp;&nbsp;&nbsp; foreach($list in $lists)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($list.HasUniqueRoleAssignments)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ListRoles = $list.RoleAssignments<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($listRole in $ListRoles)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ListRoleBindings = $listrole.RoleDefinitionBindings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($ListRoleBinding in $ListRoleBindings)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($listrole.Member.IsDomainGroup -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + &quot;;&quot; + $ListRole.Member.Name + &quot;;&quot; + &quot;SharePoint Group&quot; + &quot;;&quot; + $ListRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($listrole.Member.IsDomainGroup)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + &quot;;&quot; + $ListRole.Member.Name + &quot;;&quot; + &quot;Domain Group&quot; + &quot;;&quot; + $ListRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + &quot;;&quot; + $ListRole.Member.UserLogin + &quot;;&quot; + &quot;Domain User&quot; + &quot;;&quot; + $ListRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Uniqueitems = $list.GetItemsWithUniquePermissions()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($Uniqueitem in $Uniqueitems)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $item = $list.GetItemById($Uniqueitem.id)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $itemRoles = $item.RoleAssignments<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($itemRole in $itemroles)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $itemRoleBindings = $itemrole.RoleDefinitionBindings<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($itemrolebinding in $itemRoleBindings)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($itemrole.Member.IsDomainGroup -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + $rooturl+ &quot;/&quot; +$item.Url + &quot;;&quot; + $itemRole.Member.Name + &quot;;&quot; + &quot;SharePoint Group&quot; + &quot;;&quot; + $itemRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($itemrole.Member.IsDomainGroup)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + $rooturl+ &quot;/&quot; +$item.Url + &quot;;&quot; + $itemRole.Member.Name + &quot;;&quot; + &quot;Domain Group&quot; + &quot;;&quot; + $itemRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append </p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output = $web.url + &quot;;&quot; + $rooturl + $list.DefaultViewUrl + &quot;;&quot; + $list.Title +&nbsp; &quot;;&quot; + $rooturl+ &quot;/&quot; +$item.Url + &quot;;&quot; + $itemRole.Member.UserLogin + &quot;;&quot; + &quot;Domain User&quot; + &quot;;&quot; + $itemRoleBinding.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $output | out-file -filepath $logfile -append <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p><br />&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp; }</p> <p>&nbsp;&nbsp;&nbsp; $web.Dispose()<br /><br />}</p> <p>$site.Dispose()<br /></p> <p> <hr />   <p>This will not work for SharePoint 2007, I have written one for SharePoint 2007 too, if someone needs it then leave a comment and I will share it out.</p></p></p></p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Protecting SharePoint</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/protecting-sharepoint</link>
      <pubDate>Wed, 23 Jul 2014 07:04:54 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2014/07/23/protecting-sharepoint/</guid>
      <description><![CDATA[&nbsp; Lack of information prompted me to write this blog. SharePoint at an enterprise level is...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <p>Lack of information prompted me to write this blog. SharePoint at an enterprise level is being deployed to serve various needs. There are times when you want to utilize SharePoint to store confidential information , this is when you think of security. <p>There are few things that we can control and few things which we can&#39;t . For example I can give user a read permission and disable copy/paste but I can&#39;t stop user from memorizing the content, writing content on a piece of a paper or from taking a picture of his Monitor. <p>In this blog, I am going to talk about the things we can control. <ol> <li> <p><strong><u>Infrastructure</u></strong> - A solid infrastructure gets half the job done. Take&nbsp; a look at couple of Extranet designs</p></li></ol> <p><a href="https://technet.microsoft.com/en-us/library/cc263513(v=office.14).aspx">https://technet.microsoft.com/en-us/library/cc263513(v=office.14).aspx</a> <p>&nbsp; <ol start="2"> <li> <p><strong><u>Secure Login</u></strong> - The very first thing you want to implement is Secure Login. By default SharePoint is going to prompt for credentials if you are logging in to the portal from a computer which is not connected to corpnet. For environments which are going to use information which is going to be conferential in nature, I recommend implementing Two factor Authentication.</p></li></ol> <blockquote> <p><strong>Two Factor Authentication ?</strong></p></blockquote> <blockquote> <p>This is where user need to provide two pieces of ID to get authenticated. In a normal scenario User will provide&nbsp; user name and password and that is good enough for user to get access in to the portal. Adding another factor will make this a Two factor authentication. For Example, You can implement RSA in your environment. RSA does make login mechanism quite secure</p></blockquote> <ol start="3"> <li> <p><strong><u>Protection against download copies</u></strong>&nbsp; - All a user needs is a read access to download data and use it offline. Data downloaded then can&#39;t be monitored and can be send to anyone. You can implement IRM in order to protect data in such scenario.</p></li></ol> <blockquote> <p>IRM can be applied at the document level and also at a library level, best approach will be to apply IRM policy on the document before uploading it. <p>Once you have applied IRM to the document, only the user who have access to the document will be able to open the online/offline copy of the document. <p>OOB SharePoint protects Office documents, you will need to install protectors for other file types</p></p></p></blockquote> <p>&nbsp; <ol start="4"> <li> <p><strong><u>Scan the data</u></strong> - It is very important to know where the confidential/sensitive/PPI information is stored. Imagine a situation where some sensitive information is stored in a library which is not monitored aggressively or is not supposed to contain sensitive data .</p></li></ol> <blockquote> <p>Unfortunately there is no OOB way of scanning and reporting such content unless you create bunch of scripts to find it. <p>There are plenty of third party tools which do a good job in scanning the environment for patterns and then generating reports. I would recommend you to look for something which scans in a background and sends you a report as there will be lots of false positive. <p>This approach will help you in taking necessary actions and make sure data is stored in right places.</p></p></p></blockquote> <ol start="5"> <li> <p><strong><u>Abuse of Rights</u></strong> - This is where things gets interesting, how to protect data from the users who have access to it?</p></li></ol> <blockquote> <p>Honestly I have not found a way which protects you from this fully, main reason being they have access to edit the file. <p>Few things that you can do is to disable features such as copy/paste. IRM by default disables copy/paste for users with read access but not for users who have write access. There are third party tools available for doing this job along with scanning the data. <p>Please note, if you are storing content in excel then disabling copy/paste will be bit hard as that needs to be done through macros. <p>Another approach could be do develop a custom web part to show information and restrict the actions a user can take.</p></p></p></p></blockquote> <ol start="6"> <li> <p><strong><u>Auditing</u></strong> - You really need a detailed auditing, OOB SharePoint does a good job in auditing but you can always buy a third party product to get more detailed Auditing. Do not ignore Auditing.</p></li></ol> <p>I hope you find this information useful when planning a secure environment.</p></p></p></p></p></p></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 - You receive "Sorry, apps are turned off. If you know who runs the server, tell them to enable apps" when trying to add Apps on Host Header site collection</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/sharepoint-2013-you-receive-sorry-apps-are-turned-off-if-you-know-who-runs-the-server-tell-them-to-enable-apps-when-trying-to-add-apps-on-host-header-site-collection</link>
      <pubDate>Thu, 03 Jan 2013 07:17:39 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2013/01/03/sharepoint-2013-you-receive-sorry-apps-are-turned-off-if-you-know-who-runs-the-server-tell-them-to-enable-apps-when-trying-to-add-apps-on-host-header-site-collection/</guid>
      <description><![CDATA[&#160;  Issue  I recently worked on a case where customer was facing issue when trying to add Apps...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><b><u>Issue</u></b></p>  <p>I recently worked on a case where customer was facing issue when trying to add Apps on Host Header Site collection. He does not face any issues while trying to add apps on site collection created without host header mode.</p>  <p><b><u>Repro</u></b></p>  <p>Here are the steps to reproduce the issue, these steps can also help you in configuring HH mode site collection in case you were not sure on how to do it :) (These steps will also work on SharePoint 2007)</p>  <p>1. Create a New web application, In my case it is <a href="https://sps2013-a.com">https://sps2013-a.com</a></p>  <p>2. $Sub = New-SPSiteSubscription (This cmmdlet will help in generating new SPSite Subscription)</p>  <p>3. New-SPSite <a href="https://test1.walia.com:81">https://test.walia.com</a> -OwnerAlias walia\administrator -HostHeaderWebApplication <a href="https://sps2013-a:81">https://sps2013-a</a> -language 1033 -sitesubscription $sub</p>  <p>The above command will create a new Site collection in HH mode and assign a unique subscription ID(We generated this ID in Step 2)</p>  <p>4. new-spsite -url <a href="https://sps2013-a:81/sites/tadminsite">https://sps2013-a/sites/tadminsite</a> -template TENANTADMIN#0 -owneralias walia\administrator -AdministrationSiteType tenantadministration -language 1033 -sitesubscription $sub </p>  <p>(The above command will create a new Tenant Administration site and will tie the HH mode site collection to it,We assign it the same Subscription ID of the HH mode site)</p>  <p>5) Browse to the Site <a href="https://test1.walia.com">https://test1.walia.com</a></p>  <p>6) Click on Site Contents and try to add App from App Store</p>  <p>You will receive &quot;Sorry, apps are turned off. If you know who runs the server, tell them to enable apps&quot; </p>  <p><strong><u>Data Analysis</u></strong></p>  <p>Following message is logged in ULS logs</p>  <p>01/02/2013 15:42:10.29&#160;&#160;&#160;&#160;&#160;&#160;&#160; w3wp.exe (0x0A0C)&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0x03E0&#160;&#160;&#160;&#160;&#160;&#160;&#160; SharePoint Foundation&#160;&#160;&#160;&#160;&#160;&#160;&#160; App Deployment&#160;&#160;&#160;&#160;&#160;&#160;&#160; adysh&#160;&#160;&#160;&#160;&#160;&#160;&#160; High&#160;&#160;&#160;&#160;&#160;&#160;&#160; The site subscription name for site <a href="https://test.walia.com">https://test.walia.com</a> does not exist. <font style="background-color: #ffff00">The site subscription name must exist to complete this operation</font>.&#160;&#160;&#160;&#160;&#160;&#160;&#160; 19fdf09b-7152-3086-ee69-b85fa6faa86c</p>  <p><strong><u>Resolution</u></strong></p>  <p>1) Browse to Tenant Administration Site of the HH mode Site collection</p>  <p>2) Create App Catalog for Tenant by clicking on Manage App Catalog</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/2870.image_4B5F347C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/2870.image_5F00_4B5F347C.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/2870.image_thumb_02C545AB.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/2870.image_5F00_thumb_5F00_02C545AB.png" width="244" height="210" /></a></p>  <p>Note – Every Tenant Admin will require a App Catalog(Make sure Self site creation is enabled in order for App Catalog to get created)</p>  <p>3) $Sub = Get-SPSiteSubscription <a href="https://hhmodesite/">https://hhmodeSite</a> (This CMDlet will help in fetching the subscription ID of the HH mode site collection)</p>  <p>Set-SPAppSiteSubscriptionName -Name &quot;Name for Subscription&quot; -SiteSubscription $Sub</p>  <p>We need to run the above command in order to set the unique name for domain under which these apps will run.More details can be found under <a title="https://technet.microsoft.com/en-us/library/jj219503.aspx" href="https://technet.microsoft.com/en-us/library/jj219503.aspx">https://technet.microsoft.com/en-us/library/jj219503.aspx</a></p>  <p>&#160;</p>  <p>Feel free to post comments if you have any confusion regarding any of the steps.</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 -Configure Incoming emails with Exchange Server 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/sharepoint-2013-configure-incoming-emails-with-exchange-server-2013</link>
      <pubDate>Fri, 28 Dec 2012 14:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2012/12/28/sharepoint-2013-configure-incoming-emails-with-exchange-server-2013/</guid>
      <description><![CDATA[&nbsp;
This blog post is to help you in configure Incoming emails in SharePoint 2013 using Exchange...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>This blog post is to help you in configure Incoming emails in SharePoint 2013 using Exchange Server 2013</p>
<p><strong><span style="text-decoration: underline;">Setup</span></strong></p>
<p><strong>Domain Controller &ndash; Windows Server 2012</strong></p>
<p><strong>Exchange Server &ndash; Exchange Server 2013</strong></p>
<p><strong>SharePoint Server &ndash; SharePoint Server 2013</strong></p>
<p>Lets begin the process of setting up Incoming emails</p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Creating OU for Storing Email Alias</span></span></strong></p>
<ul>
<li>Log in to DC or any computer which have Active Directory administration tools installed.</li>
</ul>
<ul>
<li>Open "Active Directory users and Computers"</li>
</ul>
<ul>
<li>Right click on domain name and select New &gt; Organizational Unit</li>
</ul>
<ul>
<li>Provide some meaningful name and click on OK</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6153.clip_image001_2DBABA45.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6153.clip_5F00_image001_5F00_2DBABA45.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image001" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1777.clip_image001_thumb_379FABB0.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1777.clip_5F00_image001_5F00_thumb_5F00_379FABB0.png" alt="clip_image001" width="244" height="209" border="0" /></a></p>
<ul>
<li>Make sure the account which is running Timer Service on SharePoint Server has permissions to create and delete objects.</li>
</ul>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Add SMTP role to the SharePoint Server</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Browse to Server Manager and click on Manage &gt; Add roles and features</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/7450.clip_image002_2B318887.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/7450.clip_5F00_image002_5F00_2B318887.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6076.clip_image002_thumb_47EAFD9C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6076.clip_5F00_image002_5F00_thumb_5F00_47EAFD9C.png" alt="clip_image002" width="244" height="155" border="0" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Click on Next and choose "Select a server from the server pool" and click Next</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4478.clip_image003_66553E85.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4478.clip_5F00_image003_5F00_66553E85.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image003" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3005.clip_image003_thumb_7276B8AC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3005.clip_5F00_image003_5F00_thumb_5F00_7276B8AC.png" alt="clip_image003" width="244" height="174" border="0" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Click Next on the Roles screen</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6445.clip_image004_62F3A6DD.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6445.clip_5F00_image004_5F00_62F3A6DD.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4863.clip_image004_thumb_5A239E91.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4863.clip_5F00_image004_5F00_thumb_5F00_5A239E91.png" alt="clip_image004" width="244" height="174" border="0" /></a></p>
<ul>
<li>Select SMTP</li>
</ul>
<ul>
<li>Click on Add Features</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3480.clip_image005_788DDF7A.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3480.clip_5F00_image005_5F00_788DDF7A.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image005" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/2816.clip_image005_thumb_16F82064.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/2816.clip_5F00_image005_5F00_thumb_5F00_16F82064.png" alt="clip_image005" width="244" height="241" border="0" /></a></p>
<p>&nbsp;</p>
<ul>
<li>Click Next</li>
</ul>
<ul>
<li>Click Install</li>
</ul>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Create Send Connector</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Browse to Exchange console <a href="https://ExchangeServerName/ecp">https://ExchangeServerName/ecp</a>, in my case it will be <a href="https://exch/ecp">https://exch/ecp</a></li>
</ul>
<ul>
<li>Click on Mail Flow &gt; Send Connectors</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3718.clip_image006_3562614D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3718.clip_5F00_image006_5F00_3562614D.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6840.clip_image006_thumb_4183DB74.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6840.clip_5F00_image006_5F00_thumb_5F00_4183DB74.png" alt="clip_image006" width="244" height="128" border="0" /></a></p>
<ul>
<li>Click on New Send Connector Icon and give it meaningful name and chose Internal</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1643.clip_image007_19712C55.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1643.clip_5F00_image007_5F00_19712C55.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image007" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6014.clip_image007_thumb_37DB6D3E.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6014.clip_5F00_image007_5F00_thumb_5F00_37DB6D3E.png" alt="clip_image007" width="244" height="209" border="0" /></a></p>
<ul>
<li>Choose "Route mail through smart hosts" and click on Add and provide SharePoint Server FQDN</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/7103.clip_image008_7D7FF75C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/7103.clip_5F00_image008_5F00_7D7FF75C.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1727.clip_image008_thumb_06F8B5D3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1727.clip_5F00_image008_5F00_thumb_5F00_06F8B5D3.png" alt="clip_image008" width="244" height="210" border="0" /></a></p>
<ul>
<li>Choose None as the Authentication method</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6518.clip_image009_6C4C19B9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6518.clip_5F00_image009_5F00_6C4C19B9.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image009" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/7266.clip_image009_thumb_38A3AD5B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/7266.clip_5F00_image009_5F00_thumb_5F00_38A3AD5B.png" alt="clip_image009" width="244" height="210" border="0" /></a></p>
<ul>
<li>Provide the FQDN of the SharePoint Server where SMTP role is installed and click on Save and then Next</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/7266.clip_image010_6956B506.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/7266.clip_5F00_image010_5F00_6956B506.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8640.clip_image010_thumb_5CE891DD.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8640.clip_5F00_image010_5F00_thumb_5F00_5CE891DD.png" alt="clip_image010" width="244" height="163" border="0" /></a></p>
<p>&nbsp;</p>
<ul>
<li>On the Source Server screen add the exchange server and click on Finish</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1881.clip_image011_1FE4604B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1881.clip_5F00_image011_5F00_1FE4604B.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/0317.clip_image011_thumb_6C3BF3EC.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/0317.clip_5F00_image011_5F00_thumb_5F00_6C3BF3EC.png" alt="clip_image011" width="244" height="242" border="0" /></a></p>
<ul>
<li>Ensure that the Connector status shows as Enabled</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3857.clip_image012_0AA634D6.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3857.clip_5F00_image012_5F00_0AA634D6.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image012" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4431.clip_image012_thumb_16C7AEFD.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4431.clip_5F00_image012_5F00_thumb_5F00_16C7AEFD.png" alt="clip_image012" width="244" height="102" border="0" /></a></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Configure SMTP on SharePoint Server</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Browse to Server Manager &gt; Local Server &gt; Tools&gt; "Internet Information Services (IIS) 6.0 Manager"</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6562.clip_image013_6EB4FFDD.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6562.clip_5F00_image013_5F00_6EB4FFDD.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image013" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1374.clip_image013_thumb_261B110C.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1374.clip_5F00_image013_5F00_thumb_5F00_261B110C.png" alt="clip_image013" width="164" height="244" border="0" /></a></p>
<ul>
<li>Expand Server Name &gt;</li>
</ul>
<ul>
<li>Right Click on SMTP and click on Properties</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4405.clip_image014_448551F5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4405.clip_5F00_image014_5F00_448551F5.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image014" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3823.clip_image014_thumb_31642549.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3823.clip_5F00_image014_5F00_thumb_5F00_31642549.png" alt="clip_image014" width="244" height="212" border="0" /></a></p>
<ul>
<li>Click on Access &gt; Authentication and ensure Anonymous is checked</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3823.clip_image015_3ADCE3BF.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3823.clip_5F00_image015_5F00_3ADCE3BF.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image015" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/2450.clip_image015_thumb_00816DDE.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/2450.clip_5F00_image015_5F00_thumb_5F00_00816DDE.png" alt="clip_image015" width="219" height="244" border="0" /></a></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Configure Email Settings in SharePoint</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Browse to SharePoint central Administration</li>
</ul>
<ul>
<li>Click on System Settings &gt; Configure Incoming e-mail settings</li>
</ul>
<ul>
<li>Configure settings based on the screen shots</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/5657.clip_image016_1EEBAEC7.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/5657.clip_5F00_image016_5F00_1EEBAEC7.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image016" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8371.clip_image016_thumb_62DF6D11.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8371.clip_5F00_image016_5F00_thumb_5F00_62DF6D11.png" alt="clip_image016" width="244" height="163" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3414.clip_image017_417FC775.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3414.clip_5F00_image017_5F00_417FC775.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image017" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4087.clip_image017_thumb_2666F867.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4087.clip_5F00_image017_5F00_thumb_5F00_2666F867.png" alt="clip_image017" width="244" height="83" border="0" /></a></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Enable Incoming email on Document library</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Browse to your Web Application</li>
</ul>
<ul>
<li>Create a new document library App</li>
<li>Browse to the List settings of the Document Library App</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/6644.clip_image018_1750198D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/6644.clip_5F00_image018_5F00_1750198D.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image018" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/3021.clip_image018_thumb_4E49F7C6.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/3021.clip_5F00_image018_5F00_thumb_5F00_4E49F7C6.png" alt="clip_image018" width="244" height="90" border="0" /></a></p>
<ul>
<li>Click on Incoming e-mail settings</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/1325.clip_image019_41DBD49D.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/1325.clip_5F00_image019_5F00_41DBD49D.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image019" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8284.clip_image019_thumb_26C3058F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8284.clip_5F00_image019_5F00_thumb_5F00_26C3058F.png" alt="clip_image019" width="244" height="104" border="0" /></a></p>
<ul>
<li>Configure the settings based on the following screen shot</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8688.clip_image020_7EB0566F.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8688.clip_5F00_image020_5F00_7EB0566F.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image020" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8688.clip_image020_thumb_26FF88C4.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8688.clip_5F00_image020_5F00_thumb_5F00_26FF88C4.png" alt="clip_image020" width="244" height="220" border="0" /></a></p>
<ul>
<li>Browse to the OU SharePoint Alias and make sure you see the contact created in it</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/0246.clip_image021_1A91659B.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/0246.clip_5F00_image021_5F00_1A91659B.png"><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image021" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/0246.clip_image021_thumb_4B446D46.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/0246.clip_5F00_image021_5F00_thumb_5F00_4B446D46.png" alt="clip_image021" width="244" height="155" border="0" /></a></p>
<p><strong><span style="text-decoration: underline;"><span style="font-size: small;">Test the incoming email functionality</span></span></strong></p>
<p>&nbsp;</p>
<ul>
<li>Send an email with an attachment to the email address that you configured, in my case it was doclib@sps2013.walia.com</li>
</ul>
<ul>
<li>Navigate to the Drop folder on the SMTP server, default location for the drop folder is C:\inetpub\mailroot\Drop</li>
</ul>
<ul>
<li>You should see your emails sent in this folder</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8764.clip_image022_10E8F765.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8764.clip_5F00_image022_5F00_10E8F765.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image022" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/8764.clip_image022_thumb_5D408B06.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/8764.clip_5F00_image022_5F00_thumb_5F00_5D408B06.png" alt="clip_image022" width="244" height="161" border="0" /></a></p>
<ul>
<li>Wait for 5 mins and these emails should get processed by the timer service</li>
</ul>
<ul>
<li>Browse to the Document library and you should see the attachment being uploaded to the document library</li>
</ul>
<p>Feel free to post comments if you have any confusion regarding any of the steps.</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting "This document could not be checked out to your local drafts folder. The document may have already been checked out, or the local drafts folder could not be written to." when trying to checkout a document</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/getting-this-document-could-not-be-checked-out-to-your-local-drafts-folder-the-document-may-have-already-been-checked-out-or-the-local-drafts-folder-could-not-be-written-to-when-trying</link>
      <pubDate>Mon, 15 Oct 2012 07:47:58 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2012/10/15/getting-this-document-could-not-be-checked-out-to-your-local-drafts-folder-the-document-may-have-already-been-checked-out-or-the-local-drafts-folder-could-not-be-written-to-when-trying/</guid>
      <description><![CDATA[&#160;  Problem  In this case customer was getting the following error when he was trying to...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><strong><u>Problem</u></strong></p>  <p>In this case customer was getting the following error when he was trying to checkout a document </p>  <p>&quot;This document could not be checked out to your local drafts folder. The document may have already been checked out, or the local drafts folder could not be written to.&quot;</p>  <p>Interestingly this issue did not occur on a new web application, and we did not see anything strange in ULS logs either.</p>  <p>&#160;</p>  <p><strong><u>Solution</u></strong></p>  <p>This was also an issue caused by the WebDAV module, interestingly customer had this WebDAV module installed for only one web application which kind of explain why the issue was occurring on only one web application</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/0763.image_24CFD8BA.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/0763.image_5F00_24CFD8BA.png"><img title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/72/67/metablogapi/4035.image_thumb_692FC9F9.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-72-67-metablogapi/4035.image_5F00_thumb_5F00_692FC9F9.png" width="244" height="154" /></a></p>  <p><strong><u>Question</u> - </strong>How do I remove WebDAV module from IIS Server?</p>  <p><strong><u>Answer -</u></strong> This is how you can remove WebDAV module from IIS</p>  <p>1) Open Server Manager</p>  <p>2) Expand Roles, click on Web Server(IIS)</p>  <p>3) Click on Remove Role Services</p>  <p>4) UnCheck WebDAV Publishing</p>  <p>5) Click Next</p>  <p>6) Click Remove</p>  <p><strong><u>Question - </u></strong>I cannot remove WebDAV module as my non-SharePoint sites use this module</p>  <p><strong><u>Answer </u></strong>– In that case we can remove WebDAV modules from just SharePoint site instead of removing it from the IIS</p>  <p>1) Open IIS</p>  <p>2) Expand Sites</p>  <p>3) Select the SharePoint Web Application </p>  <p>4) Select Modules from the Features View</p>  <p>5) Select WebDAVModule from the list of Native Modules and click on Remove</p>]]></content:encoded>
    </item>
    <item>
      <title>"Access Denied" when configuring SharePoint to View Operations Manager Data</title>
      <link>https://docs.microsoft.com/archive/blogs/harmeetw/access-denied-when-configuring-sharepoint-to-view-operations-manager-data</link>
      <pubDate>Mon, 01 Oct 2012 08:10:12 GMT</pubDate>
      <dc:creator><![CDATA[Harmeet Walia[MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/harmeetw/2012/10/01/access-denied-when-configuring-sharepoint-to-view-operations-manager-data/</guid>
      <description><![CDATA[&#160;  Problem  Recently I worked on an issue where one of our customer was getting Access Denied...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p><strong><u>Problem</u></strong></p>  <p>Recently I worked on an issue where one of our customer was getting Access Denied when adding the Operations Manager Web Part, and logs did not give us clear indication as to where exactly we were failing</p>  <p>Please refer to “<a href="https://technet.microsoft.com/en-us/library/hh212924.aspx">Using SharePoint to View Operations Manager Data</a>” TechNet article to know how to integrate Operations manager</p>  <p><strong><u>Symptoms</u></strong></p>  <p>We received Access Denied when adding the operations manager web part on the site collection and following stack is logged in the ULS logs</p>  <p>[Date and Time] w3wp.exe (0x1B94) 0x1540 Unknown Operations Manager 40 Verbose Error - &lt;PortalWebPart.InitializeWebPartConfiguration&gt; Error: System.Configuration.ConfigurationErrorsException: The Web Part cannot access the configuration list. This is probably caused by insufficient permissions. Contact your system administrator. ---&gt; System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object stateInfo) at System.Web.HttpResponse.End() at Microsoft.SharePoint.Utilities.SPUtility.Redirect(String url, SPRedirectFlags flags, HttpContext context, String queryString) at Microsoft.SharePoint.Utilities.SPUtility.RedirectToAccessDeniedPage(HttpContext context) at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(HttpContext context) at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(Exception ex) at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, Boolean bPrefetchRelatedFields, ISP2DSafeArrayWriter p2DWriter, Int32&amp; plRecycleBinCount) at Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName) at Microsoft.SharePoint.SPListCollection.Undirty() at Microsoft.SharePoint.SPBaseCollection.GetEnumerator() at System.Linq.Enumerable.&lt;CastIterator&gt;d__aa`1.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) at Microsoft.EnterpriseManagement.SharepointIntegration.SPListCollectionExtensions.GetList(SPListCollection lists, String listName) at Microsoft.EnterpriseManagement.SharepointIntegration.PortalConfigurationCollection.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0() --- End of inner exception stack trace --- at Microsoft.EnterpriseManagement.SharepointIntegration.PortalConfigurationCollection.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0() at Microsoft.SharePoint.SPSecurity.&lt;&gt;c__DisplayClass4.&lt;RunWithElevatedPrivileges&gt;b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at Microsoft.EnterpriseManagement.SharepointIntegration.PortalConfigurationCollection..ctor(String listName) at Microsoft.EnterpriseManagement.SharepointIntegration.PortalConfiguration.TryInitializeWebPartConfiguration(PortalWebPart webPart, PortalConfiguration&amp; configuration, String&amp; errorMessage) 616c88fc-47d7-4ac0-b155-da3d7859e21c</p>  <p>&#160;</p>  <p><strong><u>Resolution</u></strong></p>  <p>After some digging we realized that it was failing for a list on Central Administration,in order to fix this make sure your web application pool has permissions to add to <strong>“Operations manager web console environments” </strong>(<a href="https://Central">https://Central</a> administration site/operationsmanager)</p>  <p>There are high chances that you will get another Access denied and following will be get logged in the ULS log </p>  <p>System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'proc_EnumLists', database 'SharePoint_AdminContent_b87e98fd-b2fc-49c0-8025-aef8851561ea', schema 'dbo'.   <br />at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&#160;&#160;&#160; <br />at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)&#160;&#160;&#160; <br />at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlDataReader.get_MetaData()&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)&#160;&#160;&#160; <br />at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)&#160;&#160;&#160; <br />at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)</p>  <p>In order to fix this we need to grant Web Applications Application Pool DBO rights to the Central Administration Content Database</p>]]></content:encoded>
    </item>
  </channel>
</rss>