Welcome!

Microsoft Cloud Authors: Lori MacVittie, Elizabeth White, Yeshim Deniz, Serafima Al, Janakiram MSV

Related Topics: Microsoft Cloud, Silverlight

Microsoft Cloud: Blog Feed Post

PowerShell Basics for SharePoint 2010

I thought I would share a few basics I picked up at Ignite and various other places along the way

SharePoint Archiving Journal on Ulitzer

I’m not expert in PowerShell, but I thought I would share a few basics I picked up at Ignite and various other places along the way when it comes to getting started with PowerShell.  The easiest way to issue SharePoint commands with PowerShell is by running the SharePoint 2010 Management Shell located under Microsoft SharePoint 2010 Products in your Start Menu.  However, it is good to understand what this shortcut actually does.  PowerShell works by using the concepts of snapins.  A snapin is simply a DLL installed with gacutil and installutil that implements a particular interface.  This means you can write your own snapins to do whatever you want.  All of the SharePoint commands are found in Microsoft.SharePoint.PowerShell.dll.  So what this shortcut does, is it runs PowerShell with a script located at the path below.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1

This script simply uses the Add-PSSnappin command to load the SharePoint commands.  If you started PowerShell by using some other link, you can also load the SharePoint comamnds by using this command.  Note that the name is always specified without .DLL.

Add-PSSnapin Microsoft.SharePoint.PowerShell

Working with PowerShell is in a lot of ways similar to working with a regular command prompt, it is just a lot more powerful.  All of your familiar DOS commands will work because they have been aliased to child items.  For example, Get-ChildItem is how you display the contents of the current folder in PowerShell, but you can also just type in dir to get the same results.

PowerShellDir

Knowing the name of the snappin lets us do a few things.  First, we can get a list of all of the commands contained in it by using the Get-Command command with the –PSSnapin parameter.  For example:

Get-Command –PSSnapin Microosft.SharePoint.PowerShell

PowerShellGetCommand

Of course, there are 500+ SharePoint PowerShell commands returned so it makes that list difficult to deal with.  So you can use some old school command prompt tricks to make the list more manageable.  You can issue the command and hit the Pause key (lol).  You can, use the | more technique to view one page at a time.

Get-Command –PSSnapin Microosft.SharePoint.PowerShell | more

You can also redirect the output to a text file like this.

Get-Command –PSSnapin Microosft.SharePoint.PowerShell > commands.txt

Then you can just open the file in notepad or the editor of your choice.  If you want a more verbose description of how each command is used, you can use the Format-List command and pass it specific property names.  Notice the properties I specified (Name, Definition) I just got from the table above.

Get-Command –PSSnapin Microosft.SharePoint.PowerShell |  Format-List Name, Definition

PowerShellGetCommandList

This is great, but then you might want to know more about the specific syntax of a command.  For this you can use the Get-Help command.  Just execute it followed by the name of the command you want information on.  For example if I want to know about Get-SPWeb, I would issue.

Get-Help Get-SPWeb

It would return something that looks like this.

PowerShellGetHelp

Once nice thing about PowerShell is that you can use tab to help you complete commands.  For example you can type “Install-SP” and then press tab and it will cycle through the available commands.  What is even better is that you can also use the tab key to add the parameters to the command.  This is useful for when you can’t remember the exact parameter name.

Another thing I really like about PowerShell is that many times if you leave off a parameter, instead of just giving you an error, it will prompt you for the value.  For example, if I want to create a new site collection, I use the New-SPSite command.  I don’t remember the parameters, but it starts prompting me for things like the URL and owner name.  And of course you can always use Ctrl+C to break out of the command if you change your mind.

PowerShellPrompt

There is a ton you can do with PowerShell and I won’t be able to cover it all in this one post.  The power is that it allows you to string together complex commands together to get things done.  If you want to build a script, you simply start by creating a .ps1 file.  You can build this in notepad.  There is also a PowerShell Integrated Scripting Environment (ISE) that will allow you to actually debug your scripts.  One thing to be aware of is that to execute scripts, it requires an execution policy to be set.  Chances are this is already set appropriately, but if its not, your script will not run.  The three possible settings are restricted, unrestricted (prompt to run), and bypass.  I think most people set this to bypass (although I am sure there are security considerations) with the following command.

Set-ExecutionPolicy bypass

There is so much to say about PowerShell.  I hope this post serves as a good starting point to start exploring what you can do with it.  I’ll be covering more advanced PowerShell topics in the future.

Read the original blog entry...

More Stories By Corey Roth

Corey Roth, a SharePoint Server MVP, is an independent consultant specializing in Cloud technologies such as Azure and Office 365. He also specializes in mobile development. Corey serves as the product manager for two cloud-first mobile app platforms: BrewZap and HappenZap.

@ThingsExpo Stories
Announcing Poland #DigitalTransformation Pavilion
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
CloudEXPO | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.
Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker c...
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at the Santa Clara Convention Center in Santa Clara, CA. The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
In past @ThingsExpo presentations, Joseph di Paolantonio has explored how various Internet of Things (IoT) and data management and analytics (DMA) solution spaces will come together as sensor analytics ecosystems. This year, in his session at @ThingsExpo, Joseph di Paolantonio from DataArchon, added the numerous Transportation areas, from autonomous vehicles to “Uber for containers.” While IoT data in any one area of Transportation will have a huge impact in that area, combining sensor analytic...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Michael Maximilien, better known as max or Dr. Max, is a computer scientist with IBM. At IBM Research Triangle Park, he was a principal engineer for the worldwide industry point-of-sale standard: JavaPOS. At IBM Research, some highlights include pioneering research on semantic Web services, mashups, and cloud computing, and platform-as-a-service. He joined the IBM Cloud Labs in 2014 and works closely with Pivotal Inc., to help make the Cloud Found the best PaaS.
It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
I think DevOps is now a rambunctious teenager - it's starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.