Author: Adam Fowler

Search Group Policy with PowerShell Script

I was looking for a certain Group Policy Preferences setting, where a registry value was being changed. Resultant Set Of Policy (RSOP) won’t help with these, and I couldn’t see a nice PowerShell command for searching through Group Policies.

I put the shoutout on Twitter to see who could help, and Tony Murray came back quickly with a script he’d created, and promptly uploaded to the Microsoft TechNet Gallery where I could download it.

It’s a reasonably simple script (which for me would have taken at least an hour to do beginning to end!) and is very easy to use.

Running the ps1 file will provide you with a prompt, asking what string you’re searching for. Enter the string, and it’ll give back all the Group Policy objects, along with if there was a match or not:

match

After seeing it work, I decided to make one slight change; I removed this section:

    else { 
        Write-Host "No match in: $($gpo.DisplayName)" 
    } # end else 

which results in the script only showing matches, and displaying no output otherwise. Handy if you have a long list of objects to look through!

Thanks again Tony for both writing this and sharing it!

 

Update 20th Dec 2018

Although the script is really useful, it didn’t like special characters for the search string which makes it hard to search for registry settings. I’ve changed how the search function works on a single line, and it now seems to be happy with special characters. This also appears to come at a cost of speed, it’s a bit slower to search. I’m letting Tony know so he can consider updating his master script, but if you want to do it, just replace the line:

if ($report match $string) {

with

if ($report.contains(“$string”) -eq $true) {

Again since it’s not my script I don’t really want to put the entire end result up, but here’s how it should look after the comments section:

Mass Import PSTs To Different Folders In A Single Mailbox

I had a scenario come up where someone had 50 or so PST files. I wanted to add them all into their mailbox, but have a separate folder for each PST’s contents to go to.

This was on Exchange 2010 SP3 but should apply to newer versions too, and this is assuming you have at least Exchange 2010 SP1 – importing was done differently before this.

For starers, ExchangeServerPro covers the basics of PST importing. PeteNetLive delves a bit deeper into batch importing, which was close to what I wanted but had to modify somewhat.

I had the PST files in a UNC path, so started by navigating there – in Powershell, you can just ‘cd //server/sharename/’ (even though “cd” is an alias for “Set-Location”, I can’t help but use it!)

Once in the share that contains the PST files (and it HAS to be a share, can’t be an admin $ share, and needs the correct permissions as per ExchangeServerPro’s article), you can run this command:

dir *.pst | %{ New-MailboxImportRequest -BatchName Recovered -Mailbox alias -name $_.BaseName -FilePath “$_.” -TargetRootFolder $_.BaseName}

This will get the list of files, and run a mailbox import request against each one. “alias” needs to be changed to the mailbox name. The Filepath is just being called as itself “$_.” and the Target Root Folder is using BaseName, which is the filename without the extension .pst.

I’m also using the filename as the name for the job, if you leave that out it’ll hit a wall after 10 jobs and want a unique name (if not specified, the name is MailboxImport, then MailboxImport1, MailboxImport2 etc and hits a wall at MailboxImport9). That also makes it easy if one of the jobs fail, to work out which PST was involved.

This worked really well for me, so hopefully it helps someone else out there!

Review – Microsoft Band 2

Another Smartwatch! How does it compare?

I’ve reviewed the Fitbit Blaze (to /r/fitbit reader’s disgust, as I’m not a fitness freak) and the Samsung Gear 2 Neo – neither of which I loved.

I was hoping the Microsoft Band 2 would be a different experience for me. I still wasn’t fussed about the fitness side of things, so they won’t be covered in this review. A special came up where it was $249AU rather than the $389RRP which was enough of a push to order one.

A few days later, the box arrived. Inside was the nicely presented Band 2:

20160610_132619Semi-unboxed Microsoft Band 2

Setup wasn’t too bad – for my Samsung Galaxy S6, I had to download the Microsoft Health App and sync to my Band 2 (which took me a while to work out, I had to first remove the Band 1 I’d mucked around with ages ago but Microsoft still remembered, before adding the Band 2. That wasn’t clear at all!). Once that was done, I went through the config and changed a few settings around the shortcuts; I hid things like golf which I’d never use.

One thing I’d enabled was the Notification Centre, which was soon disabled again because I realised I didn’t want my wrist vibrating each time a notification turned up on my phone. Just the important stuff was what I wanted, and each of those (phone, sms, email) had it’s own app anyway.

Once it was on my wrist, I felt I couldn’t get it comfy and in the right spot. I’d opted for the large model as I’d measured and medium was too small, but there was something a bit lumpy about it.

20160620_094427Microsoft Band 2 Time Display

I knew battery life was still going to be an issue, with a best of 48 hours from the Band 2, but on paper the rest of the boxes were ticked for me:

Supported by iOS, Android and Windows Phone (so I’m not stuck on a type of mobile phone)
SMS/Email Notifications
Sleep Tracking (with the ability to turn off display at night)
Colour, readable screen.

Gizmodo recently ranked the Band 2 as their 5th best smartwatch (I have no idea why the pictures of the watches are on bikes, rather than wrists), which is a fairly reasonable ranking (even though I disagree with their reasons).

Anyway, if you’re after a detailed review on what the device is and does, there’s plenty of online content about that. Here’s what I found personally after using it for a while:

My Experience – Positives

Although the band can seem clunky and uncomfortable, it’s a matter of getting used to it. For me that only took a day, now I don’t notice it on my wrist at all. It’s not lumpy or awkward after a day (I was wearing an analog watch before this), so if you try one on and it feels weird, that will probably pass.

I also didn’t mind that it’s designed to be on the inside of your wrist. From a resting position, there’s less wrist turn required to see the bottom of your wrist rather than the top.

The screen is easy to read, the buttons easy to press. Touch is responsive, and I found navigating around easy to do. What surprised me the most though, was the device’s ability to write messages:

https://www.youtube.com/watch?v=I-PcGVWLZJo

It works really well and for a short message, I’d generally not bother taking my phone out of my pocket.

Alerts about meetings, SMSes, calls etc work quite well. Feeling a small vibration on your wrist and glancing at it is still much better than fishing your phone out of your pocket.

I also like setting an alarm on the Band 2 itself rather than my smartphone. They don’t sync up, so you’ll have to turn your phone’s off… but a vibrating wrist is a nicer and quieter way to wake up than a sound, especially when you have a sleeping child in the next room.

The setup of the Band 2 is somewhat customisable, where you can decide which icons are shown or not, and what order they display in. There’s also a few third party apps such as The Associated Press’s news, but I didn’t find anything particularly interesting (news isn’t something I want to read on this screen).

My Experience – Negatives

Negatives, there’s a few. Battery life annoys me more than I’d hoped. Charging via the car wasn’t putting through enough juice, so over an hour each day wasn’t enough to keep it going. Charging at home while I get ready in the morning seems to be enough as long as I do it daily. I’ve already forgotten my Band more than once because of this change in routine.

Worse than the battery on the Band 2, is the heavily reduced battery life on my Samsung Galaxy S6 running Microsoft Health (required for the Band 2). For the first time ever, my phone was going flat before a working day was done:

band1Battery usage of Microsoft Health

 

band2That’s a lot of errors!

Microsoft Australia contacted me on Twitter when I posted about this. They said to reinstall Microsoft Health, which I’d already done. From there it was suggested to contact Microsoft Band support online, which was actually either Australian based, or more likely at least in an Australian time zone.

Their recommendation (after telling me “we’ve got you back”) was to reset the Band itself. Skeptical, but without any other option, I tried it. As mentioned previously, the setup process is pretty quick so it’s nowhere near as bad as resetting a smartphone.

Since then, the battery usage of Microsoft Health on my phone isn’t even listed, and my phone’s battery life seems to be back to normal. No errors either! I’m surprised this made a difference, but there you go.

Microsoft Band 2 vs Fitbit Blaze

This is a close one. Fitbit Blaze has a superior battery life, over double of the Band 2. It also (to me) looks a bit nicer, but I do like the watch look (Moto 360 is the winner in that area!), but the Fitbit Blaze is more of a fitness watch first. The Band 2 tries to make everyone happy, and I think does a better job of that. Support was better on the Band 2 by far too.

I’d rate them on par with each other, and you’ll need to work out what’s more important to you on features and differences to pick which one you prefer. Neither are a bad choice!

Summary

I like the Band 2, and it’s a big jump from the Band 1 which felt unresponsive and bulky (I tried one for a few days). I’ll keep going on about poor battery life, because it bothers me so much – hopefully with advancements in OLED screens which have power savings on dark screens due to no backlight… maybe the Microsoft Band 3 will have one. Give me a week without charge and I’ll be happy, so Sunday nights can be charge night!

That aside, it’s an all rounder that does everything it does reasonably well. Readability is quite high, anything that shows up as a notification I can quickly tell what’s going on. Navigation can take a little time to learn; not that it’s difficult, it’s just different to how you’d use a smartphone.

I still think it’s overpriced at $300AU, even though that’s a heavy discount from the RRP of $380. The $250 price I paid makes me feel a little better, but from the outside it doesn’t look like it should cost as much as it does. That price pain applies to all mainstream smartwatches really, and since they’re in the early stages still, we should see a ramp up of the technology used in them in the next few years to come.

 

Printers Showing Offline with Print Server

Quick one here which I thought was notable:

I had an issue where printer queues on Windows Server 2012 were showing as Offline. They worked perfectly fine though. I could ping the printers, so it wasn’t that SMNP was being blocked.

The strange fix was to go into the Printer Properties > Ports tab > Configure Port button. From there, I had to tick the option ‘SNMP Status Enabled’ and press OK (it was off by default). That didn’t fix it, but going back in and turning that option off again and pressing OK, fixed it. The printer I tested this on came online. After doing it to several more printers, each one changed it’s queue status to “Ready”.

SNMP Status Disabled:printer

SNMP Status Enabled:printer

SNMP Status Disabled again:printer

I have no idea why this was needed, or why it worked – but it did, and was reproducible many times. If you run into this problem, it might be the quick fix you need.

queue

It’s more advanced than turning off and on again, as there was the extra step at the start of turning on :)

Conspiracy theories as to the real reason for this are welcome in the comments

 

 

 

 

Azure AD B2B

Azure AD B2B has been a lifesaver for me, in giving external clients access to SharePoint Online portals.

There’s a great TechNet article on how it works and how to do it, as well as a great Channel 9 video demoing how it works if you want to dive deeper, but here’s an overview:

Azure AD B2B lets you invite external people via their email address, to use your Azure resources. For me, that’s SharePoint Online, but you can grant access to other Azure resources too.

The process is really simple – you need to fill out a very basic CSV file with each person’s email address and full name, along with a few basic details such as the site you want them to be redirected to, and an ID of the resource you’re granting access to.

The people you’re inviting don’t need their own Azure AD instance which is the best part – if they do, then they just get invited to your instance with the set permissions… but if they don’t, on the fly a pseudo-Azure AD gets set up by Microsoft for the domain their email address is on, and again they’ll get invited to your instance.

This method eliminates the need to do extensive account management, all you have to worry about is inviting them and giving them the permissions they need (which I do via group membership). Password resets they can do themselves, and get a code sent to their email address to use as part of the reset process.

On top of this, there’s no licensing required, which means if you are already covered for SharePoint Online through your Office 365 sub, this is a very cheap way to make customer facing portals to share information with, that’s locked down and hosted in the HA environment of Office 365.

I was surprised at how simple it was to invite, and even from the end user’s perspective of receiving the invitation – the process is very easy.

At the time of writing, Azure AD B2B is in public preview and may have a few bugs.