I have two servers running Windows DSC that should both be running every 15 min but one is running correctly and the other is running ever 5 hours for some reason yet to be discovered. Here are the two LCM configurations:
The one that works:
PS C:\WINDOWS\system32> Get-DSCLocalConfigurationManager
ActionAfterReboot : ContinueConfiguration
AgentId : 420E62A0-FE64-11F5-9732-003ADC065DC3
AllowModuleOverWrite : False
CertificateID :
ConfigurationDownloadManagers : {}
ConfigurationID : 82xx1e91-4bz8-4fe4-b8dc-o73bc77c8756
ConfigurationMode : ApplyAndAutoCorrect
ConfigurationModeFrequencyMins : 15
Credential :
DebugMode : {NONE}
DownloadManagerCustomData : {MSFT_KeyValuePair (key = "ServerUrl"), MSFT_KeyValuePair (key =
"AllowUnsecureConnection")}
DownloadManagerName : WebDownloadManager
LCMCompatibleVersions : {1.0, 2.0}
LCMState : Idle
LCMStateDetail :
LCMVersion : 2.0
StatusRetentionTimeInDays : 10
PartialConfigurations :
RebootNodeIfNeeded : False
RefreshFrequencyMins : 30
RefreshMode : Pull
ReportManagers : {}
ResourceModuleManagers : {}
PSComputerName :
The one that is not:
PS C:\WINDOWS\system32> Get-DSCLocalConfigurationManager
ActionAfterReboot : ContinueConfiguration
AllowModuleOverWrite : False
CertificateID :
ConfigurationDownloadManagers : {}
ConfigurationID : 814b8ec2-7c1b-2359-8342-4ec23a4e576b
ConfigurationMode : ApplyAndAutoCorrect
ConfigurationModeFrequencyMins : 15
Credential :
DebugMode : {NONE}
DownloadManagerCustomData : {MSFT_KeyValuePair (key = "ServerUrl"), MSFT_KeyValuePair (key =
"AllowUnsecureConnection")}
DownloadManagerName : WebDownloadManager
LCMCompatibleVersions : {1.0, 2.0}
LCMState : Idle
LCMStateDetail :
LCMVersion : 2.0
StatusRetentionTimeInDays : 10
PartialConfigurations :
RebootNodeIfNeeded : False
RefreshFrequencyMins : 30
RefreshMode : Pull
ReportManagers : {}
ResourceModuleManagers : {}
PSComputerName :
Not sure why the second one is running ever 5 hours as it looks to be configured for every 15 min.... any ideas?
If it is WMF 5.0 RTM, you can check the configuration frequency settings as seen by the timers itself using:
get-winevent -LogName Microsoft-Windows-DSC/Operational | where {$_.Id -eq 4309}
This event contains information about the frequency of the timer as seen by the timer that triggers the consistency.
If the value is not 15 min, perform Set-DscLocalConfigurationManager again on the affected node and check the event again.
If the value is 15 min, look for 2 more events indicating a consistency run( you want the one with flag 1 for consistency check):
get-winevent -LogName Microsoft-Windows-DSC/Operational | where {($_.Id -eq 4343)-or ($_.Id -eq 4312)}
Related
I am trying to retrieve the asset tag which is set through libvirt xml on a KVM based windows VM using wmic. I have tried all possibilities but could not find a way to get the baseboard asset tag. I have researched and figured a utility online called dmidecode for windows.
Here is the snippet from libvirt xml
<sysinfo type='smbios'>
<baseBoard>
<entry name='asset'>45af54c9-e9d9-9dc1-b999-956c76548999</entry>
</baseBoard>
</sysinfo>
Is there a way I can retrieve the asset tag of baseboard using wmic tool or any other tool (other than dmidecode)
This is what I got so far with but the tag is defaulted to Base Board
PS C:\Users\Administrator> Get-CimInstance -ClassName Win32_BaseBoard -Property *
Status : OK
Name : Base Board
PoweredOn : True
Caption : Base Board
Description : Base Board
InstallDate :
CreationClassName : Win32_BaseBoard
Manufacturer :
Model :
OtherIdentifyingInfo :
PartNumber :
SerialNumber :
SKU :
Tag : Base Board
Version : pc-i440fx-4.2
Depth :
Height :
HotSwappable : False
Removable : False
Replaceable : False
Weight :
Width :
HostingBoard : True
RequirementsDescription :
RequiresDaughterBoard : False
SlotLayout :
SpecialRequirements :
ConfigOptions :
Product : Standard PC (i440FX + PIIX, 1996)
PSComputerName :
CimClass : root/cimv2:Win32_BaseBoard
CimInstanceProperties : {Caption, Description, InstallDate, Name...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties```
How can I find the value of "is connected" for a Bluetooth device? I've tried Get-WMIObject cmdlets and a few others but none of the values changed when I connect/disconnect. The only place I have found the value to change is in the attached image. I found it in the Device Properties for the Bluetooth Headset I am trying to use.
I'm trying to write a toggle script for AutoHotKey to send btcom commands, but I would like to write an if statement with that. The piece I'm missing here is finding the value of "is connected" on my Bluetooth device.
Example of output from Get-WMIObject:
PS H:\> Get-WmiObject -Query "select * from win32_PnPEntity where Caption='Jordan's AirPods Pro'"
__GENUS : 2
__CLASS : Win32_PnPEntity
__SUPERCLASS : CIM_LogicalDevice
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_PnPEntity.DeviceID="BTHENUM\\DEV_14C88BC438FE\\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE"
__PROPERTY_COUNT : 26
__DERIVATION : {CIM_LogicalDevice, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER : OL-2TK93103QK
__NAMESPACE : root\cimv2
__PATH : \\OL-2TK93103QK\root\cimv2:Win32_PnPEntity.DeviceID="BTHENUM\\DEV_14C88BC438FE\\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE"
Availability :
Caption : Jordan’s AirPods Pro
ClassGuid : {e0cbf06c-cd8b-4647-bb8a-263b43f0f974}
CompatibleID : {BTHENUM\GENERIC_DEVICE}
ConfigManagerErrorCode : 0
ConfigManagerUserConfig : False
CreationClassName : Win32_PnPEntity
Description : Bluetooth Device
DeviceID : BTHENUM\DEV_14C88BC438FE\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE
ErrorCleared :
ErrorDescription :
HardwareID : {BTHENUM\Dev_14C88BC438FE}
InstallDate :
LastErrorCode :
Manufacturer : Microsoft
Name : Jordan’s AirPods Pro
PNPClass : Bluetooth
PNPDeviceID : BTHENUM\DEV_14C88BC438FE\7&2D1C6A81&0&BLUETOOTHDEVICE_14C88BC438FE
PowerManagementCapabilities :
PowerManagementSupported :
Present : True
Service :
Status : OK
StatusInfo :
SystemCreationClassName : Win32_ComputerSystem
SystemName : OL-2TK93103QK
PSComputerName : OL-2TK93103QK
PS H:\>
I have a \\.\SCSI#: handle created via CreateFile(). I know it points to a specific HBA or (in my case) NVMe Controller. It must have a Bus/Device/Function associated with it's enumeration.
So far I've tried to figure this out via wmi, though I'm more than open to a C solution via WinApi. (actually would prefer a solution in C).
By getting an object using:
gwmi -namespace root\cimv2 -class Win32_SCSIController | format-list *
It yields my NVMe device like so:
PSComputerName : DESK
Status : OK
Name : Standard NVM Express Controller
StatusInfo : 3
__GENUS : 2
__CLASS : Win32_SCSIController
__SUPERCLASS : CIM_SCSIController
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : Win32_SCSIController.DeviceID="PCI\\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\\4&CB74546&0&00E8"
__PROPERTY_COUNT : 31
__DERIVATION : {CIM_SCSIController, CIM_Controller, CIM_LogicalDevice, CIM_LogicalElement...}
__SERVER : DESK
__NAMESPACE : root\cimv2
__PATH : \\DESK\root\cimv2:Win32_SCSIController.DeviceID="PCI\\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\\4&CB74546&0&00E8"
Availability : 3
Caption : Standard NVM Express Controller
ConfigManagerErrorCode : 0
ConfigManagerUserConfig : False
ControllerTimeouts :
CreationClassName : Win32_SCSIController
Description : Standard NVM Express Controller
DeviceID : PCI\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\4&CB74546&0&00E8
DeviceMap :
DriverName : stornvme
ErrorCleared :
ErrorDescription :
HardwareVersion :
Index :
InstallDate :
LastErrorCode :
Manufacturer : Standard NVM Express Controller
MaxDataWidth :
MaxNumberControlled :
MaxTransferRate :
PNPDeviceID : PCI\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\4&CB74546&0&00E8
PowerManagementCapabilities :
PowerManagementSupported :
ProtectionManagement :
ProtocolSupported : 2
SystemCreationClassName : Win32_ComputerSystem
SystemName : DESK
TimeOfLastReset :
Scope : System.Management.ManagementScope
Path : \\DESK\root\cimv2:Win32_SCSIController.DeviceID="PCI\\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\\4&CB74546&0&00E8"
Options : System.Management.ObjectGetOptions
ClassPath : \\DESK\root\cimv2:Win32_SCSIController
Properties : {Availability, Caption, ConfigManagerErrorCode, ConfigManagerUserConfig...}
SystemProperties : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY...}
Qualifiers : {dynamic, Locale, provider, UUID}
Site : :
Notice how the Index is blank... I figured that this would have been the number in \.\SCSI#:
Playing a little more, I can get the Bus/Device/Function from this:
$a = gwmi -namespace root\cimv2 -class Win32_PnPEntity -filter "DeviceId='PCI\\VEN_1987&DEV_5008&SUBSYS_50081987&REV_01\\4&CB74546&0&00E8'"
$a.GetDeviceProperties('DEVPKEY_Device_LocationInfo').deviceProperties.Data
PCI bus 5, device 0, function 0
I also thought about calling IOCTL_SCSI_GET_ADDRESS on the \\.\SCSI#: handle, though that doesn't work (which sort of makes sense since it isn't a lun-handle, but rather a controller one)
How do I associate a PCIe Bus/Device/Function info with the \\.\SCSI#: handle?
Question
Outbound emails sent through EXCH-S01 or EXCH-S02 are always routed to EXCH-S02 before leaving the organization network in Exchange 2010 DAG. Why?
Configuration
This is a simple DAG with two exchange servers and a fileshare witness (not included in the figure). S1 and S2 are the exchange servers hosting OWA1 and OWA2 respectively.
System Information
Send Connector: Internet
AddressSpaces : {SMTP:*;1}
AuthenticationCredential :
Comment :
ConnectedDomains : {}
ConnectionInactivityTimeOut : 00:10:00
DNSRoutingEnabled : True
DomainSecureEnabled : False
Enabled : True
ErrorPolicies : Default
ForceHELO : False
Fqdn : email.fabrikam.ca
HomeMTA : Microsoft MTA
HomeMtaServerId : EXCH-S02
Identity : Internet
IgnoreSTARTTLS : False
IsScopedConnector : False
IsSmtpConnector : True
LinkedReceiveConnector :
MaxMessageSize : unlimited
Name : Internet
Port : 25
ProtocolLoggingLevel : None
RequireOorg : False
RequireTLS : False
SmartHostAuthMechanism : None
SmartHosts : {}
SmartHostsString :
SmtpMaxMessagesPerConnection : 20
SourceIPAddress : 0.0.0.0
SourceRoutingGroup : Exchange Routing Group (DWBGZMFD01QNBJR)
SourceTransportServers : {EXCH-S02, EXCH-S01}
TlsAuthLevel :
TlsDomain :
UseExternalDNSServersEnabled : True
Receive Connector "EXCH-S02\From EXCH-S01"
RunspaceId : c5d80334-209b-4974-b6ef-105e3db469b4
AuthMechanism : Tls, Integrated, BasicAuth, BasicAuthRequireTLS, ExchangeServer
Banner :
BinaryMimeEnabled : True
Bindings : {0.0.0.0:25}
ChunkingEnabled : True
DefaultDomain :
DeliveryStatusNotificationEnabled : True
EightBitMimeEnabled : True
BareLinefeedRejectionEnabled : False
DomainSecureEnabled : False
EnhancedStatusCodesEnabled : True
LongAddressesEnabled : False
OrarEnabled : False
SuppressXAnonymousTls : False
AdvertiseClientSettings : False
Fqdn : EXCH-S02.fabrikam.ca
Comment :
Enabled : True
ConnectionTimeout : 00:10:00
ConnectionInactivityTimeout : 00:05:00
MessageRateLimit : unlimited
MessageRateSource : IPAddress
MaxInboundConnection : 5000
MaxInboundConnectionPerSource : 20
MaxInboundConnectionPercentagePerSource : 100
MaxHeaderSize : 64 KB (65,536 bytes)
MaxHopCount : 60
MaxLocalHopCount : 8
MaxLogonFailures : 3
MaxMessageSize : 10 MB (10,485,760 bytes)
MaxProtocolErrors : 5
MaxRecipientsPerMessage : 200
PermissionGroups : ExchangeUsers, ExchangeServers, ExchangeLegacyServers
PipeliningEnabled : True
ProtocolLoggingLevel : None
RemoteIPRanges : {10.1.0.3, 10.1.0.1}
RequireEHLODomain : False
RequireTLS : False
EnableAuthGSSAPI : False
ExtendedProtectionPolicy : None
LiveCredentialEnabled : False
TlsDomainCapabilities : {}
Server : EXCH-S02
SizeEnabled : EnabledWithoutValue
TarpitInterval : 00:00:05
MaxAcknowledgementDelay : 00:00:30
AdminDisplayName :
ExchangeVersion : 0.1 (8.0.535.0)
Name : From EXCH-S01
DistinguishedName : CN=From EXCH-S01,CN=SMTP Receive Connectors,CN=Protocols,CN=EXCH-S02,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=fabrikam,CN=
Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=ca
Identity : EXCH-S02\From EXCH-S01
Guid : a040ff87-900f-4a21-ad68-c9c095940686
ObjectCategory : fabrikam.ca/Configuration/Schema/ms-Exch-Smtp-Receive-Connector
ObjectClass : {top, msExchSmtpReceiveConnector}
WhenChanged : 4/8/2017 9:10:54 AM
WhenCreated : 1/21/2012 10:15:06 PM
WhenChangedUTC : 4/8/2017 1:10:54 PM
WhenCreatedUTC : 1/22/2012 3:15:06 AM
OrganizationId :
OriginatingServer : DC01.fabrikam.ca
IsValid : True
Exchange Server EXCH-S01
RunspaceId : c5d80334-209b-4974-b6ef-105e3db469b4
Name : EXCH-S01
DataPath : D:\Exchange Server\V14\Mailbox
Domain : fabrikam.ca
Edition : Enterprise
ExchangeLegacyDN : /o=fabrikam/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=EXCH-S01
ExchangeLegacyServerRole : 0
Fqdn : EXCH-S01.fabrikam.ca
CustomerFeedbackEnabled :
InternetWebProxy :
IsHubTransportServer : True
IsClientAccessServer : True
IsExchange2007OrLater : True
IsEdgeServer : False
IsMailboxServer : True
IsE14OrLater : True
IsProvisionedServer : False
IsUnifiedMessagingServer : False
NetworkAddress : {ncacn_vns_spp:EXCH-S01, netbios:EXCH-S01, ncacn_np:EXCH-S01, ncacn_spx:EXCH-S01, ncacn_ip_tcp:EXCH-S01.fabrikam.ca, ncalrpc:EXCH-S01}
OrganizationalUnit : fabrikam.ca/EXCH-S01
AdminDisplayVersion : Version 14.3 (Build 123.4)
Site : fabrikam.ca/Configuration/Sites/fabrikam
ServerRole : Mailbox, ClientAccess, HubTransport
ErrorReportingEnabled :
StaticDomainControllers : {}
StaticGlobalCatalogs : {}
StaticConfigDomainController :
StaticExcludedDomainControllers : {}
CurrentDomainControllers : {}
CurrentGlobalCatalogs : {}
CurrentConfigDomainController :
ProductID : 02064-110-8022196-75615
IsExchange2007TrialEdition : False
IsExpiredExchange2007TrialEdition : False
RemainingTrialPeriod : 00:00:00
IsValid : True
ExchangeVersion : 0.1 (8.0.535.0)
DistinguishedName : CN=EXCH-S01,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=fabrikam,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=
ca
Identity : EXCH-S01
Guid : 72736c62-2931-4128-bca5-73b233142f3b
ObjectCategory : fabrikam.ca/Configuration/Schema/ms-Exch-Exchange-Server
ObjectClass : {top, server, msExchExchangeServer}
WhenChanged : 4/8/2017 5:23:00 PM
WhenCreated : 5/21/2011 8:29:21 PM
WhenChangedUTC : 4/8/2017 9:23:00 PM
WhenCreatedUTC : 5/22/2011 12:29:21 AM
OrganizationId :
OriginatingServer : DC01.fabrikam.ca
Exchange Server EXCH-S02
RunspaceId : c5d80334-209b-4974-b6ef-105e3db469b4
Name : EXCH-S02
DataPath : D:\Exchange Server\V14\Mailbox
Domain : fabrikam.ca
Edition : Enterprise
ExchangeLegacyDN : /o=fabrikam/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=EXCH-S02
ExchangeLegacyServerRole : 0
Fqdn : EXCH-S02.fabrikam.ca
CustomerFeedbackEnabled :
InternetWebProxy :
IsHubTransportServer : True
IsClientAccessServer : True
IsExchange2007OrLater : True
IsEdgeServer : False
IsMailboxServer : True
IsE14OrLater : True
IsProvisionedServer : False
IsUnifiedMessagingServer : False
NetworkAddress : {ncacn_vns_spp:EXCH-S02, netbios:EXCH-S02, ncacn_np:EXCH-S02, ncacn_spx:EXCH-S02, ncacn_ip_tcp:EXCH-S02.fabrikam.ca, ncalrpc:EXCH-S02}
OrganizationalUnit : fabrikam.ca/EXCH-S02
AdminDisplayVersion : Version 14.3 (Build 123.4)
Site : fabrikam.ca/Configuration/Sites/fabrikam
ServerRole : Mailbox, ClientAccess, HubTransport
ErrorReportingEnabled :
StaticDomainControllers : {}
StaticGlobalCatalogs : {}
StaticConfigDomainController :
StaticExcludedDomainControllers : {}
CurrentDomainControllers : {}
CurrentGlobalCatalogs : {}
CurrentConfigDomainController :
ProductID : 02064-110-8022196-75900
IsExchange2007TrialEdition : False
IsExpiredExchange2007TrialEdition : False
RemainingTrialPeriod : 00:00:00
IsValid : True
ExchangeVersion : 0.1 (8.0.535.0)
DistinguishedName : CN=EXCH-S02,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=fabrikam,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=
ca
Identity : EXCH-S02
Guid : 0f25a4ee-2e54-4c9c-840d-a1ab5f107cfa
ObjectCategory : fabrikam.ca/Configuration/Schema/ms-Exch-Exchange-Server
ObjectClass : {top, server, msExchExchangeServer}
WhenChanged : 9/20/2014 10:20:32 AM
WhenCreated : 1/21/2012 5:58:57 PM
WhenChangedUTC : 9/20/2014 2:20:32 PM
WhenCreatedUTC : 1/21/2012 10:58:57 PM
OrganizationId :
OriginatingServer : DC01.fabrikam.ca
I will be happy to provide more information if required.
What I've done so far
Reset the activation preference.
Noticed HomeMtaServerId set to EXCH-S02 in the send connector. But realized Exchnage Server 2010 does not use that parameter anymore.
I am very eager to find out what is causing this.
I have problem with count performance in MongoDB.
I'm using ZF2 and Doctrine ODM with SoftDelete filter. Now when query "first time" collection with db.getCollection('order').count({"deletedAt": null}), it takes about 30 seconds, sometimes even more. Second and more query takes about 150ms. After few minutes query takes again about 30 seconds. This is only on collections with size > 700MB.
Server is Amazon EC2 t2.medium instance, Mongo 3.0.1
Maybe it similar to MongoDB preload documents into RAM for better performance, but those answers do not solve my problem.
Any ideas what is going on?
/edit
explain
{
"executionSuccess" : true,
"nReturned" : 111449,
"executionTimeMillis" : 24966,
"totalKeysExamined" : 0,
"totalDocsExamined" : 111449,
"executionStages" : {
"stage" : "COLLSCAN",
"filter" : {
"$and" : []
},
"nReturned" : 111449,
"executionTimeMillisEstimate" : 281,
"works" : 145111,
"advanced" : 111449,
"needTime" : 1,
"needFetch" : 33660,
"saveState" : 33660,
"restoreState" : 33660,
"isEOF" : 1,
"invalidates" : 0,
"direction" : "forward",
"docsExamined" : 111449
},
"allPlansExecution" : []
}
The count will go through each document which is creating performance issues.
Care about the precise number if it's a small one. You're interested to know if there are 100 results or 500. But once it goes beyond, let's say, 10000, you can just say 'More than 10000 results' found to the user.
db.getCollection('order').find({"deletedAt": null}).limit(10000).count(true)