SharePoint, PowerShell, .Net and other stuff I spend too much time on...
5/20/2014
Cincinnati SPUG May Meeting - eDiscovery
5/04/2014
Sometimes you feel so dumb… PowerShell Mistake!
I'm trying to search SharePoint using PowerShell and REST web services…
PS C:\> Invoke-WebRequest http://spserver/sites/demo3/_api/search/query?querytext='sharepoint' -UseDefaultCredentials
I keep getting:
Invoke-WebRequest : The remote server returned an error: (400) Bad Request.
I spent the last hour doing web searches for "400" errors and Invoke-WebRequest and SharePoint and search etc.
Talk about the forest and the trees… The problem was with basic PowerShell strings in parameters. The single quotes got me! Quotes around strings should be required on parameters, but PowerShell lets you be lazy and leave them off… most of the time. Here's the correct solution:
PS C:\> Invoke-WebRequest "http://spserver/sites/demo3/_api/search/query?querytext='sharepoint'" -UseDefaultCredentials
The only change was the addition of double quotes. Everything now works as expected! A full hour wasted climbing the wrong trees.
In the forest of ASCII, watch out for the quote trees…
.
4/28/2014
SharePoint 2013: RegistrationId List Template Type IDs Updated!
I have updated the "SharePoint: RegistrationId List Template Type IDs" article to include the new 2013 list types. This time, I used a PowerShell script to dump the SPListTemplateType enumeration. Note that there are many template IDs that are not in the SPListTemplateType enumeration and generally can only be found in investigations of the databases and other documentation.
The PowerShell script: (Works in both SP 2010 and 2013)
PS C:\> $SPtt = [Microsoft.SharePoint.SPListTemplateType]
PS C:\> [System.Enum]::GetNames($SPtt) | select {$_}, {[int][System.Enum]::Parse($SPtt, $_)}
.
4/23/2014
Recent Changes to the SharePoint 2013 UI
About a month ago I wrote a little post about Office 365 / SharePoint–a Moving Target that included a mention about an April 9th update to the UI. Well, on April 21st the April 9th update finally appeared in one of my Office 365 subscriptions. (The update has not shown up in the other subscriptions yet.)
What are the changes? An updated "hero bar", or navigation bar has been added above the libraries. My favorite change here is the new "Manage" link. My least favorite change is the Share button… it currently seems to be broken!
One strange thing! The "or drag file here" text is now gone. Drag and drop still works, but there's no longer a reminder for the users.
Here's the "before" navigation:
Here's the "after" navigation:
When the library is displayed in a web part the menu bar is shortened and no longer includes "sync" or "manage".
Clicking "new" displays the same menu as before… except the "upload" link is now gone. (It's been moved to the new navigation bar.)
Here's the before and after of the "new" menu:
Clicking the "upload" link displays the popup you would get from the Upload button in the ribbon, or the upload link in the old "new" menu.
The "SYNC" button has been removed from the top of the page and is now in the new "hero bar".
The "edit" button opens the Office document in the client app (Word, Excel, etc.) on the local PC. (Not sure I like this as opening is Office Web Apps is nice.)
The "manage" button displays the old dropdown menu that you had to get to in 2013 using "…", "…".
As far as the "share" button… both the new share button and the old "…","..." share button seem to be broken! They display all of the expected prompts, but do not actually break inheritance on the item or grant the requested permissions…
.
4/21/2014
Cincinnati SharePoint User Group Meeting April 24th 2014!
This Thursday! 6:00 PM at MAX!
Topic: App Development in SharePoint 2013
Speaker: Arun Aggarwal
@cincyspug
.
4/16/2014
Change the SharePoint 2013 Suite Bar Text
Hacking around with PowerShell always finds some new property or method that I would never have gone looking for! This time it is a SPWebApplication property that sets the text in the "Suite Bar".
The default text in the suite bar is "SharePoint" for on premises installs and "Office 365" plus an icon for the cloud versions. The actual HTML for the text is "<div class="ms-core-brandingText">SharePoint</div>".
Examples from on premises SharePoint and Office 365:
… but… I don't know how to get access to the SPWebApplication object in Office 365 from PowerShell! You can still change it using JavaScript. (See notes at the end of this article.)
Using PowerShell
The following PowerShell will list the Suite Bar text for each of your web applications:
PS C:\> Get-SPWebApplication | Select DisplayName, SuiteBarBrandingElementHtml DisplayName SuiteBarBrandingElementHtml ----------- --------------------------- My Sites - 82 <div class="ms-core-brandingText">SharePoint</div> SharePoint Intranet - 80 <div class="ms-core-brandingText">SharePoint</div> SharePoint Testing - 81 <div class="ms-core-brandingText">SharePoint</div>
To change the text, access your web application object (mine will be the 2nd in the list, so [1]), and set the SuiteBarBrandingElementHtml to your new text. You will probably want to include the default CSS class for consistency. Remember to do the .Update, or nothing will be saved!
PS C:\> (Get-SPWebApplication)[1].suitebarbrandingelementhtml =
"MA<span style='color:#FF2020'>X</span> Technical Training" PS C:\> (Get-SPWebApplication)[1].update()
The above will change the text to:
If I include the DIV and class from the default text then is will look like this:
Can't use PowerShell?
You can use JavaScript or jQuery to change the Suite Bar title text in both on premises SharePoint and Office 365. All you need is some code to find the DIV with the class of ms-core-brandingText and change it's contents. When working with Office 365, be aware that the text is also a hyperlink to https://portal.microsoftonline.com/, so be careful not to break it!
In jQuery it might look like this:
$('.ms-core-brandingText').text('Your New Title Text');
Here's an article about changing the text in Office 365: http://sharepoint-community.net/profiles/blogs/changing-the-office-365-main-link-text
Have fun and don't break anything!
.
4/14/2014
Cincinnati PowerShell User Group meeting announcement
From Rob Dreyer, the organizer:
Our first meeting in 2014 will be extra special. Throughout 2014, Dr. Ferdinand Rios, the CEO of SAPIEN Technologies, Inc. is touring around the world. Last week, I received word that on Thursday April 17th he will be coming to MAX! I nearly fell out of my seat when I heard.
Please register here: http://www.meetup.com/TechLife-Cincinnati/events/154731982/
See you there!
-
Thursday, April 17, 2014
6:00 PM to 8:30 PM
-
MAX Technical Training
4900 Parkway Dr
Suite 160
Mason, OH (map)39.304155 -84.313302
How to keep track of the PowerShell user group:
- http://www.meetup.com/TechLife-Cincinnati/events/154731982/
- http://powershellgroup.org/cincinnati.oh
- Twitter: #CincyPowerShell
4/04/2014
Reduce Spacing in a SharePoint 2013 Top Link Bar
The top link bar in SharePoint 2013 and Office 365 adds a lot of space between each menu item, 30 pixels to be exact. You can tighten this up quite a bit by changing the default spacing with a block of CSS added to your master page.
Default spacing:
After the CSS change below:
Add the following to your master page somewhere after the CssLink control (<SharePoint:CssLink runat="server" Version="15"/>). Just before the </head> tag works.
<style> .ms-core-listMenu-horizontalBox li.static > .ms-core-listMenu-item { padding-right:4px; margin-right:2px; border-right:1px solid; } </style>
If you just want to adjust the space and not add the lines, then only change the margin:
<style>
.ms-core-listMenu-horizontalBox li.static > .ms-core-listMenu-item
{
margin-right:5px;
}
</style>
.
4/02/2014
Free eBook on Migrating to Office 365
I love free stuff, and I love books! Apress is making this new 680 page book available as an eBook for free, or as paper book for $39.95.
Office 365: Migrating and Managing Your Business in the Cloud
By Matt Katzer , Don Crawford
Go to Apress to get the EPUB, MOBI or PDF formats.
http://www.apress.com/9781430265269
You can also buy the paperback version at Amazon.com or get the Kindle version for free!
And while you are at it, take a look at this one too…
Rethinking the Internet of Things
A Scalable Approach to Connecting Everything
By Francis daCosta
Go to Apress to get the EPUB, MOBI or PDF formats.
You can also buy the paperback version at Amazon.com or get the Kindle version for free!
Even more here: http://www.apress.com/apressopentitles
.
3/29/2014
Office 365 / SharePoint–a Moving Target
If you support SharePoint on-premises and Office 365 in the cloud then you are well aware that there are differences that impact you, your users, your help desk and your governance plan (of course!). You can manage changes and updates when working with your on-premises servers by choosing when and if you apply service packs, features and updates. When it comes to Office 365 you have no control… changes just happen!
To keep up to date…
- Frequently visit the Office 365 Admin Center and click the Message Center link
- Follow the RSS feed of the SharePoint Team's blog
- Go to SharePoint user group meetings, SharePoint Saturday events and SharePoint conferences (like the SharePoint Cincy event!)
- Explore the Office 365 Preview Features http://community.office365.com/en-us/blogs/office_365_community_blog/archive/2013/08/01/what-in-preview-means-for-some-new-sharepoint-online-features.aspx
February updates
Last month saw several changes, a few available for your on-premises servers as part of Service Pack 1.
- SkyDrive renamed to OneDrive
- Office Web Apps renamed to Office Online
- Changes to Office Online and OneNote Online
- More info on the February updates: http://blogs.office.com/2014/02/28/whats-new-february-2014/
April 9th Updates
SharePoint Online / Office 365 will receive updates to SharePoint document libraries with the addition of a new command bar. The command bar will include frequently used tasks such as: new, upload, sync, edit, manage, and share. I have not found anything about similar updates to on-premises SharePoint.
You can see a partial screen capture of the new command bar at the link below. Notice that the "new document or drag files here" has been replaced with "new upload sync edit …". Go to the page below and scroll down to each of the step 3's.
.