DNS entry problems on a DC with attached iSCSI

We’ve recently set up a new DC with some iSCSI storage attached- single site, so the DC is providing DC & file storage.

In DNS, the LAN and iSCSI entries were showing up which was annoying, as pinging generally didn’t work because it would try to find the iSCSI network.

In short, you don’t need to mess around with any network connections or fiddle about in the registry- use method 2 from

https://support.microsoft.com/en-gb/kb/275554

Just stop the DNS on the DC listening on any port other than the LAN- including an IPv6 interfaces (in our case at any rate).

Advertisements

Trawl AD for devices running Windows Server, pull out hardware details, list them in PowerShell window

This is pretty much identical to the other two scripts but it displays the output in PowerShell. It’s got a few bits of colouring to differentiate between servers that can/ can’t be ping’d.

—————————————————
[string]$serverList
[string]$serverNames
[string]$serverArray
[int]$xAxis
[int]$yAxis
[int]$responsiveCounter
[int]$unresponsiveCounter
[string]$detail00
[string]$detail01
[string]$detail02
[string]$detail03

$serverList = Get-ADComputer -LDAPFilter “(&(ObjectCategory=Computer)(OperatingSystem=*server*))” | Select-Object Name
$serverNames = $serverList.Name

$serverArray = New-Object ‘object[,]’ $serverList.Count,4
$xAxis = 0
$yAxis = 0
[int]$responsiveCounter = 0
[int]$unresponsiveCounter = 0

Clear-Host

ForEach ($server in $serverNames)
{
$isAlive = Test-Connection $server -Count 1 -Quiet

If($isAlive -eq $true)
{
$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_OperatingSystem -ComputerName $server | Select-Object CSName -ExpandProperty CSName
$detail00 = $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Manufacturer -ExpandProperty Manufacturer
$detail01 = $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Model -ExpandProperty Model
$detail02 = $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_SystemEnclosure -ComputerName $server | Select-Object SerialNumber -ExpandProperty SerialNumber
$detail03 = $serverArray[$xAxis,$yAxis]

$userInterface.ForegroundColor = “DarkGreen”
$userInterface.BackgroundColor = “DarkRed”

“{0, -20}”,”{1, -25}”,”{2, -20}”,”{3, -40}” -f $detail00, $detail01, $detail02, $detail03

$responsiveCounter++

}
ElseIf($isAlive -eq $false)
{
$userInterface.ForegroundColor = “Blue”
$userInterface.BackgroundColor = “Yellow”

$mergeDetails = “`n” + $server + ” is not responding so I can’t retrieve any data” + “`n”
$mergeDetails

$unresponsiveCounter++
}

$yAxis=0
$xAxis++
}

$userInterface.ForegroundColor = “DarkGreen”
$userInterface.BackgroundColor = “DarkRed”
Write-Host “`n`nThe total number of responsive servers is ” $responsiveCounter

$userInterface.ForegroundColor = “Blue”
$userInterface.BackgroundColor = “Yellow”
Write-Host “The total number of unresponsive servers is ” $unresponsiveCounter

$userInterface.BackgroundColor = “DarkGreen”
$userInterface.ForegroundColor = “Cyan”

Trawl AD for devices running Windows Server, pull out hardware details (Dell specific)

This is pretty much identical to the last script, but it filters the output to return only Dell servers. It’s just the extra chunk that starts “If($madeBy -eq “Dell Inc.”)”. This could be replaced with any manufacturer. I neede to send our live estate to our account manager.

Because WMI is a bit weird, this script has to pull data out of different classes so looks worse than it is. It has to use the NETBIOS name to get all this data. It’s based around an array that is created from the number of servers it find (“OperatingSystem=*server*”). The $mergeDetails looks complicated, but it’s the only way I could find of presenting the results neatly, so the details of each server is on a seperate line. It’s very easy to just output the array in a list format but is horrible to read.

The main “If” loop just determines whether the server is respoding- if not, it writes to the same file that it can’t retrieve any data.
————————————————–
Remove-Item .\Dell_Name_ST_Model.csv

[string]$serverList
[string]$serverNames
[string]$serverArray
[int]$xAxis
[int]$yAxis
[string]$mergeDetails

$serverList = Get-ADComputer -LDAPFilter “(&(ObjectCategory=Computer)(OperatingSystem=*server*))” | Select-Object Name | Sort-Object Name
$serverNames = $serverList.Name

$serverArray = New-Object ‘object[,]’ $serverList.Count,4
$xAxis = 0
$yAxis = 0

ForEach ($server in $serverNames)
{

$isAlive = Test-Connection $server -Count 1 -Quiet

If($isAlive -eq $true)
{
$madeBy = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server -ErrorAction ‘SilentlyContinue’ | Select-Object Manufacturer -ExpandProperty Manufacturer

If($madeBy -eq “Dell Inc.”)
{
$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_OperatingSystem -ComputerName $server | Select-Object CSName -ExpandProperty CSName
$mergeDetails = $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Manufacturer -ExpandProperty Manufacturer
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Model -ExpandProperty Model
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_SystemEnclosure -ComputerName $server | Select-Object SerialNumber -ExpandProperty SerialNumber
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$mergeDetails | Out-File .\Dell_Name_ST_Model.csv -Append
}
}
ElseIf($isAlive -eq $false)
{
$mergeDetails = $server + ” ,is not responding so I can’t retrieve any data” | Out-File .\Dell_Name_ST_Model.csv -Append
}

$yAxis=0
$xAxis++
}

Trawl AD for devices running Windows Server, pull out hardware details

Because WMI is a bit weird, this script has to pull data out of different classes so looks worse than it is. It has to use the NETBIOS name to get all this data. It’s based around an array that is created from the number of servers it find (“OperatingSystem=*server*”). The $mergeDetails looks complicated, but it’s the only way I could find of presenting the results neatly, so the details of each server is on a seperate line. It’s very easy to just output the array in a list format but is horrible to read.

The main “If” loop just determines whether the server is respoding- if not, it writes to the same file that it can’t retrieve any data.
———————————————–
Remove-Item .\allServers_Name_ST_Model.csv

[string]$serverList
[string]$serverNames
[string]$serverArray
[int]$xAxis
[int]$yAxis
[string]$mergeDetails

$serverList = Get-ADComputer -LDAPFilter “(&(ObjectCategory=Computer)(OperatingSystem=*server*))” | Select-Object Name | Sort-Object Name
$serverNames = $serverList.Name

$serverArray = New-Object ‘object[,]’ $serverList.Count,4
$xAxis = 0
$yAxis = 0

ForEach ($server in $serverNames)
{

$isAlive = Test-Connection $server -Count 1 -Quiet

If($isAlive -eq $true)
{
$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_OperatingSystem -ComputerName $server | Select-Object CSName -ExpandProperty CSName
$mergeDetails = $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Manufacturer -ExpandProperty Manufacturer
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_ComputerSystem -ComputerName $server | Select-Object Model -ExpandProperty Model
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$yAxis++

$serverArray[$xAxis,$yAxis] = Get-WMIObject -Class Win32_SystemEnclosure -ComputerName $server | Select-Object SerialNumber -ExpandProperty SerialNumber
$mergeDetails = $mergeDetails + “,” + $serverArray[$xAxis,$yAxis]
$mergeDetails | Out-File .\allServers_Name_ST_Model.csv -Append
}
ElseIf($isAlive -eq $false)
{
$mergeDetails = $server + ” ,is not responding so I can’t retrieve any data” | Out-File .\allServers_Name_ST_Model.csv -Append
}

$yAxis=0
$xAxis++
}

WP 8.1 error: “We can’t connect to OneDrive to back up”

A few weeks back, apparently my Lumia 930 stopped backing up with the above error- it’s looking like the OneDrive backup (OneDrive > Options > Device Backups) may have become correupted. I deleted the backup for the 930, ran a fresh backup and it failed, but during the failure it switched off settings backup on the phone. I switched it back on, and now the 930 is showing up as a backup device in OneDrive. It hasn’t finished yet, but there is a backup for that device showing up in OneDrive with todays timestamp on it…

UPDATE: backup still failed, but device and OneDrive think it backed up. ?

UPDATE 22/06/2016 @ 16:44: after chatting to Microsoft a lot of the day, it seems that the problem was having the official twitter app installed- ? They pointed me at:

http://answers.microsoft.com/en-us/mobiledevices/forum/mdlumia-mdsettings/wp-81-backup-error-there-was-a-problem/b6812384-cd70-41cd-a817-72cc8a361141?page=3&auth=1

And although I don’t have Live lockscreen beta, the official twitter app is horrbily slow and unresponsive so I thought maybe that was worth a go (also, the icon was going dark when charging- possibly when backing up- implying it was unusable at this time, which made me think there might be an issue with it). Uninstalled twitter (still have tweetium), and have now had two successfull backups work without a problem.

Hyper-V replica broker fails to start after being manually shut down

There are numerous suggestions on the web; I found one query on social.technet but even though it was only last night, I’ve lost the url…

Anyway, this query is exactly what fixed it for me. The replica broker was created on DC somedc.mybiz.com. That DC went through a bit of a wobble and was due for decommission anyway, so we demoted it and moved the DC stuff onto a virtual machine.

Turns out that in the registry, there’s a string value somewhere under HKLM\Cluster\Resources\{SOME RANDOM GUID VALUE}\parameters called “CreatingDC”. This was the demoted DC. Edit the value and point it at the new DC – somedc_new.mybiz.com – and the replica broker starts up almost instantly.

UPDATE: Just to satisfy myself that this was the case, I failed the RB over to host 2 (using old DC) and it failed. Modified the above registry key and it started instantly- no reboots or anything.