Like a lot of administrators I work on a couple of different PC’s, and keeping my PowerShell profile the same on each machine is a bit of a pain. I decided it was time to do something about that! With these changes I can easily add to my profile and have that change happen on every PC I use!
Normally I’m a big fan of using Group Policy to map printers and network drives, it’s just so much easier to use and configure and anyone can do it. No extra scripting knowledge needed. And it just works. Simple is best. But sometimes it doesn’t and you need to go to plan B. Mapping printers at work turned into just that situation and here’s how I solved it.
It’s been a couple of days since I’ve returned from SpiceWorld 2013 and I’m still trying to digest the experience. First off I must say I have never been to a tech conference where I’ve had quite as much fun as I had here. The Spiceworks community has always been something different–an amazing collection of people who just want to help each other out–and that community translates almost perfectly to the SpiceWorld experience. Read on, if you’d like!
Well, it’s 5am and I’m flying out to Austin, Texas for SpiceWorld in just a few hours. Can’t seem to make myself relax and get some much-needed shut-eye so why not write something here?!
So tomorrow is the big day for Rob and I’s PowerShell introduction session and I’m really pleased with how the presentation came out. It’s going to be interactive as we build a tiny script with the audience. There are only about 9 slides and 3 of them are introductory and 1 is an “Any Questions?” slide. The rest is just to get us to the script writing stage. I don’t know about you, but any presentation that drones on with a ton of slides, especially when the speaker is essentially just reading off the slide, is usually not a good presentation! I think Rob and I have managed to avoid that with this one. The session itself is only 45 minutes and if you’ve done anything with PowerShell you know that’s not nearly enough time to even really get you started so we’re focusing on giving you the tools to write your own scripts using the three base commands: Get-Command, Get-Help and Get-Member. I’ve written before about all three before here in my Getting Started series.
I’ve written a few scripts recently that I’m pretty proud of that I wanted to mention:
Get-DiskInfo - Really PowerShellisk type script for getting disk information from your servers and workstations. Accepts all kinds of pipeline input and outputs objects, both a default set and more extensive information if you use Get-Member.
Export-PrinterInfo – This is a script I’ve had for quite a while that I wrote for someone on Spiceworks but ended up using at work too. Finally decided to publish it on Spiceworks. It’s a pretty comprehensive disk information script that saves everything to an Excel spreadsheet.
Send-PasswordExpirationNotifications – Just released this script. It’s an update of a successful vbScript I wrote a few years back that will send users an email when their password is getting ready to expire. It uses an old-fashioned INI file for configuration but really allows you a lot of flexibility. Depending on how much effort you put into it you can really customize your outgoing notification so one usage of the script can be totally different looking from another. All without touching a bit of code! It also fully supports fine-grained password policies for those of your who use those.
With the experience of using an INI file I gained from the Send-PasswordNotifications script I also have a new version of the Employee Directory ready. This script has some complex configuration requirements that parameters can handle, but they’re not necessarily user-friendly. I really struggled with the decision on whether to use named parameters–which would be much more in keeping with PowerShell best practices–or going with an external configuration file. I decided to stick with best practices, but in the real world of testing and changing the script I’ve found the parameters to be unwieldy. Therefore the changeover to a configuration file. Haven’t published it just yet because I want to test it in the real world first and I had one technical issue that I managed to code around but I’m not convinced it’s the best way of going about things. If you’d like to take a look at the problem and help me out, please feel free to take a look and let me know your thoughts! The thread can be located here.
OK, just about time to get ready for my flight! Wish me luck and I look forward to meeting you at SpiceWorld and I hope you come to the PowerShell breakout session, even if you’re a pro!
Recently I’ve been involved with upgrading/migrating my Exchange server from 2003 to 2010. It’s one of those projects where there aren’t going to be a ton of tangible benefits for my users and what with all of the other things going on at work I kept putting off. But no more. Let’s wrap this puppy up and move on. Co-existence was configured for awhile but now I just needed to move the mailboxes in an orderly fashion. We’re not a big company, but I’ve always kept a pretty liberal email retention policy so I’m paying the price for that now with large mailboxes and a lot of time needed to move things.
Read on to see how I used PowerShell to help me with this.
Really excited that I’ll be attending Spiceworld 2013 this year. I’ve been using Spiceworks software since 2009 and been very active in their community most of that time but this is the first time I’ve attended their yearly conference. I think it will be a great way to meet a lot of the people I’ve been interacting with for years but couldn’t tell you what they look like to save my life!
I’m also excited to be working with another Spicehead, Rob Dunn, on the Introduction to PowerShell 3.0 breakout session. Rob and I are working hard to present PowerShell to beginners and hopefully cut down some of that initial learning curve that no doubt exists for newbies. We really wanted to give a hands-on experience to learning PowerShell too, so no endless list of slide’s and lecture. Our plan is to present 2, 3 maybe 4 slides than just sit in front of a PC and write a script with the whole group. We’ll have to guide the script a bit as we only have an hour, but the idea is to present 3 different script ideas and let the group decide which script we’ll write. From there we’ll show you how you can use PowerShell itself to help you write the script–bouncing from the shell to the ISE and back again until we have a rough little script written.
I’ve never done anything like this, and I’m thankful that Rob will be with me. Rob has been with Spiceworks even longer than I have and written some great scripts. His expertise is mostly with vbScript, which I think is really nice as he can bring that perspective to the PowerShell experience. I’ve written quite a lot in vbScript too so it’s nice that we can speak the “short-hand”, without translating back and forth between languages! It’s also been exciting that we both seem to have the same ideas–so far!–on what and how we want to do this so we can really focus on trying to bring the best and most interesting session we can. Nothing worse than sitting there and having some guy sit behind a desk and drone on, essentially reading his slide deck to you! This will NOT be that. We’re going to be sitting with a PC on the screen writing the script with you. Explaining why we do things the way we do them, and running into the same problems you would run into while writing a script and solving the problems right there.
So come down to Austin and join us at Spiceworld, find out what’s really happening in the world of the SMB and maybe learn a little PowerShell along the way.
Want to send alets to your Smartphone and Pebble directly from Powershell? Read on!
You may or may not know that I recently purchased a Pebble, and while everything isn’t perfect with it I have really found myself enjoying it and wanted to write a bit about my experiences with it! Read on, if you’re interested!
Had an interesting thread come through on Spiceworks the other day that required some detective work with WMI. In the past, when I did WMI calls with vbScript I usually had to Google it and find someone else who’d done what I wanted to do and modify their script. But with Powershell you don’t have to dig through different blogs, or try to slog through the MSDN documentation, now you can just inspect the data and do it directly. Here’s what I did.