Posts

Showing posts with the label PowerShell

All Webs and Site Templates in use within a Site Collection PowerShell Script

$site = Get-SPSite "http://yoursite" foreach ($web in $site.AllWebs) { $web | Select-Object -Property Title,Url,WebTemplate } $site.Dispose()

Get list of all users present in a site under different SharePoint Groups

Background: I wanted to see all users who have access to the SharePoint site and belongs to which SharePoint group. Solution: Below SharePoint powershell script helps me to get list of users group wise- $site = Get-SPSite <Provide Site Collection URL here> $web = $site.OpenWeb() $groups = $web.sitegroups foreach ($grp in $groups) {      "Group: " + $grp.name;      $groupName = $grp.name      write-host "Group: " $groupName   -foregroundcolor green      foreach ($user in $grp.users) {              "User: " + $user.name              write-host "User " $user.UserLogin   -foregroundcolor red      } } Usage: Navigate to Script location and type below command- GetUsers.ps1 This will show output on screen. Navigate to Script location and type below command- GetUsers.ps1 | Out-File C:\Output.csv This will generate output as csv file. " C:\Output.csv " is

Access Requests Explained for SharePoint 2013 – With a Script to Assign Default Groups

One of the features of SharePoint that has been around is the ability for users that need access to a site, and are denied access, through the “Request Access” process . To enable or review these settings, * go to “ Settings ” > “ Site Settings ” > “ User and Permissions ” and click “ Access Request Settings ” . In the “ Access Request Settings ” dialog box, select the check box next to “ Allow access requests ” then provide an email address of the individual you’d like to manage this feature. * If a site has multiple groups with the same permission levels (Owners, Members and Viewers) but there is not an assigned default group, then you will see the problem where access requests will either not display for the impacted user or an owner will not be able to approve requests. Here’s a Windows PowerShell script to change each of the groups for a site so that each is identified as the default group for Members, Owners and Visitors You’ll need to a the “ Microsoft.S

SharePoint 2013 Site Template ID List for PowerShell

Template ID Title GLOBAL#0 Global template STS#0 Team Site STS#1 Blank Site STS#2 Document Workspace MPS#0 Basic Meeting Workspace MPS#1 Blank Meeting Workspace MPS#2 Decision Meeting Workspace MPS#3 Social Meeting Workspace MPS#4 Multipage Meeting Workspace CENTRALADMIN#0 Central Admin Site WIKI#0 Wiki Site BLOG#0 Blog SGS#0 Group Work Site TENANTADMIN#0 Tenant Admin Site APP#0 App Template APPCATALOG#0 App Catalog Site ACCSRV#0 Access Services Site ACCSRV#1 Assets Web Database ACCSRV#3 Charitable Contributions Web Database ACCSRV#4 Contacts Web Database ACCSRV#5 Projects Web Database ACCSRV#6 Issues Web Database ACCSVC#0 Access Services Site Internal ACCSVC#1 Access Services Site BDR#0 Document Center DEV#0 Developer Site DOCMARKETPLACESITE#0 Academic Library EDISC#0 eDiscovery Center EDISC#1 eDiscovery Case OFFILE#0 (obsolete) Records Center OFFILE#1 Rec

How to: Perform a SharePoint 2013 site collection visual upgrade with PowerShell

Image
To begin the process, I have restored a copy of my content database from my SharePoint 2010 environment on the SQL Server for my SharePoint 2013 environment.  The first thing we need to do is mount the content database with Mount-SPContentDatabase . In SharePoint 2010, this process would actually update the database and perform the upgrade.  Now, it actually just attaches the database but leaves the site running in SharePoint 2010 mode.  Effectively you are running a full copy of SharePoint 2010 inside SharePoint 2013.  You can do this and upgrade each site collection one at a time to make the transition process a bit easier. Typically, when you are doing this, you’ll execute Test-SPContentDatabase first and resolve any reported issues.  Just like in SharePoint 2010, you need to install all of your customizations via solution package prior to mounting.  Test-SPContentDatabase can help you find some of these customizations if they are missing.  For simplicity, I am go

Unable to open the Timer Job Definition in the Central Administration "Unknown Error"

Issue : Unable to open the Timer Job Definition in the Central Administration "Unknown Error". Cause: Was able to browse through the Job History and the status. Found that there were couple of timer jobs stuck from 2 months and causing this issue.  Fix: Ran the " stsadm -o exeadmsvcjobs ", but still the error was persist and the jobs were not getting removed. Ran the following commands and removed the stuck jobs: Get-SPTimerJob | ? {$_.Displayname -like “Name”} $job = Get-SPTimerJob -id "" $job.Delete()

Windows PowerShell for SharePoint 2013

Use Windows PowerShell to administer SharePoint 2013 Windows PowerShell Documentation on TechNet This section of the TechNet Library contains web copies of the core Windows PowerShell Get-Help topics. The section also has web copies of the Windows PowerShell Getting Started document, the PowerShell.exe help, and a Windows PowerShell primer. Scripting With Windows PowerShell The home page for Windows PowerShell scripting learning resources. Windows PowerShell Owner's Manual web-based guide for getting started with Windows PowerShell. Windows PowerShell Quick Reference Downloadable copy of the Quick Reference document that is installed with Windows PowerShell. As you read these resources, consider that the following concepts and cmdlets are useful ones to learn before you use Windows PowerShell for SharePoint 2013: Get-Command Get-Member Get-Help Aliasing Piping and the Pipeline in Windows PowerShell Cmdlet Pa