PowerShell Saturday Chattanooga 2018

This weekend I attended my first ever PowerShell Saturday (and Pre-Conference) event put on by some great folks here in Chattanooga on August 10th and 11th.

The Friday pre-con event was given by none other than the famous Jeff Hicks Blog Twitter

Loved all the scripts Jeff showed during his pre-con

Starting off the day Friday, Jeff showed us some great scripts that I will try to go back and post into my Git Hub area as well.

In the past I’ve always tried one liners and other blogs that linked to scripts in order to figure out a PowerShell solution, but Jeff did a great job on introducing a familiar layout and format on how to write scripts in a well thought out and formatted way so they could be easily read and digested by anyone else that comes across them in the future.

I’ve really took this to heart as a personal challenge and will try doing this myself in the future since I’ve been looking into writing more scripts lately.

The entire day was packed with some much good material, but that was just the first day. Tomorrow is the Saturday conference.

Scraping the bleeding edge of tech here…lol

The Saturday conference started with a great talk about Writing award winning PowerShell from Mike F Robbins. He gave a great talk with many tips on how to take your scripts to the next level. Mainly around focusing on writing functions going forward and not scripts necessarily. His blog has tons of great helpful tips and can be found here.

Next session was on Taking control of profile scripts by Tim Warner. Tim is a great guy and very helpful through his online videos at PluralSight and many other articles that he has posted over at https://techtrainertim.com/.

He went into how you can use profiles in PowerShell to accomplish different tasks and how to modify and change them to help.

My next session after this was Troubleshooting with PowerShell by Jonathan Warnken. He had a great session and brought up some great ideas that I could use to possibly create some good helpful scripts in my day to day work. You can find him on Twitter @MrBoDean

The next session was back with Tim Warner again and was all about getting started with VSCode and using it for PowerShell development. Jeff Hicks covered this topic a bit on Friday, but Tim, went into deeper details and really showed some cool items on how to start getting your hands dirty when creating new scripts in VSCode.

My last session of the day was with Jeff again peering Under Cover with PowerShell and more tips on producing better quality scripts going forward. Some of these related to write-progress and default parameter values in scripts along with using verbose output in scripts to help errors and using the Trace-Command (?) option to improve on things as well.

I have to say this was a great event and I want to thank everyone involved with putting it on. The PowerShell user group in Chattanooga most of all because without them, we could not have had this event at all. If you want to know more and learn more, find them on https://twitter.com/chatpsug

Advertisements

AutoLab to create quick test labs

One of the best way to learn how to do things in the field of technology is to actually get your hands dirty and practice doing something. That’s one method I have followed for years and has helped me learn most of what I know today.

One way that helps do this is with creating virtual machines through software like Hyper-V or VMware or another program to help build and run things locally on your own machine. I’ve been doing this for a while, but it’s always a struggle I find to quickly spin up machines with certain things enabled and configured a certain way.

I’ve tried different methods in the past to help streamline things like this, but the other day I was made aware of a project on GitHub that really looks like it could be a great help for people who need things built a certain way quickly.

The project is called AutoLab and was created by Jason Helmick b|t a great trainer who has made some fantastic online courses through Pluralsight and other venues as well.

I’ve watched several of his PowerShell training videos in the past to help learn new things, but I think there is some real value here in AutoLab. It only works in Hyper-V but it even helps enable it on a Windows box as part of the installation process.

The basis of the project is another GitHub project called Lability.

The features of this project combine PowerShell Desired State Configuration (DSC) to use config files and other functions to quickly build up a lab, refresh a lab, take a snapshot of multiple VM’s at once, and even when you are done then tear down the entire lab in one command.

HOW AWESOME IS THAT!!! Very awesome indeed!

Right now there are many configurations that people have added to in order to setup different scenarios.

I think there’s some great potential here for this to quickly build up test labs when you need to learn a particular skill or subset of features on a new product.

If you get a chance, check it out and try it out and give feedback to the creators.

I’m going to do my part to help this take off because it’s a great idea!

Thanks and enjoy!

-BJ

 

Office Files too big? Inspect them!

Today I had a problem with a group of users that were trying to work with a very large PowerPoint file in SharePoint and didn’t realize until I downloaded a local copy of the file that it was too big to work with through Office Web Apps.

So I did some digging around to see if there was a way to possibly shrink the files, so I ended up finding something here:

https://support.office.com/en-us/article/remove-hidden-data-and-personal-information-by-inspecting-documents-presentations-or-workbooks-356b7b5d-77af-44fe-a07f-9aa4d085966f

In PowerPoint 2016 you can find the option here:

After doing a bit more digging, this actually applies to all Word, Excel, and PowerPoint versions from 2016 on down to even the Office 2010 versions.

So now I’d be curious if this could be automated somehow to do some major cleanup in PowerShell or something? Hmmm… maybe for another blog post later… hehehe.

Hope this helps if you need to free up some space in the future.

Enjoy!

GitHub for Sharing

Recently I decided to jump into GitHub to share some of the scripts that I have used and created for my own benefit in order to see if this helps out any regular visitors of my blog as well.

You can check it out over at https://github.com/fentressbj

Going forward I will try to capture all of the relevant scripts that I have used over the years for configuration for building out different setups.

Of course if I use a script from another author I will absolutely try to provide credit. I think its dishonest not to do that if its not something you have written from scratch. If you take one and improve it or modify it, I think the original author should be given credit still. These days its extremely hard to be a content creator given some attitudes to share things without giving credit.

I hope this helps others and everyone enjoys my dive into learning more and more about GitHub.

-BJ

Mind the Site Locks when Move-SPSite Fails

Recently I was working on a migration of a couple of big sites moving them to their own content databases and it didn’t exactly turn out as I planned.

So more than anything, I wanted to use this post to describe what happened and mention some tips and other things that may help others out in the future if you ever run into trouble when trying to break out sites into their own databases.

Here are the major events that happened in the migration process:

  1. Created DB under central admin
  2. Used Move-SPSite to move one site from another content database
  3. Content stuck on Move-SPSite, never finished
  4. Restarted all servers
  5. When came back up, new destination database was in recovery
  6. Recovery process used all SQL resources, major slow down of farm (sad time)
  7. Looked into SQL logs to check status of recovery thinking new destination database would come back up
  8. Actually after recovery finished, I still had no access to content created in new content database
  9. Checked and under central admin checked site locks and quotas
  10. Turns out entire site still on old source DB
  11. Hadn’t been copied over, even though SQL showed a populated database
  12. Site lock had been switched on all the way to no access
  13. Users going to site would get a 403 forbidden message when trying to access
  14. Went under site locks and cleared the lock
  15. Once this was done, content access returned to normal
  16. Original content and under Central admin still said content was on source DB
  17. New destination content DB under still showed also that it contained no content

So in the end, the big lesson learned here was that even though I could check SQL and see that the new DB contained information, SharePoint hadn’t moved the site over to the new content database.

I did some research and there are timer jobs that run gradual site deletions, but I don’t think they applied here. Either that or I switched back to the original database before anything else was allowed to happen.

In the future, I may just use Backup-SPSite  along with Restore-SPSite because that command also has the ability to specify a new database to put the site into when the backup is restored.

I hope these tips save you some time and headaches in the future.

Enjoy!

ChattPAC wrap up

I wanted to take some time and just thank everyone who came to hear me talk about SharePoint today at the Chattanooga Portals and Collaboration user group.

I really enjoyed the stories that we all shared and some of the ideas we threw around to get more people talking about SharePoint in our corner of the woods.

If you have any questions or would like to see this talk given again, let me know. I really did enjoy giving it and I hope I can tweak it a bit and give it to another group soon in the future.

Thanks!

BJ

You can find my slides at http://slidesha.re/1qqCc1L

I also have a set of links I will try to post here as well.

Create search in SharePoint Foundations 2013 without GUID

When SharePoint Server 2013 was first released, I was curious what new things I could do with it. I saw the new search capabilities, a different look and feel, a similar management interface, and several other BI things that made me happy. I then also realized that I support SharePoint Server and also the free version SharePoint Foundations. In SharePoint Foundations you get SOME of the things that makes SharePoint great (like Search for example), but with Foundations there are usually strings attached to that functionality.

In SharePoint, if you create your farm by clicking on all the defaults and using the wizards your databases look like this:

clip_image001

With SharePoint Foundations 2013, we don’t really have the option to create search by scripting with PowerShell… or do we?

Originally my research pointed me to Gary LaPointe’s blog here.

Which is great because this is in PowerShell and I can understand this, but it still doesn’t give us what we are wanting in the end like this:

clip_image002

Fortunately I found the following post by Jasjit Chopra’s blog here.

Finally!!! What we have been searching for all along! One thing to note at this time is that I have tried this myself on two different farm configurations (a three tier farm and a single box farm) and in both cases the search service and databases were created with the clean names and the service functions just fine.

I’m doing my happy dance now… enjoy!

-BJ