Questions tagged [powershell]

Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.[except from WikiPedia]

Filter by
Sorted by
Tagged with
2
votes
1answer
3k views

Apply Alternate CSS to all site collections via Powershell in SharePoint 2013

I have a SharePoint 2013 environment where I want to apply a single Alternate CSS file across all site collections and subsites. I am using the following method. When I run this I receive a single ...
2
votes
2answers
12k views

Sharepoint Online All User Access/Permissions Report

Is there a powershell script for SharePoint online that can create a csv report listing permission/access details for all users of a SharePoint site? We have licenses to Offices 365 E3 which includes ...
1
vote
1answer
14k views

PowerShell: Get all items where column equals a certain value

I have a SharePoint site which I want to search all document libraries where column1 = 'hello' and then print out the columns title, scope and column1. Then output the result to a file. I want to do ...
0
votes
3answers
12k views

Copy site with content to another site collection

Are there any SharePoint tools out there that copy all of the content from one site collection to another? We need to get one site from our site collection and all of the lists and libraries and all ...
0
votes
2answers
8k views

The sign-in name or password does not match one in the Microsoft account system

When connecting to online site we have Microsoft authentication call to our phones and we will enter our pin for authenticating.Then only we can access the site. But in csom code when conencting to ...
11
votes
1answer
20k views

Adding a site column and add it to a content type from PowerShell issue

Within a PS script, I'm trying to add a site column and add this column to a custom content type. Here is my script : add-pssnapin Microsoft.SharePoint.PowerShell -EA 0 function ...
5
votes
1answer
2k views

Change Quick edit on list on SharePoint 2013

I would like to set list Quick edit parameter programmatically or by schema.xml, but I can't find way to do it. View has parameter InlineEdit, but SharePoint has to set it with another way. How can ...
4
votes
2answers
760 views

Trying to create a template with subsites

I'm trying to create a template that I'm going to need to replicate several times. Unfortunately there are sub-sites beneath the main site on the template that are complicating things. From what I ...
3
votes
6answers
9k views

Backup and Restore SharePoint 2010 SiteCollections

I am getting an error "Backup version is different" while restoring SiteCollections from one web application to another on the same SharePoint server farm. Following are the steps I was executing when ...
2
votes
1answer
8k views

How to copy content type from one site collection to another site collection in Sp 2013

I need to create a content type from one site coll to another, I found this link: http://get-spscripts.com/2011/02/export-and-importcreate-site-content.html The export works perfectly: $sourceWeb = ...
2
votes
2answers
16k views

Run Powershell Script from Sharepoint page

I use a PS script to create a list. Instead of a scheduled task, I wondered if I can put a link or a button on a sharepoint page, that when you click on it, it runs a PS Script on the SharePoint ...
2
votes
2answers
2k views

Apply CSS to Site Collection and all subsites using PowerShell in SharePoint 2013

I am holding responsive CSS file. And I would like it to apply my CSS file for my site collection and its subsites, so that lists and document libraries also get responsive. Can anyone help me in ...
2
votes
2answers
10k views

Change Document Library folder's Modified timestamp to latest timestamp inside

I have a Sharepoint 2010 Document Library with a range of subfolders and some files within each of them. The problem is, right now every subfolder has the same Modified timestamp, and I want each ...
2
votes
1answer
3k views

Access personal views in a list with PowerShell

I am trying to first access and then edit Personal Views for a SharePoint List using PowerShell. However only the public views are returned. In the example below the list called List1 has two views - ...
1
vote
1answer
8k views

Setting “Chrome Type” to “None” for a web part using power shell

I have added a custom web part on page. Some how I am not been able to change its Chrome Type to None because when I mouse over the corner of web part where the arrow is supposed to show under ...
1
vote
4answers
13k views

Get-PnPListItem Not returning all the Fields

I am new to using PowerShell with regards to pulling data from SharePoint using PnPListItem. I have my code below: Write-Host "Please enter URL of the SharePoint site:" $url = Read-Host Write-Host "...
1
vote
1answer
60 views

Script to copy from fileserver to sharepoint and monitor

I am new at powershell scripting. I am asking for help. I have to create a script to upload folders from a fileserver to sharepoint. The script must monitoring that location( folder). And when a new ...
1
vote
1answer
7k views

Add field to list CSOM Powershell

I have written some code which adds a list client side in powershell : $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) $ctx.Credentials = $credentials $web = $ctx.Web ...
1
vote
1answer
3k views

When would you flush the cache of a SharePoint web application?

I stumbled upon this PowerShell script (source) to flush the cache of all SharePoint web applications. Write-Host -ForegroundColor White " - Enabling SP PowerShell cmdlets..." If ((Get-PsSnapin |?{$...
0
votes
1answer
67 views

How to retreive last 10 users who have logged in a site using Power shell script?

I need to retreive last 10 users who have logged in a site.(I need to chek in each site under a webapp who are the last 10 users to log in). and export it to a csv file.Require code in powershell.
0
votes
1answer
4k views

how to get all the pages inside a site?

How to get all the pages inside a site? I will pass the parameter of a site in a site collection example: http://www.category.com/en,using powershell code in sharepoint server 2013. when i try below ...
0
votes
4answers
2k views

How to keep two SharePoint Lists in sync when located on 2 different servers

I have two lists. One is on site A which is on server A and the second one on site B on server B. So i decided to use PowerShell to export the list on site A and then grab the export and load it to ...
0
votes
1answer
4k views

User profile Audience Using Power shell

#Add SharePoint PowerShell SnapIn if not already added if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint....
0
votes
1answer
640 views

Modify the WriteSecurity property for an Issue Tracking List

I am working on an issue tracking list inside SharePoint 2013 and I want to set the WriteSecurity for the list to be = 2. So I run the following script: $web = get-spweb "http://t*******1/" $spList =...
19
votes
4answers
62k views

PowerShell: Script to check feature status (enabled/disabled) before activating

I am developing a script to refresh my custom features. Earlier i was just looping through the features and calling Disable-SPFeature and Enable-SPFeature on each items. The issue is when the ...
0
votes
2answers
13k views

Powershell commands to check permission for a specific user on all “sharepoint online 2013” site collections?

need to check permissions for a specific user on SharePoint Online 2013 thoughout the sites need powershell commands to achieve this
12
votes
5answers
85k views

List all Site Collections in a Farm

I want to be able to see the number, names, url of all site collections there are in a given farm. Would there be a powershell command to do that?
9
votes
2answers
4k views

Programatically determine who created a site collection

Is there a way, preferrably with Powershell, to determine who created a site collection? I'm not interested in who the site collection admins are, but who the actual creator of the site collection was....
8
votes
4answers
6k views

How can I schedule the User Profile Service to run a full sync weekly?

We are running SharePoint Server 2010 and have not yet applied SP1. User profile incremental sync is not picking up all of the group membership from AD. Starting a full sync seems to rectify the ...
15
votes
5answers
21k views

Restore-SPSite to the same content database

I ran Restore-SPSite on my server from a backup. I then deleted the site collection and did it again but got the following error: Restore-SPSite : The operation that you are attempting to perform ...
11
votes
5answers
11k views

Automatically add pssnapin Microsoft.Sharepoint.Powershell

I am developing in Sharepoint and I like more Windows Powershell than Sharepoint Management Shell. Every time I restart the development machine, I have to run Add-PSSnapin Microsoft.Sharepoint....
10
votes
4answers
13k views

how to know Exact Document Library size

How to know exact document library size. any PowerShell code required? I used http://XYZ:4444/_layouts/15/storman.aspx but it doesn't show true size. I have Just Modified Nikhil's Script which ...
7
votes
4answers
5k views

Can I use Set-SPOUser to set an O365 security group as a secondary site collection administrator?

Is there a way to use Set-SPOUser to add a security group I created in Office 365 as a secondary site collection administrator? I have the security group's Login Name which begins with "s-1-5-21-..." ...
6
votes
3answers
15k views

Use Powershell to iterate through all UserProfile properties

The following script spits out all UserProfile properties for users on Sharepoint 2007: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") [void][System.Reflection....
5
votes
2answers
24k views

How to add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint

How I can add Add-PSSnapin Microsoft.SharePoint.PowerShell to machine without SharePoint 2010? I try to run PowerShell script to Backup Farm on Windows Server 2008 R2 without Sharepoint but while I ...
2
votes
2answers
10k views

How to get a list of broken links using Powershell? for Sharepoint 2010

I need a SharePoint 2010 Management Shell script that is going to generate a csv file with a list of broken links in one of my site collection and its sub sites. The script should support powershell ...
1
vote
1answer
15k views

List files in a specific folder in a document library

I there anyway to output the files of a specific folder in a document library? Listing them will be like foreach $file in $folder.files { write-host $file.name } But how do I tell it to look ...
1
vote
2answers
5k views

How to loop sharepoint document library subfolders with powershell in CSOM

I have this code: cls function Recurse ($folder){ write-host ----- $folder.Name $context.Load($folder.Subfolders) $context.ExecuteQuery() foreach($folder in $folder.Subfolders) ...
11
votes
3answers
22k views

Do I have to run Register-SPWorkflowService for each site collection?

As part of my SharePoint Server 2013 setup I sometimes need to integrate the new workflow infrastructure into the farm. I've followed the documentation starting from the SharePoint side of things: ...
10
votes
2answers
3k views

How to turn off MDS on all site collections and sites?

We have got a web application with 400 site collections and multiple sites, is there a way to turn off the MDS feature for entire web application?
8
votes
2answers
19k views

How to return all user profiles

I need to query the entire user profile store and do multiple operations such as filtering based on one user profile property, sorting by another, and grouping on yet another. Is this possible using ...
6
votes
4answers
45k views

How to connect to SharePoint online to run some PowerShell

How can connect to SharePoint online to run some PowerShell commands? It would be nice if someone has drilled down the steps for me :)
5
votes
1answer
5k views

Possible to set the default page layout for a site using Powershell?

I have a bunch of sites in which I would like to change the default Page Layout. Is there a way to set this to a custom Page Layout using powershell? (The page layout is already on all the sites) ...
5
votes
4answers
29k views

List of databases used for a sharepoint 2010 farm?

How to find the list of databases are used by a SharePoint 2010 Farm, including content databases, service application databases and configuration database.
5
votes
2answers
20k views

create New site collection with new content database using powershell

How to create a new site collection in existing web application but with new content database using powershell.
5
votes
3answers
39k views

how to checkin all checked out files via powershell?

We have in our environment installed Gary LaPointe powershell cmdlets and I found this script Get-SPCheckedOutFiles which returns all checkedout files, now I need to forcely check them in, not ...
4
votes
2answers
5k views

Adding Read-Only-permissions to a list for a Sharepoint Group using Powershell CSOM

I am trying to add read-only-permissions to a specific group called "Students" for a list I have created called "Quiz". I have to use PowerShell CSOM, and in every other tutorial I've been through, ....
4
votes
2answers
10k views

updating multivalues lookup column using PowerShell in SharePoint 2013

I have a multi values lookup column. I'm trying to update another column on another list from a lookup column. So let say I have values in a lookup column like so: 1;#Open 2;#Close 3;#Closed I want ...
4
votes
1answer
6k views

export / import spweb problem with DataConnectionLibrary feature

I'm attempting to export a subsite from staging to production using powershell and export-spweb and import-spweb. This worked just fine from staging to development. When we try to run this on ...
4
votes
2answers
4k views

Using PowerShell how do I change the column ordering for a SharePoint List

Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well) ...

1
2
3 4 5
7