Hot answers tagged

3

You can use: New-SPSite -Url $url –ContentDatabase $ContentDatabase -Name $WebsiteName –Description $WebsiteDesc -Template $Template -OwnerAlias $PrimaryLogin –OwnerEmail $PrimaryEmail see: https://social.technet.microsoft.com/forums/sharepoint/en-US/89c90032-5be1-4fe6-8546-0114eaf018ca/site-collection-in-a-particular-content-database


3

If they're the same Site Collection, that is, have the same Site Collection ID, you cannot mount it to the same farm. Instead, you need to run Backup-SPSite and Restore-SPSite (good up until ~20GB in SC size) which will generate a new Site Collection ID, and also allow you to restore it at a different path.


2

You can use the script to give specific users the db_owner role. Don't forget to dd all users to users.txt. [System.Reflection.Assembly]::LoadWithPartialName(‘Microsoft.SqlServer.Smo’) | out-null $Users = get-content c:\users.txt Foreach ($User in $Users){ $InstanceName = "" $NewOwnerLoginName = $user; $smosvr = New-Object ...


2

I think that this could be your solution: Add a User or Group to the SPWebApplication User Policy for all Web Applications in the farm The interesting code should be Get-SPWebApplication http://sharepoint2010 | foreach { $webApp = $_ $policy = $webApp.Policies.Add($userOrGroup, $displayName) $policyRole = ...


2

It looks like at some point, you tried to configure Workflow Manager to work with SharePoint (so you can create/deploy/use 2013 mode workflows). To do so, you set up Workflow Manager (a dedicated -free- product) and then connected SharePoint to it. Workflow Manager generally sets up on http://<WFserver>:12291/, where WFserver is the Web server you ...


2

Get-SPProduct -local doesn't actually return whether you are missing some updates. Instead as described in the TechNet: Returns a list of the SharePoint-related products installed in the farm and the versions of all updates installed for each product. However to understand why this affects the Configuration Wizard's execution the command's steps should ...


2

There is a limited support of PowerShell Commands available for SharePoint Online, We can use csom in PowerShell script to get the author of a site collection, the lack of cmdlets for items at a lower scope than the Site Collection. Specifically, there is no Get-SPOWeb or Get-SPOList cmdlet or anything of the sort for SharePoint Online. Add-PSSnapin ...


2

if you have both web application properly configured. Make sure both DNS are properly registered. Create Web Applications on http://one port 80 and http://secondwebapp port 80. once 1st web app created it will ask to create the root level site collection. I think, this is where you created 1st root level. Now once 2nd web app created same message will ...


2

It depends whether user field is single or multi valued. List item for People column type[Person or Group] has the following type in CSOM API: Single: FieldUserValue class Multi: array of FieldUserValue class In turn FieldUserValue class does not expose login property (the list of properties could be found here) The following example demonstrates how ...


2

Yes, unfortunately this is default behavior. But there are ways around it. You can’t rename AppPools in the IIS, but you can create another AppPool and move the applications to the new AppPool. It’s a tedious work and you shouldn’t do this unless it’s absolutely necessary. Instead, fire up you SharePoint Management shell and type: ...


2

To find out what databases the IDs correspond to, run: Get-SPContentDatabase | Select ID,Name


1

To list all master pages: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue; Get-SPWebApplication | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, URL, MasterUrl To download a specific file / master page: $fromsite = "<your sp url>" $fromfile = "/_catalogs/masterpage/seattle.master" $tofile = ...


1

As long as you use Host Headers for both web applications, you should be fine. Take a look at the New-SPWebapplication cmdlt and be sure to specify the hostheader parameter when creating the web applications.


1

You need two HostHeaders( DNS), then you can create more than one Web App on single Port. I.e If you have www.abc.com and www.efg.com, On the Web Application Creation Page. Enter the Name of Web app, Port Number and HostHeader. ...


1

through powershell or c-sharp code


1

If you are looking to create an site collection, you need to create an explicit managed path for "/search". In central administration, under the manage web applications screen, highlight the web application, then select managed path. Create an explicit managed path called "/search" and try your powershell script again.


1

Try using the Get-SPCustomizedPages PowerShell cmdlets written by Gary LaPointe.


1

You were very close, since navigation has a hierarchical structure in order to create a child node the parent node should be determined first. The following example demonstrates how to create a child (Link) node under Heading node in Global navigation: Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server ...


1

Use below code, it will iterate all the webs under the specified site collection, It will get all the document library and it will iterate all the folders in the document libraries and gives the folder name and its author. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Get the Site collection $Site= Get-SPSite "SiteURL" ...


1

You have to create the Content Database 1st then you will be able to create new site collection. New-SPContentDatabase -Name "database name" -DatabaseServer "database server name" -WebApplication "web app url" $dbname = Get-SPContentDatabase "databasename" New-SPSite -URL $site -OwnerAlias $owner1 -SecondaryOwnerAlias $owner2 -ContentDatabase $dbname ...


1

I found I needed to add it, check it out, call update, check it in and publish it. So: $web = Get-SPWeb $site $folder = $web.getfolder("_catalogs/masterpage") $files = $folder.Files $mPage = Get-Item "C:\path to your\masterpage.html" $file = $files.Add("masterpage.html", $mPage.OpenRead(), $true) $file.CheckOut() ...


1

In order to use Taxonomy terms to a taxonomy field using PowerShell, we need to involve SharePoint Object Model from PowerShell, and then use the Object Model to add terms in a termstore to the field. Below is the same code for your reference. Please add the logic in the For-Each method: Site Collection URL - Give your site collection url in quotation ...


1

Document libraries are derived from lists under the covers. So your example above should also work for a document library. Take a look at this example from another question previously posted. You can see the code is very similar: Traverse through List of Documents using PowerShell


1

you can do it couple of ways. Backup and restore Site collection Backup the site collection in question ( backup-spsite) move the backup to test farm restore the site using restore-spsite. Move site into own content DB create a new content db use move-spsite to move the site collection into the new content db now use Database baackup or restore ...


1

You just need a small change to your PowerShell script. $web = Get-SPWeb http://webUrl $groupOwner = $web.SiteGroups["GroupA"] #this group will own "GroupB" $groupTarget = $web.SiteGroups["GroupB"] $groupTarget.Owner = $groupOwner $groupTarget.Update()



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