Tag Info

Hot answers tagged

3

Those groups will not be able to access the folders if the permission for the folder is broken and only the group "XYZ" has permissions to the folder and rest all are removed. UPDATE Sample powershell code: $folders = $list.Folders foreach ($spFolder in $folders) { $PermissionLevel = "PermissionName" ; $group = $web.SiteGroups[$GroupName]; ...


3

I know you've already got a great answer using regex, but you also could have parsed the string out to leave only what's remaining after the "SC", and tried to parse that as an integer. Like $shouldBeInteger = $site.Url.Substring($site.Url.LastIndexOf("/") + 3) try { $siteNumber = [System.Int32]::Parse($shouldBeInteger) } catch { # oops, guess ...


3

Try the following: /SC\d{4,}$ I have added a / since you are doing the entire URL. I assumed you had parsed the string out. I have tested it against these /SC0001 /SC0001backup /SC0001test /SC0002 /XZ0001derp /badsiteSC0001 And it matched the first and fourth only.


3

Example code using C#.Net // Create new object of SPWebApplication & SPWebApplicationBuilder class SPWebApplication newApplication; SPWebApplicationBuilder webAppBuilder = new SPWebApplicationBuilder(SPFarm.Local); // Set necessary values to webAppBuilder object webAppBuilder.Port = portNo; webAppBuilder.RootDirectory = new ...


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. ...


2

You can create it in both C# and PowerShell. Example of PS command: New-SPWebApplication -Name "Contoso Internet Site" -Port 443 -HostHeader sharepoint.contoso.com -URL "https://www.contoso.com" -ApplicationPool "ContosoAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "DOMAIN\jdoe") -AuthenticationProvider $ap -SecureSocketsLayer See more at ...


2

Easiest way is to use PowerShell New-SPWebApplication Taken from Technet Creates a new Web application specified by the Name parameter. The user specified by the DatabaseCredentials parameter must be a member of the dbcreator fixed server role on the database server. This example creates a new Web application by using an internal host header of ...


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 ...


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.


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


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 ...


2

There is a more fail-safe approach than what @lwbecker2 suggests Get-SPSolution | ? { $_.JobExists } | % { Write-Host "Deployment job is currently running" } This has the benefit of not having a race condition. If you only look for the timer job, it may be that a deployment has already been initiated, but a timer job was not yet created when you check for ...


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 ...


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 ...


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

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


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 ...


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: ...


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 ...


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.


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 ...


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"] ...


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 ...


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

The following should help, I haven't tested it yet.. $fieldId = [Guid]"fa564e0f-0c70-4ab9-b863-0177e6ddd247" $site = Get-SPSite("http://yoursite/") foreach($web in $site.AllWebs) { foreach($list in $web.Lists) { $fieldInUseList = $list.Fields | Where {$_.Id -eq $fieldId } if($fieldInUseCt) { Write-Host "'$web' web - ...


1

7105 is the build number. If you run Fiddler and check your current SharePoint farm, you will find in the header of your request "MicrosoftSharePointTeamServices: 14.0.0.6029" In order to restore your backup, you need a farm that is beyond build 7105 (e.g. build 7106 - August 2013 CU which was released after SP2).


1

I found an answer, just for site collection created on web application root. Use this command to backup a site collection Backup-SPSite -Identity "http(s)://your-site-collection-url" -Path "C:\backups\your-site-collection-backup.bak" It's important to use an absolute path as -Path parameter. Then create a new web application and then run the following ...


1

couple of things you can do. 1) Backup curent site collection and then restore it with different name & url. 2) you can use export Site Collection and Import site collection. You will lose the metadata etc. 3) you can use the 3rd party tool for this, which give you more power & flexbility and less effort. try ShareGate migration tool. they have 15 ...


1

I used the following script to check last modified time for all lists. It was used for content reviewing before the migration. It doesn't export each file modification time and shows only the most recent time of changes, but probably it helps you. You can change "2013-06-01" to any other date, the lists which were modified after that date will be marked with ...



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