Samsung's been giving away a free Gear VR headset with the purchase of a new Galaxy S7 or S7 Edge smartphone. The new Galaxy phones and the Galaxy S6 require the Oculus Home application which provides Gear VR users with access to download VR games and applications including Oculus Video and MilkVR, which are used to watch video content while wearing the Gear VR. Users can play their own video content from these applications, but due to Android's lack of audio codecs, users are unable to play video with AC3 or DTS audio tracks. In most cases, encoding the audio track from AC3/DTS to MP3 allows the video to play correctly, but there aren't many tools to convert video files in bulk, so I made a PowerShell script to help with this process.
Using PowerShell and GAM, updating user account photos in a Google Apps domain is pretty simple. The easiest way to perform this task is by feeding GAM the CSV file directly without using any PowerShell commands, as seen below.
The PowerShell alternative is slower and requires more work to setup, but it allows us to do more than update a single attribute. For example, in addition to updating the user photos in Google Apps, you may need to populate Active Directory with attributes such as phone extensions, home folders, and email accounts. For this reason, knowing how to pipe information into GAM from PowerShell can be useful when writing scripts to automate workflows.
Since Microsoft insists on keeping the traditional Notepad.exe in their latest Windows 10 operating system, I decided to make a script to install and replace notepad.exe with Notepad++. Since Notepad.exe is considered a system file, the script must update the file ownership before Windows will allow the NTFS permissions changes required to replace the executable file. Also to my surprise, Windows keeps three copies of Notepad.exe, so to be thorough the script will backup and replace each of the three Notepad.exe files. Using Microsoft's new Package Management Framework, installing Notepad++ was the easy part. Overall, what I assumed would be a simply copy/paste task turned into a lengthy process.
The package management framework OneGet (aka. PackageManager) brings Linux-like package management to Windows 10. OneGet is actually a module included in PowerShell 5, which is part of the new Windows Management Framework 5 (Link: WMF5). As with most PowerShell modules, the cmdlets are pretty straightforward. To get a list of available commands, use the Get-Command cmdlet.
With Google Chromebooks and Chromeboxes exploding in popularity, many technology professionals find themselves trying to manage these devices in bulk. Thankfully, command line tools like GAM allow us to take advantage of the Google Apps API to streamline bulk management tasks. GAM can be used independently, but it works even better in combination with PowerShell.
Using a script similar to the one below, I was able to quickly update over 700 Chromebook devices in a Google Apps domain. I had a spreadsheet with the device's serial number and three columns of information that needed to be added or updated on each device. The spreadsheet was saved in CSV format and looked similar to the text below.
* Update March 2016:
There are much easier ways of accomplishing this task now that GAM can query Chrome device serial numbers. Maybe I'll update this post with a better solution at a later date.
I'm often tasked with deploying client applications to many workstations on a network, and in most cases Group Policy or Microsoft Configuration Manager works perfectly for this sort of thing. However, PowerShell can handle the task just as well. For deploying an MSI package, a couple lines of code is usually enough to handle the task.
Thanks to the folks at FreeGeoIP.net, you can query their API for geolocation data by providing an IP address or Internet domain. The geolocation data can be produced in various formats including CSV, XML, and JSON. For this PowerShell snippet, we'll use the XML format.
Using Get-Geolocation I can retrieve location data for a public IP or online host. Here is an example.
UPDATE 9/16/2015: I found a free geolocation service called Telize that works great. The PowerShell commands below illustrate how easy it is to extract geolocation information from Telize.
Using the Invoke-RestMethod cmdlet, content can be queried from online geolocation providers to gather connection details such as public IP address and ISP location information. In this example I used a free service from ipecho.net to create the Get-PublicIP function. For older versions of PowerShell, you can use the Invoke-WebRequest cmdlet, but you must retrieve the IP address data from the object's content property.