Creating Active Directory users and populating attributes is a straightforward process using the Active Directory Modules for Windows PowerShell. However, the supplied modules don't supply an easy way to provision home folders for users. For this reason, I created the New-Home script.
Before we discuss using PowerShell to send Telnet commands, I'd like to explain the security risk involved in using Telnet. Besides a few exceptions, Telnet is inherently insecure because the client-server communication is sent in clear text which makes it susceptible to network interception. Credentials used to authenticate to a Telnet server should not be sent over the Internet or untrusted networks.
I came across a post on Spiceworks.com containing a PowerShell function that uses the .NET Socket Class to initiate a Telnet session and send commands. The post inspired me to write a commandlet that accepts pipeline parameters and has the ability to determine success by reading the console output from the connection buffer. Check out the examples below to get an idea of how it works.
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.
Here's a quick and easy way to add Active Directory Security Group members to a Google Apps Group.
Migrating DHCP scope data between Microsoft Server 2008 and 2012 is a breeze using PowerShell, but migrating DHCP data from Microsoft Server 2003 requires the use of NETSH. The NETSH tool exports DHCP data in binary form, so you must use NETSH for both the export and import process.
Export DHCP Database from Microsoft Server 2003
To start, login to the Server 2003 DHCP host and create a new folder to store the export files. In this example, I created a folder in the root of the C: drive named "migration". Next, open a new Command window and type the following command to export the entire DHCP database.
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.
Today I noticed that Microsoft Server 2012 R2 member servers don't have the Active Directory PowerShell module pre-installed. You can install the module using the Add Roles and Features wizard from the Server Manager, or you can simply enter the PowerShell command Add-WindowsFeature RSAT-AD-PowerShell to install the module.