PowerShell logo

Powershell – Get-ADuser and output the homedrives to CSV file

I had a customer with around 27 file servers used as locations for AD home drives. We needed to do some analysis on which users used which server, as things like DFS or a strategy of where to place users were not in place. So PowerShell to the rescue.

A simple version of this script is;

get-aduser -Filter * -properties * | select DisplayName,Enabled,HomeDirectory,LastLogonDate,CanonicalName | Export-csv -path c:\scripts\userhomefolder.csv

I created this more complex script after the amount of unique objects exceeded the maximum filter within excel, so by splitting into a file per server fixed this.

First off, create an array with the multiple file servers, then used the “foreach” command to loop a PowerShell command with each file server name.

We look into all user’s in AD and output to a CSV file any users with file server X into a CSV file.

#Add the AD module into the Powershell session
Import-module ActiveDirectory

#Array containing each File Server, can be FQDN or short name
$fileservers = 'FS1','FS2','FS3'

#Loop to run a script for each object in the array against all AD users, outputs in CSV to C:\ folder
Foreach ($fileserver in $Fileservers)
{
get-aduser -Filter * -properties * | select DisplayName,Enabled,HomeDirectory,LastLogonDate,CanonicalName | Where {$_.HomeDirectory -like "*$fileserver*"} |Export-csv -path c:\scripts\userhomefolder2-$fileserver.csv
}

 

Regards

 

Dean

backup header

How to produce good documentation – Part 5 – Diagraming your (Veeam) Backups

So it’s just been a little over a year since Part 4 of my how to document series was posted. I hoped to keep adding to the series, but at the same time, only do it when I felt I had relevant content to share. So this post is to show how I have documented some recent backup configurations. Note: I mainly work with Veeam, but hopefully this will give you idea’s of how to present the setup of your other backup software

Below are the previous posts;

The challenge

Note: The Visio file for these examples can be found at the end of the blog post.

Your backups evolve over time, as does your environment. Your backup schedules become more complex, and its hard to remember, what does what.

As past of my job, I setup backup solutions for customers, and then have the task of documenting how they are setup. I used to do this in a table format. It was quite simple

  • Backup/replication job name
    • Services backed up
    • Job settings
      • Storage/environment used

When you have a number of backup jobs, you have a lot of jobs and information to dig through. Its not user friendly.

Veeam backup job settings table 1 Veeam backup job settings table 2

So I re-visualised the way to present the data, I still have the detailed tables, however I also have three Visio diagrams

  • Backup Architecture setup
  • Backup and Replication jobs – Servers/services included
  • Backup and Replication job settings – high level

Continue reading How to produce good documentation – Part 5 – Diagraming your (Veeam) Backups

OneDrive logo header modified 3

Finally, a OneDrive for Business client for Mac OS X, that works!

Great news, Microsoft have finally got their backsides into gear, and produced a working OneDrive for Business Client, for Mac OS X. That actually works!

Two of the things that were keeping me from moving fully away from my windows machines were;

  • OneDrive for Business
  • Microsoft Visio

Now it looks as if I’m down to one reason, 🙂

You can read the official Office365 blog post here – Get started with the OneDrive for Business Next Generation Sync Client on Mac OS X.

One of the best features, is selective folder sync!

Installation and Setup
  1. Install the OneDrive App from the Apple AppStore.

If you have not setup OneDrive yet;

  • Open up terminal and enter the following commands
    • defaults write com.microsoft.OneDrive-mac DefaultToBusinessFRE -bool True
    • defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True

Then open up your OneDrive app and sign in with your Business account.

If your have setup OneDrive with a personal account;

  • Quit OneDrive first, then launch Terminal and enter
    • defaults write com.microsoft.OneDrive-mac EnableAddAccounts -bool True
  • Open OneDrive again, open up preferences,
  • Click the account tab, click “Add a business account”

Regards

Dean

Veeam Availability Suite v9

Veeam v9 Backup and replication / ONE upgrade from v8

This is just a quick post showing the upgrade process of

  • Veeam Backup Enterprise Manager
  • Veeam Backup and Replication
  • Veeam ONE

I didn’t hit any issues with the upgrades.

  • It’s always a good idea to reboot your servers before any update

And plan for further updates once the Veeam upgrades have completed as well.

Veeam Backup Enterprise Manager

  • I had to install .Net Framework 4.5.2 to continue the upgrade, which required a reboot
  • I upgraded from v8.0.0.817 (so not the latest patch)
  • I was asked to confirm the SQL Database upgrade
  • The server needed rebooting at the end of the upgrade

1 - Veeam Backup and Replication Installer Spash2 - Veeam install pre-req Continue reading Veeam v9 Backup and replication / ONE upgrade from v8

PowerCLI

PowerCLI – Setup Host networking and storage ready for ISCSI LUNs

So I am no scripting master, my PowerShell knowledge is still something I want to expand. During an install last week I had a number of hosts to setup from scratch, so I decided to do this via PowerCLI, as a lot of the tasks were repetitive. Setting up the vSwitch networking and iSCSI configuration for each host

For those of you new to scripting, I’ve included screenshots to accompany the commands so you can see whats going on in the GUI.

Note: the full code without the breaks is at the end of this post

#Setup which host to target 
$VMhost = 'hostname'

Continue reading PowerCLI – Setup Host networking and storage ready for ISCSI LUNs