Author: Adam Fowler

Intel Compute Stick

Thanks to Intel, I’ve been mucking about with the Intel Compute Stick. It’s a mini PC a bit bigger than a normal USB stick, with a HDMI port out and highly portable.

The stick turned up in a nice little box, around the size of a mobile phone box:

20150727_114948

Inside was the stick, a HDMI extender cable, a Micro USB cable for power and a power plug with USB port.

20150813_123506

Banana for scale of course.

Plugging it in and getting it going was easy, it’s the normal OOTB experience you’d get with any Windows PC. I used a Logitech keyboard/mouse combo with a bluetooth usb dongle to make things easy, and there was no special set up required – both devices just worked.

After setting it up and playing with it, I decided to try Windows 10 on it. I followed this guide, but my experience wasn’t the same – there was enough room to just upgrade without having to do extra storage stuff.

20150813_123530

Once Windows 10 was installed, the device was a bit laggy; so I installed the official Intel drivers for Windows 10 on the stick, and then it was running smoothly. That’s fair enough for a new operating system and a new device.

20150813_123555

I played around with a few apps, streaming media and so on, and the device ran really well.

If you have any questions, or want to know more about the device feel free to ask in the comments.

Two models available via Amazon:

Ubuntu: Intel Compute Stick Windows BOXSTCK1A32WFC

Windows 8.1 with Bing: Intel Compute Stick Linux BOXSTCK1A8LFCCR

Update 20th August 2015: I’ve written a much more detailed review at The Register

Adding Multiple Cloud Users to an Azure/Office 365 Security Group

This one had me stumped for a while – how do you get a bunch of users in Office 365/Azure and then add them to a security group? This was met with the relevant tweets of frustration, such as:

After mucking around for a while, and getting Microsoft MVP David O’Brien to listen to my woes, I ended up working out a solution.

Part of my confusion was around this TechNet article for the command Add-MsolGroupMember which at the time of writing, I’m convinced is wrong. The example they give is to get a user and a group, then add the user to the group…. except, they’re used the get-msolgroup command to do so.

When I tried to switch this over to a user lookup with multiple user results, I received this error:

Add-MsolGroupMember : Cannot convert ‘System.Object[]’ to the type ‘System.Guid’ required by parameter
‘GroupObjectId’. Specified method is not supported.

Long story short, most Office 365 user/group commands I’ve come across don’t support multiple inputs, so you can’t feed a list of results through – it’s one at a time. Also, groups and users only seem to support using the Object ID of each object, so you can’t easily use names, email addresses etc. This means you’ll need to run commands to get those Object IDs based on the information you know.

To get around this, you’ll need to use the ‘foreach’ command – then it’ll go through each of your results one by one. I’ll go through this step by step:

1. Get your group:

$group = get-msolgroup | where {$_.Displayname -eq “All Office365 Users”}

Pretty self explanatory, we’re making the variable $group equal the object of the group name specified.

To check what users came back, you can just type $group

2. Get your users:

$users = get-msoluser | select userprincipalname,objectid | where {$_.userprincipalname -like “*domain.com*”}

Similar to the above, we’re making the variable $users all the users we want to add to the group, based on the User Principal Name containing “domain.com”. We’re also making sure we grab the object id of each of those users.

3. Adding the users to the group

$users | foreach {add-msolgroupmember -groupobjectid $group.objectid -groupmembertype “user” -GroupMemberObjectId $_.objectid}

This is showing the users we set earlier, then for each record, running the command ‘add-msolgroupmember’ based on the group we discovered in step 1, and the users from step2. Notice we call the Object ID for each of these objects, as the commands only support it as an identifier.

4. Check what users are in the group

get-msolgroupmember -groupobjectid $group.objectid

This will show you all the members of the group you’ve been working on.

With the above, you can use pretty much any search criteria for step 2, and add those users to your group.

Note that all the above is only for ‘In Cloud’ users, if they were on premesis and being synced to Azure AD/Office365, you’d run different commands against your on premise Active Directory environment.

Connect to all Office 365 services via PowerShell

I found this great TechNet article and wanted to share:

Connect to all Office 365 services in a single Windows PowerShell window

It’s a greatly described article about how to connect to each Office 365 service – MSOL itself, Exchange Online, Skype For Business, SharePoint Online and the Compliance Center.

If you go through the article, you can set up a script to prompt you once for Office 365 administrator credentials, and connect to each service for a one stop shop on managing your Office 365 environment from PowerShell.

One catch (which is mentioned in the article) is that you’ll need to run PowerShell in Administrator mode, or you won’t be able to import modules. You’ll see an error like:

The specified module 'Microsoft.Online.SharePoint.Online.PowerShell' was not loaded because no valid module file was found in any directory.

If you aren’t sure if you’re in Administrator or User mode, the default path prompted in the PowerShell window will be “PS C:\users\username>” for User mode, and “PS C:\Windows\system32>” for Administrator mode (along with the word “Administrator” in the PowerShell window title.

I’m only new to Office 365, but I’ve found the GUI via the web for user management rather basic – I can’t do simple tasks such as search for users on a specific domain, then add them to a group. PowerShell is absolutely necessary if you want to manage Office 365.

Create A Custom Email Address for External Office 365 Users

With SharePoint Online, you can create sites that external users can log into and access. This is great for things like sharing documents, with a lot more functionality than a plain file download and upload like Dropbox.

Unfortunately, there isn’t an easy way to create a manual user, but have notifications go to their external email address. When you create a user in Office 365 or Azure AD, they have to be set up with one of your valid, owned domains.

There is a way to modify the ‘Work Email’ field of a cloud user, which is then used by SharePoint Online to send notifications and updates to whatever address they want – but at the time of writing this, can’t be done via the webpage GUI, nor by native PowerShell commands.

There is a way though, thanks to a script written by Ivan Yankulov called “Script to Write and Get User Profile Properties in SharePoint Online with CSOM

The script uses the API’s of SharePoint Online to make changes to users, but read Ivan’s explanation of it on his blog if you’re interested in understanding how it works.

 

These instructions assume you’ve already created the user in Office 365/Azure AD.

Log on to SharePoint Online as user: http://yourwebsite.sharepoint.com

Install SharePoint Online Client Components SDK

Download script Script to Write and Get User Profile Properties in SharePoint Online with CSOM

To get user’s details (need to be an Office 365 Global admin, and use standard PowerShell to launch the .ps1 file from the script above):

.\Get-SPOUserProfileProperty.ps1 -accountname “[email protected]” -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] – password xxx

If you don’t specify the password in the command line, it will prompt for credentials (which is fine). This will make sure things are working, and you’ll see all the fields of that user

To set user’s details:

.\set-SPOUserProfileProperty.ps1 -propertyname WorkEmail -accountname “[email protected]” -value [email protected] -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] -password xxx

This is fine on a single user basis, but can also be scripted:

$data = import-csv -path C:\Temp\userdetails.csv
foreach ($user in $data){
.\set-SPOUserProfileProperty.ps1 -propertyname WorkEmail -accountname $user.UserPrincipalName -value $user.EmailAddress -spoadminportalurl “https://yourdomain-admin.sharepoint.com” -username [email protected] -password xxx
}

The password is specified in this script because you’ll be prompted for the password on every single user change. You can always save this script, add your password, run the script but not save the changes.

The CSV file used is the same as my last article Office 365 and PowerShell Cloud User Creation

DisplayName,FirstName,LastName,Password,EmailAddress,UserPrincipalName
Richard Sole,Richard,Sole,ILovePSv4,[email protected],[email protected]

If you have any issues getting the above working, feel free to ask in the comments below.

Office 365 and PowerShell Cloud User Creation

Getting started with Office 365 and Powershell can be a bit confusing, partly because so many aspects have changed in a short time. This is really for my own notes, but I’ve made it generic and may help others:

Here’s a very brief rundown on how to set yourself up and start creating cloud users. For internal users, DirSync/AzureAD is a much better option, but you may have requirements for external parties to access your Office 365 environment in some way.

Install Microsoft Online Services Sign-In Assistant for IT Professionals

Install Azure AD Module

Launch Azure Active Directory PowerShell

Test connectivity to Azure/Office365 by adding account using command “connect-msolservice” – will get prompted for credentials.

Check you’re connected with a command such as “Get-MsolCompanyInformation”

Create a CSV with your users such as this:

DisplayName,FirstName,LastName,Password,EmailAddress,UserPrincipalName
Richard Sole,Richard,Sole,ILovePSv4,[email protected],[email protected]

Run this script which will prompt for Azure credentials. This one is hardcoded for the AU region, but can be added as a variable to the CSV.

Connect-MsolService
$data = import-csv -path C:\Temp\myusers.csv
foreach ($user in $data){
New-MsolUser -FirstName $user.FirstName -DisplayName $user.DisplayName -LastName $user.LastName -Password $user.Password -UserPrincipalName $user.UserPrincipalName -UsageLocation AU
}

Users are now created in Office 365!

You can store the credentials to be used, or use a certificate – this Azure article shows how https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/