Get-DPMDisk.ps1

#DPM #Powershell

I wanted to share this with you.  The other morning I lost half a disk array which knocked out my DPM server.  So I wanted a script that would show me the status of the DPM disks, and I wanted to run it centrally.

I came up with this: .. let me know what you think

##########################################################################################
$AppName = “Get-DPMDisk.ps1”
$AppVer  = “v1.0 [24 February 2011]”
#v1.0 24 Feb 2011 : A script it born
#
#This script gets a DPM Disk Status.  The output is Get-DPMDisk.html
#
#Written By Paul Flaherty
#blogs.flaphead.com
#
########################################################################################## $DPMServers=”ServerName”

########################################################################################## #Display script name and version
#########################################################################################
Write-host ” ” $AppName -NoNewLine -foregroundcolor Green
Write-Host “: ” $AppVer -foregroundcolor Green
Write-host “`n Run on $ServerName at $Today by $xUser” -foregroundcolor Yellow
Write-Host “|——————————————————————-|`n”

$z=”DPM DISK STATUS
Last updated: $today


Write-Host “Getting DPM Disk Status”
$FirstOne = $True
$DPMDisk = @()
ForEach($DPMServer in $DPMServers){
  IF($FirstOne){
    Write-Host “-Connecting to First DPM Server to get DPM SnapIn`n”
    Write-host $DPMServer
    $s=New-PSSession -ComputerName $DPMServer
    Invoke-Command -Session $s {Add-PsSnapin Microsoft.DataProtectionManager.PowerShell}
    Import-PSSession -Session $s -Module Microsoft.DataProtectionManager.PowerShell
    $FirstOne = $False
  }
  $DPMD = Get-DPMDisk -DPMServerName $DPMServer

  $DPMD | ForEach{
    $tmpD = “” | Select Server, Name,Status, ntdiskid, TotalCapacity, UnallocatedSpace, DiskType
    $tmpD.Server=$DPMServer
    $tmpD.Name = $_.Name
    $tmpD.ntdiskid = $_.ntdiskid
    Switch($_.Status){“0″{$tmpD.Status=”Healthy”};default{$tmpD.Status=$_.Status}}
    Switch($_.DiskType){“0″{$tmpD.DiskType=”Basic”};”1″{$tmpD.DiskType=”Dynamic”};default{$tmpD.DiskType=$_.DiskType}}
    $tmpD.TotalCapacity = [Math]::round(([int64]$_.TotalCapacity) /1GB,2)
    $tmpD.UnallocatedSpace= [Math]::round(([int64]$_.UnallocatedSpace) /1GB,2)
   $DPMDisk += $tmpD
  }
} #ForEach

$xHTML = $DPMDisk | ConvertTo-Html -head $HtmlHeader -Title “DPM Disk Status” -body $z

$xEnd = get-Date
$xHTML += “



Script Completed: $xEnd

$xHTML | out-file Get-DPMDisk.html
Exit-PsSession
##########################################################################################
#End
##########################################################################################


My Powershell Public Library: http://cid-7e65f405c984b33f.office.live.com/self.aspx/Powershell

#Lync Ignite

So, just finished the 5 day Lync Ignite at Global Knowledge, and it was okay.  The labs are really good (when they work) and the courseware is okay (a lots of sales stuff and not updated for RTM!)

So here are some of the links and ramblings I made … enjoy

Links

Takeaways

  • Private line – can only receive calls .. Can’t make them.
  • Bandwidth 1 hd session = t1
  • MMC gone, now silverlight. No right click!
  • Lync Standard Edition – all roles and SQL on same server.
  • James O’Neil OCS powershell module!
  • RBAC used for permissions
  • Call park to park Lync calls
  • Potentially 50% reduction in severs when you virtualise
  • CMS = SQL
  • Lync will have NO service packs?!
  • Test call option in the lync client
  • LIS used for location services
  • Zero Day is a new book by Mark Russinovich
  • DNS LB: Client gets all the dns addresses and works out which on to use.
  • SBA: cheaper than having a separate lync server

Powershell

  • Powershell is a Microsoft task automation platform
  • Powershell v3 is coming

Import-module lync
(get-help *-cs*).count
Out-host –paging
Import-module ActiveDirectory

Installation

  • Install-CSAdServerSchema
  • Enable-CSAdForest
  • Enable-CSAdDomain