Quantcast
Channel: PowerShell – Ryan Ball
Browsing index pages (15 articles)

Invoke-SqlCommand

For whatever reason, sometimes you just can’t upgrade the installed version of PowerShell on a server. In this case, I wanted to make use of the Invoke-SqlCommand command. The most simple way around...

View Article


Adding users to a Yammer group

I’m making a note of this blog post as I can foresee a future need to be able to subscribe specific subsets of users to Yammer groups. How To Add A User To Yammer Group Using PowerShell Also see the...

View Article


Task Scheduler & PowerShell

To manage repeating tasks, its common for us (the team I work with 9-5) to automate things with a PowerShell script and then schedule it to repeat at specific times using a scheduled task. When I...

View Article

Creating SharePoint alerts via CSOM

I’m posting this as a useful reminder. It outlines how alerts can now be created via CSOM. New SharePoint CSOM version released for SharePoint Online – February 2017 The included code sample is in C#,...

View Article

Secure credentials within PowerShell

For PowerShell scripts that need to access resources (e.g. a site within SharePoint) and be run as scheduled tasks, I will normally use an encrypted password… Read-Host "Enter Password" -AsSecureString...

View Article


SharePoint Content Type IDs

This is a handy PowerShell snippet for returning a list of all Content Types and their IDs within a SharePoint site. $site = Get-SPSite http://www.domain.com $web = $site.RootWeb ForEach( $contentType...

View Article

Using PowerShell To Analyse The Contents Of A Folder

# The path to interrogate $targetPath = "X:\Shared\FolderToBeInterrogated" # The path to save the exported report $exportPath = "C:\Reports" # Recursively get all files Get-ChildItem -Path $targetPath...

View Article

Trouble Shooting SharePoint Errors

For viewing in command prompt: Get-SPLogEvent | ?{$_.Correlation -eq "<GUID>"} | SELECT Area, Category, Level, EventID, Message | Format-List Export the results as text file: Get-SPLogEvent |...

View Article


How Many Users In An Active Directory Group?

This is a useful PowerShell snippet for determining how many users there are in an Active Directory group. (Get-ADGroup "CN=MyGroup,DC=domain,DC=co,DC=uk" -Properties *).Member.Count

View Article


Upload a .STP Template File

This is a quick way to programmatically upload a .STP template file within SharePoint using PowerShell – useful if you’re transferring list templates from a development to a live environment. $web =...

View Article

Downloading Solutions from Central Administration

This is a handy little PowerShell snippet that I needed to use today. There were two .WSP solutions installed within the SharePoint farm and I couldn’t locate the original source code. $farm =...

View Article

PowerShell Snippets for Microsoft Exchange

These are two very handy PowerShell snippets that I use again and again within our work environment. Retreive List of All Group Members Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 csvde...

View Article

SharePoint & Item-Level Permissions within Document Libraries

I have a love/hate relationship with SharePoint. Often the things that should be really simple, just aren’t. Take the “Item-level Permissions” option for instance. Every list appears to have this...

View Article


Getting a list of all files

I do like PowerShell. Something that used to take 10-20 lines of VBS code, such as generating a report of all files stored within a folder, can now be reduced to a single line. Get-ChildItem...

View Article

Hiding Fields in SharePoint 2010

This is a useful peice of PowerShell script to hide specific fields from the Edit form. ShowInEditForm can also be amended to ShowInNewForm. $assignment = Start-SPAssignment $web = Get-SPWeb...

View Article

Browsing index pages (15 articles)


Latest Images