2016-02-29

PowerShell: How to get Fibre Channel Adapter's WWN's

A World Wide Name (WWN) or World Wide Identifier (WWID) is a unique identifier used in storage technologies including Fibre Channel, Advanced Technology Attachment (ATA) or Serial Attached SCSI (SAS).

Get wwn with PowerShell on Windows 2008 or later:

Get-WmiObject -class MSFC_FCAdapterHBAAttributes -namespace "root\WMI" | ForEach-Object {(($_.NodeWWN) | ForEach-Object {"{0:x}" -f $_}) -join ":"}

/Geecoholic

2016-02-28

VBScript: How to get needed Windows updates count

Save sample below to a file named NeededUpadatesCount.vbs:

Set updateSession = CreateObject("Microsoft.Update.Session")
updateSession.ClientApplicationID = "Geecoholic Script"

Set updateSearcher = updateSession.CreateUpdateSearcher()

WScript.Echo "Searching for updates..." & vbCRLF

Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")

WScript.Echo "Updates Count: " & searchResult.Updates.Count
WScript.Quit


 You can run the sample by opening a Command Prompt window and typing the following command at the command prompt:

script NeededUpadatesCount.vbs

Script made using example from MS link

/Geecoholic

2016-02-27

Windows OS disk backup from cmd

How to make Windows OS/System disk (C:) and related boot partitions backup using Command prompt:

WbAdmin start backup -backupTarget:W: -include:C: -allCritical -quiet

where W: is removable USB or other disk. W: can be replaced to network path \\server\backup

/Geecoholic

2016-02-26

PowerShell: Total all hdd space script

On local computer:

Get-WMIObject Win32_LogicalDisk | ForEach-Object {[math]::round($_.size / 1GB)}|Measure-Object -sum | select sum

On remote computer:

Get-WMIObject Win32_LogicalDisk -ComputerName RemoteComputerName | ForEach-Object {[math]::round($_.size / 1GB)}|Measure-Object -sum | select sum

/Geecoholic

2016-02-25

TF214025: No build service host was found

Description

We have 2 build servers (TFS 2015.1) run using a domain account called DOMAIN\TFSBuildService. Two months run without issue. One day build controllers stopped with same error per controller:

Exception Message: TF214025: No build service host was found with the URI vstfs:///Build/ServiceHost/16. Either the URI does not exist, or DOMAIN\TFSBuildService does not have permission to access it. (type BuildServiceHostNotFoundForUriException)

Solution

Add build account to Advanced group on "Aceess Levels" tab in yout TFS site http://yourTFSServer:8080/tfs/_admin/_licenses

/Geecoholic