Tag Info

Hot answers tagged

3

How to retrieve List Url in SharePoint Online using PowerShell CSOM Function Get-SPOCredentials([string]$UserName,[string]$Password) { $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force return New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword) } $context = New-Object ...


2

Use Datasheet-View and make Copy+Paste or this Powershell script: Add-PSSnapin Microsoft.Sharepoint.Powershell [System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $site = new-object Microsoft.SharePoint.SPSite("SiteURL”) $web = Get-SPWeb -Identity siteURL $lista =$web.Lists["ListName"] $items = $lista.items foreach ($item in ...


2

You should be able to impersonate the user, but will involve opening up a web object for each specific user. $user=$web.AllUsers.GetByID(28) $token = $user.UserToken; $impWebObj= New-Object Microsoft.SharePoint.SPSite($web.Url, $token); $imperWeb = $impWebObj.OpenWeb(); $list = $imperWeb.Lists["SPLISTNAME"] $fileage = 15 $query = New-Object ...


2

Term.GetTerms method will return all the terms under a given term. Here is the sample code from your example: $ggterm = $termset.GetTerms("GG",$true) foreach ($term in $ggterm) { $childTerms = $term.GetTerms(); foreach ($cterm in $childTerms) { Write-Host $cterm.Name } }


2

New-MsolUser -DisplayName "Caleb Sills" -FirstName Caleb ` -LastName Sills -UserPrincipalName calebs@contoso.onmicrosoft.com ` -Department Operations -UsageLocation US ` -LicenseAssignment contoso:ENTERPRISEPACK http://technet.microsoft.com/en-us/library/dn530773.aspx ...


1

Try creating a script callAuditExport.ps1 that calls your current script file like this Start-Process powershell.exe -ArgumentList "-file C:\MyScript.ps1", "Arg1", "Arg2" This will cause a new Powershell process to run, then close when its done executing. It should free up the memory allocation when its done that way.


1

Try this $FilePath = "http://ServerName/sites/SiteName/MyDocumentLibrary/MyCSVFile.csv" $localPath = "C:\temp\test.csv" #Make sure temp folder exists $wc = New-Object System.Net.Webclient $wc.DownloadFile($FilePath, $localPath) $list = Import-Csv $localPath


1

If you have language packs installed, then we should use DescriptionResource for setting the values $myWeb.DescriptionResource.SetValueForUICulture($myWeb.UICulture, "Some test description")


1

Try adding the type Microsoft.SharePoint.Client.NavigationNode and then switching Microsoft.SharePoint.Navigation.SPNavigationNode to Microsoft.SharePoint.Client.NavigationNode SPNavigationNode is the server object model, to use the client object model, you want NavigationNode. See here for details. However, unlike SPNavigationNode, NavigationNode does ...


1

Before you create the service components you have to start the service instance on your server(s). $hostA = Get-SPEnterpriseSearchServiceInstance -Identity “server-name” Start-SPEnterpriseSearchServiceInstance -Identity $hostA then go on with your code. example below $ssa = Get-SPEnterpriseSearchServiceApplication $newTopology = ...


1

I think it's whining about the spamdoc.aspx, instead try without the .aspx. Try this instead. $web = Get-SPWeb http://somesite $pWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web) $pageLayout = $pWeb.GetAvailablePageLayouts() | Where { $_.Name -eq "BlankWebPartPage.aspx" } $folder = $web.GetFolder("SitePages") $page = ...


1

After a long day, it turned out that for successfully using the Powershell DownloadFile() method, in my environment (SP2013 with ADFS) following two lines did the trick(at least for me). $wc.UseDefaultCredentials = $true $wc.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f") So, the final code looks like, $FilePath = ...


1

Try this $wc = New-Object System.Net.WebClient $wc = New-Object System.Net.Networkcredential(Username, Password) $UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)" $wc.Headers.Add([System.Net.HttpRequestHeader]::UserAgent, $UserAgent);


1

after more digging, what I found is that, I had 2 different column in that list which has same GUID. there is a script on this link which helped me to found those fields. Then I removed them from my list. Luckily, those fields were not used, so all worked smoothly. I hope it helps others


1

I had the same issue, and in my case I had to use the CMSPUBLISHING#0 template because I was moving a subsite to a site collection. My solution was change the masterpage. Although seattle masterpage was chosen, I changed it to the oslo masterpage and worked fine, the 2013 layout experience came back. After I changed once more to seattle masterpage, and It ...


1

I know it's been 3 years ago and already answered, but here you can find plenty of versioning scripts and ready programs: Disable a versioning on Image Libraries in SharePoint using PowerShell Enable versioning for all SharePoint Online lists using Powershell Enable versioning for all lists in SharePoint Online tenant (C#) Restore and clean up SharePoint ...



Only top voted, non community-wiki answers of a minimum length are eligible