Tag Info

New answers tagged

0

Thanks Andrey. Your suggestion led me down the right path. Here's the final working version of the script that solves the original question. [CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=1)] [string]$sc ) $site = Get-SPSite $sc $webs = Get-SPWeb $sc $count = 0 foreach ($web in $site.AllWebs) { if (($webs.Count -le ...


1

First - you must delete foreach ($list in $spsite.AllWebs) then find list using $list = $web.Lists["InternalNameOfTheList"] or $list = $web.GetList($web.Url + "/Lists/" + $ListName) and after that add column using $spFieldType = [Microsoft.SharePoint.SPFieldType]::Text //change to your field type $list.Fields.Add("YourColumn",$spFieldType,$false) ...


0

For the sake of leaving this question with a conclusion: The best I can determine is that at one point IRM was used and has either (1) the time limit on it expired so it's "on" technically but nothing is impacted or (2) at one point it was used and has been since turned off but some residual settings are still around. Personally, I suspect the former.


0

Unfortunately, PowerShell for O365 is not going to accomplish that. You can, however, use the CSOM to accomplish this. This link shows how to create a navigation node. Here is the main part of it: string siteUrl = "http://server/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(siteUrl); Web site = clientContext.Web; // Get the ...


0

According to the documentation, the AbsoluteUri property is read-only (the Uri property itself is). You'd need to try another route, that is deleting the ExternalRelationship: $settings = $wpdoc.maindocumentpart.DocumentSettingsPart $settings.DeleteExternalRelationship("rId1") $wpdoc.Close() $file.Update(); As a side note, your code ($URIpath = ...


0

The problem was that /PWA is actualy a managed path. And copy a site collection to new managed path you first have to create it with Explicit inclusion.


0

Friends, that's interesting! If you add groups Active Directory in Sharepoint via Powershell format Claim the script work correctly, but why? $web = get-spweb "http://projects.rvsco.ru/M143" #$Groupfull="RVSCO\gf_sp_m143_participant" $Groupfull=" c:0+.w|s-1-5-21-3547894948-444176536-1024843340-6189" $account = $web.EnsureUser($Groupfull) $assignment = ...


1

You can't connect to remote server with SharePoint Powershell. You must be connected on the remote server. I use a remote desktop connection to the server every hours of the day. It's the only way. However you can install SharePoint on your Pc and use Powershell locally. You can find the guide from this link: ...


1

Sharepoint Powershell install with Sharepoint server and this not able install seperatly! So if this is possible this is not usefull and don`t work!


0

Because I could not get an answer to the event handling in PowerShell, the posted Import PowerShell script does not work. As a solution, I merged the two scripts and ported them to C#. Here is the code. using System; using Microsoft.SharePoint; namespace MigrateArticles { public class Program { #region Shared Constants protected static ...


0

I did the same using an item event receiver. I'll show what i did in c# code, but you'll have to do the same logic in your script. First of all you can try a $folder.SystemUpdate() instead of the .Update(). This solved some issues for me. Next you can write a foreach that will delete all the current permissions, and after this is executed if adds the ...


4

You mean like this? $web = Get-SPWeb http:/SC/site $web.WebTemplate + " " + $web.WebTemplateId $web.close()


1

Try this, Test-SPContentDatabase -Name $DbName -WebApplication $urlApp > C:\\TextResults.txt or Test-SPContentDatabase -Name $DbName -WebApplication $urlApp > C:\\TextResults.xml it should create a result file in C drive. Edit Right way, Test-SPContentDatabase -Name $DbName -WebApplication $urlApp | Out-File c:\TestResult.txt Seems like ...


0

I managed to access my managed metadata using the techniques outlined here: http://ramblingsofamadcomputerguy.blogspot.com.au/search/label/TaxonomyFieldValue.PopulateFromLabelGuidPair and here http://nickhobbs.wordpress.com/2012/02/21/sharepoint-2010-how-to-set-taxonomy-field-values-programmatically/ In terms of the specific problem outlined in my ...


1

A great tool I used when running into the "file locked for editing" issue was using the SPUnlock web part this just works. I've used this web part numerous time so unlock files for deleting. All you have to do is.. Download SPUnlockSandbox.wsp from https://spunlockfiles.codeplex.com/ Upload SPUnlockSandbox.wsp to SP Site Collection Solution Gallery ...


1

Verify that your $file.Name is truly "myfile.docx". Try these amended lines (with the other lines as is): $DestUrl ="MyDocuments/SubFolderName/" $file.MoveTo($DestUrl + $file.Name, true)


2

You could add PowerShell snap-in in you .ps1 file. But in this case you should have some permissions to sql and SharePoint if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" }


1

If that is the error, I think your $l is null, meaning that your are not getting a reference to the list! $list = "Business Screening" $item = 329 $w = get-spweb $url $l = $w.lists[$list] should probably be $list = "Business Screening" $item = 329 $w = get-spweb $url $l = $w.Lists.TryGetList($list) #this finds list by title


2

function Deactivate-SPFeature { param ($FeatureID, $SiteUrl, $WebApplicationUrl) $Feature = Get-SPFeature -Identity $FeatureID -ErrorAction SilentlyContinue $IsActiveFeature If ($Feature -eq $null) { Write-Warning "The specified feature ($FeatureID) was not found." return } If ($Feature.Scope -eq ...


1

The feature activated event will not fire again as it is already activated. However, the webpart will get updated because new dll, control templates and other components get deployed properly.


1

As Nadeem said, RoleDefinations are associated with SPWeb Object and not group. instead of $rd = $group.RoleDefinitions["Contribute"] Try this $rd = $group.ParentWeb.RoleDefinitions["Contribute"]


1

There are different methods for this. You can run issues commands from your laptop to your computer via invoke-command and just pass over the command you want to return and the output is returned locally. TechNet Reference: http://technet.microsoft.com/en-us/library/hh849719.aspx A more advanced method is initiate a remote session and then export that ...


0

Check to ensure that you can access one of those inaccessible "Personal Documents" libraries and its items via powershell: $mysitelist = (get-spweb http://mysite/personal/user_name).Lists["Personal Documents"] $mysitelist.items If you can access the list items, use powershell to inherit library permissions from the site with: ...


0

You can iterate through all user profiles and update them. The PowerShell script can look like this: [void][reflection.assembly]::Loadwithpartialname("Microsoft.Office.Server"); Add-PSSnapin Microsoft.SharePoint.PowerShell $site=Get-SPSite "https://yourSitecCollection" $serviceContext = Get-SPServiceContext $site; $upm = new-object ...


1

I'm not sure if this is possible from Powershell but what I would recommend is creating a webpart or page with your query, then wrapping your code in SPMonitoredScope. You could then enable the Developer Dashboard and get a much better idea of where the strain is. Here's a blog post that explains the process: ...


2

RoleDefinitions are associated with SPWeb object not SPGroupas you have done in $rd = $group.RoleDefinitions["Contribute"]. Moreover, groups are created at root site collection level only and are used in sub sites. So, if you remove a permission from a group at one place like in root web, then the changes will be seen everywhere. IMO, what you are trying to ...


0

You can try something like this, Get-ADUser -Filter * -SearchBase "ou=TestOU,dc=domainController01,dc=com" | Set-ADUser -customProperty $true OR # Get all users in the SomeOU. $AllUsers = Get-ADUser -Filter * -SearchBase "OU=ChangeMeOU,OU=UserAccounts,DC=DomainController01,DC=COM" # Iterate the users and update the department and title attributes in AD. ...


1

$FeatureName = "YourFeatureName" Install-SPFeature $FeatureName -Force $FeatureActivate = Get-SPFeature $FeatureName Enable-SPFeature -Identity $FeatureName -Url $Url -Force We can change the url based on scope 1. Enable-SPFeature -identity "MyCustom" -URL http://somesite This example enables the "MyCustom" site scoped SharePoint Feature at ...


2

You should use the URL to the web where you want to activate it. But you should change line 2 in the script to use -Web instead of -Site for web scoped feature If it is site scoped it will be activated at Site Collection level and not web level, so your question is not applicable


0

If this error occurs it´s because you changed or added anything into the Visual Studio solution or changed namespaces. Change the Feature ID of all the features of the projekt will make it work!


1

The feature will also need to be activated in order for web part to show up. The next time you deploy a WSP, the feature will remain activated/deactivated depending on its state. That is, if the feature is activated and you deploy the WSP again, you won't need to activate the feature. However, if it is deactivated, it need to be activated again.


0

Under "Library Tools", you have "Export to Excel", then you can filter this Excel and save it to .csv


1

First check if the feature is installed using Scope and then try to activate it like: $Feature = Get-SPFeature -Identity $FeatureID -ErrorAction SilentlyContinue If ($Feature.Scope -eq [Microsoft.SharePoint.SPFeatureScope]::WebApplication) { $Feature = Get-SPFeature -Identity $FeatureID -WebApplication $SiteUrl -ErrorAction SilentlyContinue ...


1

Try this. I have tested it Add-PSSnapin Microsoft.Sharepoint.Powershell [Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges({ $webApplicationURL = "http://xyz:4444/" $webApp = Get-SPWebApplication $webApplicationURL if($webApp -ne $null) { Write-Host "Web Application : " + $webApp.Name foreach($siteColl in ...


0

You can generate a detailed report on SharePoint users access on various elements of SharePoint platform, including Web Application/Site Collection/Site/List level with the help of PowerShell. http://www.sharepointdiary.com/2013/01/permission-report-for-specific-user.html


1

Try this code. I have not tested it $url = "http://yoursitecollection.com"  try  {  $Site=Get-SPSite $url -ErrorAction SilentlyContinue  $spWebApp = $Site.WebApplication      foreach($spSite in $spWebApp.Sites)  { $spWeb = $spSite.RootWeb $spTemplate = $spWeb.ListTemplates["Custom List"] ...


0

Here is the PowerShell code. Note that I have not tested it. $contentWebAppServices = (Get-SPFarm).services | ? {$_.typename -eq "Microsoft SharePoint Foundation Web Application"} foreach($webApp in $contentWebAppServices.WebApplications) { Write-Host "Web Application : " $webApp.name foreach($siteColl in $webApp.Sites) { // Create ...


0

This should help you: Find and Delete Orphaned Alerts in SharePoint


0

Jason, Can you please try the suggestion given in following question: How can you move a document with its version history to a new library? It says Just moved (drag & drop) a file in Explorer View from one document library to another, and it did retain previous versions! Obviously both libraries need to have versioning enabled. Try it ...


2

You can try below code to Deactivate MDS feature for entire web application. $webApp = Get-SPWebApplication -Identity http://sp2010 $siteCollection =$webApp | Get-SPSite -limit all foreach ($site in $siteCollection) { $webs = $site | Get-SPweb -limit all foreach ($web in $webs) { $url = $web.URL write-host "Web URL = " $url -foregroundcolor ...


1

You can use this script written by Nik Craik. The script below will extract all documents and their versions, as well as all metadata and list data to CSV files. The DownloadSite function will download all the documents and their versions into folders named after their respective document libraries. Versions will be named ...


2

Use the -AllWebApplications flag to deploy it to all existing web applications. See: http://technet.microsoft.com/en-us/library/ff607534(v=office.15).aspx Note that Web Apps created afterwards do not automatically have this solution packaged deployed.


0

While developing the apps in development environment you can use SPFastDeploy tool to make the updates with out redeploying everything. In case of production you can try to use the UpgradedEventEndpoint web service to preserve the data. ...


0

This turned out to be related to not ALL of the excel service application features being enabled in sharepoint. In order to activate the features go to central admin and then: /_admin/ManageFarmFeatures.aspx From here you can enable the following features: Excel Services Application Edit Farm Feature Excel Services Application View Farm Feature Excel ...


1

If I have understood your question you need to use this command: Get-SPEnterpriseSearchMetadataCrawledProperty for example: $searchapp = Get-SPEnterpriseSearchServiceApplication $cat = Get-SPEnterpriseSearchMetadataCategory –SearchApplication $searchapp –Identity CATEGORYID Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp ...


1

To get the site id use powershell. Interestingly in my case I can create the powershell object. E.g. $s=Get-SpSite <url> $s.ID Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN Then execute STSADM -o deleteconfigurationobject -id <site id> In once case this worked Or you can try deleting $s.Delete ...


2

here is a script which will give you some # Get current date $date = Get-Date # Show current date Write-Host "Looking for running jobs with a Last Run Time of greater than or equal to" $date # Get all Timer jobs and iterate Get-SPTimerJob | ForEach-Object { # Get last run time for job $lastRunTime = $_.LastRunTime # If run time is greater ...


0

How about calling EnsureUser to see if the user exists before you call New-SPSite? $user = try{ $web.EnsureUser($PrimaryLogin) }catch{} if ($user) { ... } Although I don't know what you would do if the user does not exists.


0

Verify that the account running the cmdlet has adequate SQL permissions and that you are not using SQL Server Express. Check your SP server's eventlog for SQL login errors during your attempt to restore the site. Also, check your SQL logs for errors. The cause could be related to any number of other issues. See this related post for details.


3

The Site Recycle Bin feature is newly introduced in Service Pack 1 for SharePoint 2010, if you haven't installed SP1 for your SharePoint 2010 when you deleted the site collection, you need to restore the content database, here are two articles about this. ...



Top 50 recent answers are included