Slow startup or logon on Windows PCs/Notebooks with disconnected LAN and active but disconnected WiFi

Symptoms: Extreme slow startup or logon on Windows 7/10 Domain joined PCs/Notebooks with disconnected LAN, WiFi Adapter active, but with no connected WLAN.
The Logon Message “Applying User Settings” or “Applying Computer Settings” appears for several minutes (depends on the number of GPO assigned in cache).
Event log has multiple Event IDs 6005 and 6006.

Log Name:      Application
Source:        Microsoft-Windows-Winlogon
Event ID:      6005
Description:
The winlogon notification subscriber <GPClient> is taking long time to handle the notification event (CreateSession).
Additional details:
Guid=”{XXXXXXXXXXXXXX}”
EventSourceName=”Wlclntfy”

Log Name:      Application
Source:        Microsoft-Windows-Winlogon
Event ID:      6006
Description:
The winlogon notification subscriber <GPClient> took X second(s) to handle the notification event (CreateSession).
Additional details:
Guid=”{XXXXXXXXXXXXXX}”
EventSourceName=”Wlclntfy”

My Solution:

Try to DELETE this Registry Value GpNetworkStartTimeoutPolicyValue.

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System

In my case the Deployment Framework has set the Value GpNetworkStartTimeoutPolicyValue to 0.

Future investigations needed, but in my case this is the root cause.

 

 

 

Advertisements

How to monitor Microsoft Data Protection Manager (DPM) Alerts with the custom advanced Sensor in Paessler PRTG

With this VBS Script you can monitor DPM Alerts (tested on 2012 R2) with the custom Advanced XML Sensor in Paessler PRTG.
https://prtg.paessler.com/api.htm?tabid=7
Replace server.domain.local with IP or Name of your DPM Database Server and instance with the SQL instance name.
The PRTG Service Account needs to have appropriate permissions on DPM Database Server (SYSTEM uses AD Computer Account to access remote Servers).
Save the VBS in “C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML” Folder.
Create a Custom EXE/Script Advanced Sensor and select the Script.

locstrServer = "server.domain.local\instance"
locstrText = ""
locstrStatus = ""
strDBCon = ""
strDBCon = "Provider=sqloledb;Data Source=" & locstrServer & ";Initial Catalog=DPMDB;Integrated Security=SSPI;Connect Timeout=30;"
on error resume next
Set objDBCon = CreateObject("ADODB.Connection")
objDBCon.Open strDBCon
on error goto 0
Set ObjDBRS = CreateObject("ADODB.Recordset")
wscript.echo "<?xml version=""1.0"" encoding=""Windows-1252"" ?>"
wscript.echo "<prtg>"
strSQLCmdText = "select count(Severity) from vw_DPM_Alerts where Severity = 2 and ResolvedTime is null"
set ObjDBRS = objDBCon.Execute(strSQLCmdText)
wscript.echo "<result>"
wscript.echo "<channel>Information Alerts Count</channel>"
wscript.echo "<value>" & cint(ObjDBRS(0)) & "</value>"
wscript.echo "<unit>Count</unit>"
wscript.echo "</result>"
strSQLCmdText = "select count(Severity) from vw_DPM_Alerts where Severity = 1 and ResolvedTime is null"
set ObjDBRS = objDBCon.Execute(strSQLCmdText)
wscript.echo "<result>"
wscript.echo "<LimitMaxWarning>0</LimitMaxWarning>"
wscript.echo "<LimitMode>1</LimitMode>"
wscript.echo "<channel>Warning Alerts Count</channel>"
wscript.echo "<LimitWarningMsg>DPM Warning Alerts(s)!</LimitWarningMsg>"
wscript.echo "<value>" & cint(ObjDBRS(0)) & "</value>"
wscript.echo "<unit>Count</unit>"
wscript.echo "</result>"
strSQLCmdText = "select count(Severity) from vw_DPM_Alerts where Severity = 0 and ResolvedTime is null"
set ObjDBRS = objDBCon.Execute(strSQLCmdText)
wscript.echo "<result>"
wscript.echo "<LimitMaxError>0</LimitMaxError>"
wscript.echo "<LimitMode>1</LimitMode>" 
wscript.echo "<channel>Critical Alerts Count</channel>"
wscript.echo "<LimitErrorMsg>DPM Critical Alerts(s)!</LimitErrorMsg>"
wscript.echo "<value>" & cint(ObjDBRS(0)) & "</value>"
wscript.echo "<unit>Count</unit>" 
wscript.echo "</result>"
wscript.echo "</prtg>"

How to monitor Hyper-V Replica Health with the custom advanced Sensor in Paessler PRTG

With this VBS Script you can Monitor Hyper-V Replica Health with the custom Advanced XML Sensor in Paessler PRTG.
https://prtg.paessler.com/api.htm?tabid=7
Replace server.domain.local with IP or DNS Name of your Hyper-V Server.
The PRTG Service Account needs to have Admin rights on Hyper-V Host (SYSTEM uses AD Computer Account to access remote Servers).
Save the VBS in “C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML” Folder.
Create a Custom EXE/Script Advanced Sensor and select the Script.
You have to install the Windows Management Framework 3.0 .

locstrServer = "server.domain.local"
locstrText = ""
locstrStatus = ""
set objWshShell = CreateObject("WScript.Shell")
wscript.echo "<?xml version=""1.0"" encoding=""Windows-1252"" ?>"
wscript.echo "<prtg>"
locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Normal' ^| measure-object }"
Set locobjExec = objWshShell.Exec(locstrCommand)
Do While Not locobjExec.StdOut.AtEndOfStream
 locstrReadline = trim(locobjExec.StdOut.ReadLine())
 locstrReadline = replace(locstrReadline, " ", "")
 if left(lcase(locstrReadline), len("count:")) = "count:" then 
  wscript.echo "<result>"
  wscript.echo "<channel>Health Normal Count</channel>"
  locintcount = cint(replace(lcase(locstrReadline), "count:", ""))  
  wscript.echo "<value>" & locintcount & "</value>"
  wscript.echo "<unit>Count</unit>"  
  wscript.echo "</result>"
 end if
Loop
locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Warning' ^| measure-object }"
Set locobjExec = objWshShell.Exec(locstrCommand)
Do While Not locobjExec.StdOut.AtEndOfStream
 locstrReadline = trim(locobjExec.StdOut.ReadLine())
 locstrReadline = replace(locstrReadline, " ", "")
 if left(lcase(locstrReadline), len("count:")) = "count:" then 
  wscript.echo "<result>"
  wscript.echo "<LimitMaxWarning>0</LimitMaxWarning>"
  wscript.echo "<LimitMode>1</LimitMode>"
  wscript.echo "<channel>Health Warning Count</channel>"
  locintcount = cint(replace(lcase(locstrReadline), "count:", ""))
  wscript.echo "<LimitWarningMsg>Hyper-V Replica(s) Health Warning!</LimitWarningMsg>"
  wscript.echo "<value>" & locintcount & "</value>"
  wscript.echo "<unit>Count</unit>"
  wscript.echo "</result>"
 end if
Loop
locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Critical' ^| measure-object }"
Set locobjExec = objWshShell.Exec(locstrCommand)
Do While Not locobjExec.StdOut.AtEndOfStream
 locstrReadline = trim(locobjExec.StdOut.ReadLine())
 locstrReadline = replace(locstrReadline, " ", "")
 if left(lcase(locstrReadline), len("count:")) = "count:" then 
  wscript.echo "<result>"
  wscript.echo "<LimitMaxError>0</LimitMaxError>"
  wscript.echo "<LimitMode>1</LimitMode>"  
  wscript.echo "<channel>Health Critical Count</channel>"
  locintcount = cint(replace(lcase(locstrReadline), "count:", ""))  
  wscript.echo "<LimitErrorMsg>Hyper-V Replica(s) Health Critical!</LimitErrorMsg>"
  wscript.echo "<value>" & locintcount & "</value>"
  wscript.echo "<unit>Count</unit>"  
  wscript.echo "</result>"
 end if
Loop
if locstrStatus <> "" then wscript.echo locstrStatus
if locstrText <> "" then wscript.echo locstrText
wscript.echo "</prtg>"

How to monitor Hyper-V Replica Health with Paessler PRTG

With this quick and dirty VBS Script you can Monitor Hyper-V Replica Health with Peassler PRTG.
Replace server.domain.local with IP or DNS Name of your Hyper-V Server.
The PRTG Service Account needs to have Admin rights on Hyper-V Host (SYSTEM uses AD Computer Account to access remote Servers).
Save the VBS in “C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE” Folder.
Create a Custom EXE/Script Sensor and select the Script.
You have to install the Windows Management Framework 3.0 .

set objWshShell = CreateObject("WScript.Shell")

locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName server.domain.local -ScriptBlock { Get-VMReplication ^| where Health -ne 'Normal' ^| measure-object }"

Set locobjExec = objWshShell.Exec(locstrCommand)

Do While Not locobjExec.StdOut.AtEndOfStream
 locstrReadline = trim(locobjExec.StdOut.ReadLine())
 locstrReadline = replace(locstrReadline, " ", "")
 wscript.echo locstrReadline
 if left(lcase(locstrReadline), len("count:0")) = "count:0" then 
  wscript.echo "0:Ok"
  wscript.quit 0
 end if
Loop

wscript.echo "2:One or more Hyper-V Replicas are different from Normal!"
wscript.quit 2

How to monitor Dell MD3200 Health with Paessler PRTG

With this custom VBS Script you can Monitor the Health of a Dell MD3200 with Peassler PRTG.
Replace controller1.domain.local with IP or DNS Name of your Out Of Band Management interface from your controller 1.
Replace controller2.domain.local with IP or DNS Name of your Out Of Band Management interface from your controller 2.
Save the VBS in “C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE” Folder.
Create a Custom EXE/Script Sensor and select the Script.

set objWshShell = CreateObject("WScript.Shell")
CheckStorageArrayHealthStatus """C:\Program Files (x86)\Dell\MD Storage Manager\client\smcli.exe"" controller1.domain.local -c ""show storageArray healthStatus;""" 
CheckStorageArrayHealthStatus """C:\Program Files (x86)\Dell\MD Storage Manager\client\smcli.exe"" controller2.domain.local -c ""show storageArray healthStatus;"""

Sub CheckStorageArrayHealthStatus(locstrCommand)  
	dim locobjExec, locstrReadline
	Set locobjExec = objWshShell.Exec(locstrCommand)
	Do While Not locobjExec.StdOut.AtEndOfStream
		locstrReadline = trim(locobjExec.StdOut.ReadLine())
		wscript.echo locstrReadline
		if left(lcase(locstrReadline), len("storage array health status")) = "storage array health status" then
			if left(lcase(locstrReadline), len("storage array health status = optimal.")) = "storage array health status = optimal." then
				wscript.echo "0:Ok"
				wscript.quit 0
			end if
		end if
	Loop
end sub

wscript.echo "2:Need Attention"
wscript.quit 2

Powershell Script to Move all Hyper-V VM Replicas to another Hyper-V Host

Powershell Script to Move all Hyper-V VM Replicas to another Hyper-V Host

Scenario:
Hyper-V Server 2012 R2 Cluster CLUSTERNAME.domain.local
Hyper-V Server 2012 R2 Replica Server server1.domain.local and server2.domain.local

This Script suspends the replica, moves the replica VM from server1.domain.local to server2.domain.local (D:\Hyper-V\), sets the new Replica Server and resumes replica for all replicas on server1.domain.local:

$ReplicaServerOld="server1.domain.local"
$ReplicaServerNew="server2.domain.local"
ForEach ($VMReplication in (Get-VMReplication -ComputerName (Get-Cluster -Name CLUSTERNAME.domain.local | Get-ClusterNode) | Where-Object {$_.ReplicaServer -like $ReplicaServerOld}))
{
	$VMPrimary = get-vm $VMReplication.Name -ComputerName $VMReplication.PrimaryServerName
	$VMReplica = get-vm $VMReplication.Name -ComputerName $VMReplication.ReplicaServerName
	$VMPrimary | Suspend-VMReplication
	Move-VM $VMReplica.Name -DestinationHost $ReplicaServerNew -IncludeStorage -DestinationStoragePath ("D:\Hyper-V\" + $VMReplica.Name)
	$VMPrimary | Set-VMReplication -ReplicaServerName $ReplicaServerNew
	$VMPrimary | Resume-VMReplication
}

You must configure Kerberos Constrained Delegation for Hyper-V Management or run the script on server1.domain.local
No error handling at the moment…

PowerShell Script to Export the newest VSS Consistent Snapshot from the Hyper-V Replica server

PowerShell Script to Export the last VSS Consistent Snapshot from the Hyper-V Replica server

Scenario:
Hyper-V Server 2012 R2 Cluster CLUSTERNAME with a Primary Server of the VM “VMNAME”
Hyper-V Server 2012 R2 Replica Server with a Replica of the VM “VMNAME”
Hyper-V Replica with VSS Consistent Snapshots History

How can i Export the newest VSS Consistent Snapshot from the Hyper-V Replica Server in order to avoid Backup/Export IO on the Primary Servers Storage?

$VM = "VMNAME"
$ReplicaHOST = Get-Cluster CLUSTERNAME | Get-ClusterResource ("Virtual Machine Configuration " + $VM) | Get-VM | Get-VMReplication | Select-Object -ExpandProperty ReplicaServer
Get-VMSnapshot -ComputerName $ReplicaHOST -VMName $VM -SnapshotType AppConsistentReplica | Sort-Object CreationTime -descending | Select-Object -first 1 | Start-VMFailover -AsTest -Confirm:$false
Get-VM -ComputerName $ReplicaHOST ($VM + " - Test") | Export-VM -Path "d:\

Add a line to clean up the Test Failover VM
You have a VSS Consistent/Ready to Import VM
Unfortunately there is a differential disk AVHD(X) File you have to merge