Quantcast
Channel: TechNet Technology News
Viewing all 13502 articles
Browse latest View live

SMB3 PowerShell changes in Windows Server 2012 R2: Scale-Out Rebalancing (per-share redirection)

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

 

Scale-Out Rebalancing (per-share redirection)

 

Per-share redirection is the new default behavior for the new SMB Clients (Windows 8.1 or Windows Server 2012 R2), when connecting to a Scale-Out clusters that use a storage system that does not support Direct I/O from all nodes, if running Windows Server 2012 R2. The common scenario here is a Scale-Out File Server backed by Mirrored Storage Spaces.

 

Here are the changes in SMB PowerShell to support SMB Scale-Out per-share redirection:

  • New “Redirected” Boolean property to Get-SmbConnection to indicate that per-share redirection is being used.

  • Get-SmbWitnessClient now includes a “ShareName” property, since witness can track connections per share, not only per server.

  • Get-SmbWitnessClient now includes a “Flags” property, which will show “Share” when doing per-share redirection

 

Notes

 

1) For more details of the new rebalancing behavior of Windows Server 2012 R2, see http://blogs.technet.com/b/josebda/archive/2013/10/30/automatic-smb-scale-out-rebalancing-in-windows-server-2012-r2.aspx

2) This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.


SMB3 PowerShell changes in Windows Server 2012 R2: SMB Witness improvements

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

 

Changes related to SMB Witness

 

While the overall functionality of the SMB Witness is largely unchanged in Windows Server 2012 R2 (aside from per-share redirection), we have put some effort in improving the SMB PowerShell cmdlets associated with it. Here are the changes:

 

1) The Move-SmbWitnessClient cmdlet can be referred to now simply as Move-SmbClient. This is simply a new alias that better describes what the cmdlet actually does.

 

2) The default view for Get-SmbWitnessClient was improved. Here’s the new list of items shown:

 

Client Computer   Witness Node  File Server   Network Name  Share Name  Client State    
Name              Name             Node Name
----------------- ------------- ------------- ------------  ----------  ------------    
JOSE-V            JOSE-A1       JOSE-A2       JOSE-F        VMS4        RequestedNoti...
JOSE-V            JOSE-A1       JOSE-A2       JOSE-F        VMS3        RequestedNoti...
JOSE-V            JOSE-A1       JOSE-A3       JOSE-F        VMS1        RequestedNoti...
JOSE-V            JOSE-A1       JOSE-A3       JOSE-F        VMS2        RequestedNoti...
JOSE-V            JOSE-A2       JOSE-A1       JOSE-F        VMS6        RequestedNoti...
JOSE-V            JOSE-A2       JOSE-A1       JOSE-F        VMS5        RequestedNoti...

 

3) There is a new “NetworkName” parameter in Move-SmbClient.  If a NetworkName is specified, then only those will be moved.

 

Windows Server 2012 syntax for Move-SmbWitnessClient:

    • Move-SmbWitnessClient -ClientName X -DestinationNode Y

 

Windows Server 2012 R2 syntax:

    • Move-SmbClient -ClientName X -DestinationNode Y [ -NetworkName Z ]

 

Notes

 

1) If the –NetworkName is omitted in the Move-SmbClient cmdlet, all client connections will be moved to the destination.

2) When using per-share redirection, the SMB client will always move to the file server node that owns the volume behind the file share. Using Move-SmbClient (or Move-SmbWitnessClient) in that situation has no effect.

3) This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.

SMB3 PowerShell changes in Windows Server 2012 R2: SMB Bandwidth Limits

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

 

SMB Bandwidth Limits

 

Starting with Windows Server 2012 R2, administrators can set a bandwidth limit for one or more categories by using simple PowerShell cmdlets. They can also query the limit for each category.  

 

There are 3 categories of traffic that can be limited:

  • VirtualMachine: Hyper-V over SMB traffic. This limit can only be applied on Hyper-V hosts.

  • LiveMigration: Hyper-V Live Migration over SMB traffic. This limit can only be applied on Hyper-V hosts.

  • Default: All other types of SMB traffic. This limit can be applied on any SMB client.

 

A category limit is an absolute value expressed in bytes per second.  For example, a category limit of 500MB means the total throughput for this category should not exceed 500 megabytes per second.

 

Installing the new feature and performance counters

 

Before you can use Bandwidth Limits, the feature needs to be enabled.  For that, you should use the following PowerShell cmdlet:

  • Add-WindowsFeature FS-SMBBW

 

A new SMB Performance counter set with an instance per category becomes available after you install the feature.  The performance counters in for this set will use the same counters used today for the SMB Client Shares counter.

 

New SmbBandwidthLimit cmdlets

 

The PowerShell cmdlets used to manage SMB Bandwidth Limits are:

  • Get-SmbBandwidthLimit [ –Category {Default/VirtualMachine/LiveMigration} ]

  • Set-SmbBandwidthLimit –Category {Default/VirtualMachine/LiveMigration} –BytesPerSecond x

  • Remove-SmbBandwidthLimit –Category {Default/ VirtualMachine/LiveMigration}

 

PowerShell allows us to specify units like KB, MB, GB after the number of bytes when specifying the BytesPerSecond parameter.

The Set-SmbBandwidthLimit cmdlet won’t accept a BytesPerSecond parameter smaller than 1MB (1048576).

 

Note

 

This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.

SMB3 PowerShell changes in Windows Server 2012 R2: SMB Multi-instance

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

 

SMB Multi-instance

 

SMB Multi-instance is a new feature in Windows Server 2012 R2 that separates regular SMB traffic from CSV-related inter-node SMB traffic in distinct  SMB instances.

This is designed to improve isolation between the two types of traffic in improve the reliability of the SMB servers.

Information related to this new CSV-only instance in Windows Server 2012 R2 is typically hidden by default in all PowerShell cmdlets.

 

Showing hidden instance information

 

There are the changes in SMB PowerShell so an Administrator can view information related to the hidden CSV instance:

  • The –IncludeHidden option in Get-SmbConnection and Get-SmbMultichannelConnection will show the connections associated with the hidden CSV instance.

  • There is now an InstanceName property in the full output of Get-SmbConnection, Get-SmbMultichannelConnection, Get-SmbSession and Get-SmbOpenFile. It shows either “Default” or “CSV” (only shows if using the –IncludeHidden option).

 

There is really little use in inspecting the information on the hidden CSV instance, except if you’re troubleshooting CSV inter-node communications.

 

Note

 

This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.

SMB3 PowerShell changes in Windows Server 2012 R2: SMB Delegation

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

 

The need for SMB Delegation

 

When you configure Hyper-V over SMB and you manage your Hyper-V hosts remotely using Hyper-V Manager, you will might run into access denied messages. This is because you’re using your credentials from the remote machine running Hyper-V Manager in the Hyper-V host to access a third machine (the file server). This is what we call a “double-hop”, and it’s not allowed by default for security reasons.The main problem with the scenario is that an intruder that compromises one computer in your environment could then connect to other systems in your environments without the need to provide a username and password. One way to work around this issue is to connect directly to the Hyper-V host and providing your credentials at that time, avoiding the double-hop.

You can also address this by configuring Constrained Delegation for SMB shares, which is a process that involves changing properties in Active Directory. The security risk is reduced here because a potential intruder double-hop would be limited to that specific use case (using SMB shares on the specified servers). The constrained delegation process was greatly simplified in Windows Server 2012 when the the Active Directory team introduced resource-based Kerberos constrained delegation, as explained at http://technet.microsoft.com/library/hh831747.aspx. However, even with  this new resource-based constrained delegation, there are still quite a few steps to enable it.

 

Requirements for SMB Delegation

 

Before you use the new SMB Delegation cmdlets, you must meet two specific requirements.

 

First, the new cmdlets do rely on Active Directory PowerShell to perform their actions. For this reason, you need to install the Active Directory cmdlets before using the SMB delegation cmdlets. To install the Active Directory cmdlets, use:

  • Install-WindowsFeature RSAT-AD-PowerShell

 

Second, these cmdlets rely on the the new resource-based delegation in Active Directory. Since that AD feature was introduced in Windows Server 2012, the Active Directory forest must be in “Windows Server 2012” functional level. To check the Active Directory Forest Functional level, use:

  • Get-ADForest

 

The new SMB Delegation cmdlets

 

For Hyper-V over SMB in Windows Server 2012, we provided TechNet and blog-based guidance on how to automate constrained delegation. In Windows Server 2012 R2, SMB has a new set of cmdlets to simplify the configuration of resource-based constrained Delegation in SMB scenarios.

 

Here are the new cmdlets introduced:

  • Get-SmbDelegation –SmbServer X

  • Enable-SmbDelegation –SmbServer X –SmbClient Y

  • Disable-SmbDelegation –SmbServer X [–SmbClient Y] [-Force]

 

Notes

 

1) For the Disable-SmbDelegation cmdlet, if no client is specified, delegation will be removed for all clients.

2) System Center Virtual Machine Manager uses a different method to remote into the Hyper-V host and configure SMB shares. When using VMM, constrained delegation is not required for management of Hyper-V of SMB.

3) This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.

Managed Availability Probes

$
0
0

Probes are one of the three critical parts of the Managed Availability framework (monitors and responders are the other two). As I wrote previously, monitors are the central components, and you can query monitors to find an up-to-the-minute view of your users’ experience. Probes are how monitors obtain accurate information about that experience.

There are three major categories of probes: recurrent probes, notifications, and checks.

Recurrent Probes

The most common probes are recurrent probes. Each probe runs every few minutes and checks some aspect of service health. They may transmit an e-mail to a monitoring mailbox using Exchange ActiveSync, connect to an RPC endpoint, or establish CAS-to-Mailbox server connectivity. All of these probes are defined in the Microsoft.Exchange.ActiveMonitoring\ProbeDefinition event log channel each time the Exchange Health Manager service is started. The most interesting properties for these events are:

  • Name: The name of the Probe. This will begin with the SampleMask of the Probe’s Monitor.
  • TypeName:The code object type of the probe that contains the probe’s logic.
  • ServiceName: The name of the Health Set for this Probe.
  • TargetResource: The object this Probe is validating. This is appended to the Name of the Probe when it is executed to become a Probe Result ResultName
  • RecurrenceIntervalSeconds: How often this Probe executes.
  • TimeoutSeconds: How long this Probe should wait before failing.

On a typical Exchange 2013 multi-role server, there are hundreds of these probes defined. Many probes are per-database, so this number will increase quickly as you add databases. In most cases, the logic in these probes is defined in code, and not directly discoverable. However, there are two probe types that are common enough to describe in detail, based on the TypeName of the probe:

  • Microsoft.Exchange.Monitoring.ActiveMonitoring.ServiceStatus.Probes.GenericServiceProbe: Determines whether the service specified by TargetResource is running.
  • Microsoft.Exchange.Monitoring.ActiveMonitoring.ServiceStatus.Probes.EventLogProbe: Logs an error result if the event specified by ExtensionAttributes.RedEventIds has occurred in the ExtensionAttributes.LogName. Success results are logged if the ExtensionAttributes.GreenEventIds is logged. These probes will not work if you override them to watch for a different event.

The basics of a recurrent probe are as follows: start every RecurrenceIntervalSeconds and check (or probe) some aspect of component health. If the component is healthy, the probe passes and writes an informational event to the Microsoft.Exchange.ActiveMonitoring\ProbeResult channel with a ResultType of 3. If the check fails or times out, the probe fails and writes an error event to the same channel. A ResultType of 4 means the check failed and a ResultType of 1 means that it timed out. Many probes will re-run if they timeout, up to the MaxRetryAttempts property.

The ProbeResult channel gets very busy with hundreds of probes running every few minutes and logging an event, so there can be a real impact on the performance of your Exchange server if you perform expensive queries against this event channel in a production environment.

Notifications

Notifications are probes that are not run by the health manager framework, but by some other service on the server. These services perform their own monitoring, and then feed data into the Managed Availability framework by directly writing probe results. You will not see these probes in the ProbeDefinition channel, as this channel only describes probes that are run within the Managed Availability framework.

For example, the ServerOneCopyMonitor Monitor is triggered by Probe results written by the MSExchangeDagMgmt service. This service performs its own monitoring, determines whether there is a problem, and logs a probe result. Most Notification probes have the capability to log both a red event that turns the Monitor Unhealthy and a green event that make the Monitor healthy once more.

Checks

Checks are probes that only log events when a performance counter passes above or below a defined threshold. They are really a special type of Notification probe, as there is a service monitoring the performance counters on the server and logging events to the ProbeResult channel when the configured threshold is met.

To find the counter and threshold that is considered unhealthy, you can look at Monitor Definitions with a Type property of:

· Microsoft.Office.Datacenter.ActiveMonitoring.OverallConsecutiveSampleValueAboveThresholdMonitor or

· Microsoft.Office.Datacenter.ActiveMonitoring.OverallConsecutiveSampleValueBelowThresholdMonitor

This means that the probe the Monitor watches is a Check probe.

How this works with Monitors

From the Monitor’s perspective, all three probe types are the same as they each log to the ProbeResult channel. Every Monitor has a SampleMask property in its definition. As the Monitor executes, it looks for events in the ProbeResult channel that have a ResultName that matches the Monitor’s SampleMask. These events could be from recurrent probes, notifications, or checks. If the Monitor’s thresholds are reached or exceeded, it becomes Unhealthy.

It is worth noting that a single probe failure does not necessarily indicate that something is wrong with the server. It is the design of Monitors to correctly identify when there is a real problem that needs fixing versus a transient issue that resolves itself or was anomalous. This is why many Monitors have thresholds of multiple probe failures before becoming Unhealthy. Even many of these problems can be fixed automatically by Responders, so the best place to look for problems that require manual intervention is in the Microsoft.Exchange.ManagedAvailability\Monitoring crimson channel. These events sometimes also include the most recent probe error message (if the developers of that Health Set view it as relevant when they get paged with that event’s text in Office 365).

There are more details on how Monitors work, and how they can be overridden to use different thresholds in the Managed Availability Monitors article.

 

Abram Jackson
Program Manager, Exchange Server

SMB3 PowerShell changes in Windows Server 2012 R2: SMB1 can now be completely removed

$
0
0

Introduction

 

Windows Server 2012 R2 introduced a new version of SMB. Technically it’s SMB version 3.02, but we continue to call it just SMB3. The main changes are described at http://technet.microsoft.com/en-us/library/hh831474.aspx.

With this new release, we made a few changes in SMB PowerShell to support the new scenarios and features. This includes a few new cmdlets and some changes to existing cmdlets, with extra care not break any of your existing scripts.

This blog post outlines one of the 7 set of changes related to SMB PowerShell in Windows Server 2012 R2.

  

SMB1 can now be completely removed

 

In Windows Server 2012 R2, SMB1 became an optional component and can now be completely disabled, so that the associated binaries are not even loaded. For scenarios where SMB1 is not required, this means less resource utilization, less need for patching and improved security.

For instance, in the Hyper-V over SMB scenario, where you are storing Hyper-V virtual disks and virtual machine configuration in SMB file shares, SMB3 is a requirement. In this case, SMB1 is not necessary and can be safely disabled.

For information worker scenarios, if you have Windows XP clients, you absolutely still need SMB1, since that is the only SMB version supported by Windows XP. If *all* your clients are running Windows Vista or later, SMB1 is no longer required and you can disable SMB1. Windows Vista and Windows 7 do not need SMB1 since they support SMB2. Windows 8 and Windows 8.1 do not need SMB1, since they support both SMB2 and SMB3.

For classic server scenarios, if you have Windows Server 2003 or Windows Server 2003 R2 servers, you absolutely still need SMB1, since that is the only SMB version supported by them. Windows Server 2008 and Windows Server 2008 R2 do not need SMB1 since they support SMB2. Windows Server 2012 and Windows Server 2012 R2 do not need SMB1, since they support both SMB2 and SMB3.

 

Disable SMB1

 

Even though the component can now be removed, due to the compatibility issues listed above, it is still enabled by default.

 

To disable SMB1 completely, use the following PowerShell cmdlet:

  • Remove-WindowsFeature FS-SMB1

 

You can re-enable it by using:

  • Add-WindowsFeature FS-SMB1

 

Notes

 

1) A reboot is required after this feature is enabled or disabled.

2) For more details about SMB versions and dialects and which operating systems support them, see http://blogs.technet.com/b/josebda/archive/2013/10/02/windows-server-2012-r2-which-version-of-the-smb-protocol-smb-1-0-smb-2-0-smb-2-1-smb-3-0-or-smb-3-02-you-are-using.aspx

3) This blog post is an updated version of the September 2013 post at  http://blogs.technet.com/b/josebda/archive/2013/09/03/what-s-new-in-smb-powershell-in-windows-server-2012-r2.aspx focused on a single topic.

WMI: Missing or Failing WMI Providers or Invalid WMI Class

$
0
0

Scenario

Windows Management Instrumentation fails due to receiving an event or error concerning missing or failure to load WMI Provider, or Invalid WMI class, or WMI Invalid Namespace.

Below are some common errors indicating issues with a WMI Provider or Class:

  • Failed to initialize all required WMI classes
  • Win32_processor: WMI: Invalid namespace
  • Win32_WMISetting: WMI: Invalid namespace
  • Win32_OperatingSystem: WMI: Invalid namespace
  • WBEM_E_NOT_FOUND 0x80041002
  • WBEM_E_PROVIDER_FAILURE 0x80041004
  • WBEM_E_INVALID_NAMESPACE 0x8004100E
  • WBEM_E_INVALID_CLASS 0x80041010
  • WBEM_E_PROVIDER_NOT_FOUND 0x80041011
  • WBEM_E_INVALID_PROVIDER_REGISTRATION 0x80041012
  • WBEM_E_PROVIDER_LOAD_FAILURE    0x80041013

The common urge by many is to simply take a hammer to WMI and either rebuild the repository or recompile all of the .mof files in the C:\Windows\System32\Wbemfolder. While the hammer may seem a good approach to solve your problem in some cases or what seems like a quick fix, it can actually cause more problems and issues that are not immediately visible or felt. These newly created problems as a result of the hammer approach are not always immediately obvious and tend to surface later, and usually when the last thing you need is another problem to have to deal with on your plate, especially if it created a critical business situation.

Rebuilding the repository or recompiling all of the .mof files as a first action when other steps should be taken first can cause damage to the system and/or to installed applications.

First we want to just check right up front if our repository is corrupted or not to save time, then continue from there with appropriate actions.

Check the Windows Application log, look for events in the past week where Source = Microsoft-Windows-WMI, check if any of the following WMI event IDs exist: 28, 65, 5600, 5601, 5614. Any of these could indicate a WMI repository or core infrastructure problem.

Check if the repository is corrupted or not by running following command from command prompt with admin rights: winmgmt /verifyrepository. If it is corrupted the returned result will be “Repository is inconsistent.” If it comes back as consistent, then repository is not corrupted so do not rebuild repository at this point.

Note: if results came back as “inconsistent”, then skip to bottom of the page and reference the section titled “Wmi Repository Corrupted”, otherwise continue with the methods below.

If issue is with a 3rd party provider or namespace, the vendor should be engaged as they are responsible for their own namespaces and providers.

For the 3 scenarios listed below for WMI Invalid Namespace, WMI Invalid Class, and WMI Provider Load failure, if a class is present and operation still errors out with invalid class, then the most likely reason is that service/wmiprvse is hitting memory quota limit or issues.

When a quota issue is hit in wmiprvse, new memory allocations fail and based on where the failure happen client gets different errors “invalid query”/Invalid class/Provider load failure/quota check”
When a quota issue is hit when a new operation is for a provider which is not loaded already in wmiprvse and thus requiring it to be loaded in a new instance of wmiprvse, then the provider loading would fail with “provider load failure”.

Scenario 1: WMI Invalid Namespace

First we want to take any scripts or programs out of the equation by using local built in tools. The two most common tools used to check wmi functionality is the WMI console (winmgmt.msc) and Wbemtest (Windows Management Instrumentation Tester).

Ensure the Namespace in question actually exist and functional.

  1. Go to start-run and type in wmimgmt.msc
  2. Right click on Local Wmi Control (Local)and select properties
  3. On the general tab, if there is any failures noted on that box, that indicates a core WMI issue and most likely with the Cimv2 namespace.
  4. Click on the Security tab and expand Root folder. This is where you will see all of the namespace listed for WMI
  5. Find the namespace referenced in the error message you are getting
  6. If you find the namespace is missing, do the following, otherwise skip to step 6 if the namespace is listed

a. Open up a command prompt with administrative rights or elevated privileges

b. Go to www.msdn.com and search for the provider of the missing namespace. We are looking for the associated .mof file. In the below example, we will use MSCluster as our missing namespace.

e.g. search words: wmi mscluster provider or wmi mscluster namespace. In this case you should find ClusWmi.mof as the WMI provider

In case the CimV2 namespace is missing, the provider is CimWin32.mof

If it also lists the associated .dll file, you will want to re-register it also as this would be the registration for the DCOM side as WMI and DCOM work hand in hand.

c. From the command prompt with administrative rights or elevated privileges change directory to C:\Windows\System32\Wbem and run the following command: mofcomp.exe

Note: Replace with actual .mof name you found searching MSDN. In our example above that command would be: mofcomp.exe ClusWmi.mof

For re-registering associated .dll if one exists use following command: regsvr32 and again replacing with actual dll name

d. Restart the Windows Management Instrumentation Service

e. Use wmimgmt.msc console again to now check if the missing namespace is now listed. First close the console and reopen if it was still open from previous action

7. Go to start-run and type in wbemtest

8. Click on the “Connect Button

9. In the Namespace Box type in the path to the namespace for which getting invalid namespace error for. This path would have the same look and feel of a Windows Directory, so just as you see the structure in wmimgmt.msc console on the Securitytab, so is how you will type in path

Examples:

Root\Cimv2
Root\Mscluster
Root\RSOP\Computer

10. Click on the “Connect” button

11. Now all of the buttons should no longer be greyed out on the main wbemtest console page. Click on the “Enum Classes” button

12. Leave “Enter Superclass Name” blank and select “Recursive” then click OK. If you don’t get any error messages then you can access the name successfully without issue using built in Windows Management Instrumentation Tester

13. To test further, let’s see if we can access some classes.

a. Pick any class and double click on it to bring up the Object Editor for that class

b. Next click on the “Instances” button on the right

c. If it doesn’t sit there hung at “Operation in progress” or doesn’t return any error, then access to that class would appear to be okay.

NOTE: Not every class you click in the “Instances” button will actually return results. Some classes will and some won’t depending on the class. Don’t sweat it if it doesn’t as long as the box above says “Done”

Repeat this on several classes in the namespace for sanity check just to see if any produce an error message or Operation in progresshangs.

If you did not get any errors connecting to the namespace or accessing some of the classes in that namespace, then your issue may be with the application or whatever method being used outside of Wbemtest that is the problem and would advise opening case with Microsoft if it is a Microsoft application or process, otherwise first contact the vendor of the application for assistance in troubleshooting.

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Scenario 2: WMI Invalid Class

To troubleshoot an Invalid WMI Class, you basically would follow the same procedure as above that you would for WMI Invalid Namespace.

Here is a good link that you could probably also click your way thru various links to find the provider .mof for Microsoft classes.

WMI Classes

Scenario 3: WMI Provider Load Failure

Again, you will follow the same procedures as above for testing, and also locating the provider .mof file and associated .dll if one is listed and recompiling and re-registering of that particular provider.

Wmi Repository Corrupted

There are some exceptions where you have accomplished all of the above and from Wbemtest (note I said Wbemtest, not some method outside of Wbemtest) and you are still getting failures with a namespace, class, or provider. In these scenarios you may have to revert to using the proverbial hammer as a last ditch effort even though the repository check came back as consistent when your ran winmgmt /verifyrepository.

Before doing such, it would be a good idea to open a Support Incident Case with Microsoft for assistance before reverting to rebuilding of the repository if the winmgmt /verifyrepository had come back as Consistent.

IMPORTANT

If this becomes the case, please refer to my Ask the Performance Team Blog article, WMI: Rebuilding the WMI Repository before rebuilding the repository as there are some important gotchas that you need to be aware of.

As a final note, if you are running into a reoccurring WMI corruption issue in your environment, try to exclude the WBEM folder and all subfolders under it from AV scanning. AV scanning is known to cause corruption in WMI.

At this point you may also want to open a Support Incident with Microsoft for further assistance if needed.

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Next up: WMI: High Memory Usage by WMI Service or Wmiprvse.exe


4 tips for a standout Start screen on your Windows Phone

$
0
0

For me, the Windows Phone Start screen was the catalyst for leaving my iPhone behind. It’s just SO much better in terms of customization, personalization…basically any kind of -ization you can think of.

(You probably already know how to resize/move/add/remove Tiles on Start, but I have you covered if you need a refresher on Tile basics.)

Here are some of the ways I feng shui my Start screen:

1. Picture this – I’m a sentimental guy. I like having pictures of my loved ones and cool places I’ve been within easy reach. The Start screen has always had a bevy of color options, but in Windows Phone 8.1 my Start screen can now have a picture of a waterfall I hiked to a few weeks ago. Much better!

Go to Settings > Start + theme to add a photo from your Camera Roll (waterfall time!), pick one of the snazzy professional shots in Backgrounds, or hunt Facebook or another social network account for Start screen-quality material.

start-screen-background-image

2. Think outside the app – It’s not just apps that show up on Start. I’m in the (stressful) process of moving, so I have a OneNote note titled “Moving checklist” pinned to my Start screen so I’m only one tap away from seeing the next item on my list. Music albums I have on heavy rotation often get pinned for easy access as well. Websites, maps, or shortcuts to your close contacts can also be pinned to Start.

3. Start with more – I tend to keep my Start screen fairly minimalist, but for all you pin pushers and app accumulators there’s now a way to fit more Tiles on Start, which means less scrolling and more Tile-y goodness. Just go to Settings > Start + theme and turn on Show more Tiles.

start-screen-1

4. Take app-vantage of apps – There’s personalization, and then there’s customization. If you want even more control over your Start screen, plenty of apps are available to help. Turn existing apps’ Tiles into transparent Tiles with Transparency Tiles, create blank filler Tiles and new colors with Start Screen Customizer, or create custom Tiles with notes using Note Pro and StickyTiles.

WMI: High Memory Usage by WMI Service or Wmiprvse.exe

$
0
0

Scenario

Windows Management Instrumentation Service (Winmgmt) or WMI provider (wmiprvse.exe) is consuming high amounts of memory.

There are many reasons why WMI might experience high memory consumptions. This can occur in the WMI (Windows Management Instrumentation) service (winmgmt) or in the WMI provider hosting vehicle wmiprvse.exe. Both scenarios will be addressed below.

High memory usage may simply be due to load, as opposed to some type of leak. By default, the memory quota limit for instances of wmiprvse.exe on Windows XP and Windows Server 2003 is 128 MB, and 512 MB on newer Operating Systems (Vista and higher). Hit those limits and wmi functionality will become problematic if not come to a grinding halt.

There is another case where the quota limit problem could happen. There is limit for all wmiprvse’s cumulatively. If the total memory of all instances of wmiprvse’s (with one exception) together reaches 1GB, then all new memory allocations fail in all wmiprvse processes.

As a first effort you can try to bump up that quota limit to see if it gives enough room for wmiprvse to operate, but if you still reach the new quota limit, then you will want to proceed with the Scenarios below

How To Bump up WMI memory quota limit:

  • Go to Start--> Run and type wbemtest.exe
  • Click Connect

clip_image001 

 

  • In the namespace text box type "root" (without quotes).

Note: you aren’t connecting to CimV2 or any other namespaces. It’s ROOT

  • Click Connect
  • Click Enum Instances…

clip_image002

 

  • In the Class Info dialog box enter Superclass Name as "__ProviderHostQuotaConfiguration" (without quotes) and press OK. Note: the Superclass name includes a double underscore at the front.

clip_image003

 

  • In the Query Result window, double-click "__ProviderHostQuotaConfiguration=@"

clip_image004

 

  • In the Object Editor window, double-click whichever Property name you wish to modify the quota for. In this case that will be MemoryPerHost

clip_image005

 

  • In the Value dialog, type in 536870912 (512 MB) for XP and Windows 2003.  For Vista and higher, start with new value of 805306368 (768), then move to 1073741824 (1024) if still needing room. At the same time, if you are going to bump up the MemoryPerHostLimit, you should also then bump up the MemoryAllHost limit to 2147483648 (2048) provided you have the available ram to do so. If this does not resolve quota violation issue, then need to troubleshoot cause of high memory usage following below Scenario section
  • Click Save Property.
  • Click Save Object.
  • Close Wbemtest.
  • Restart the machine

Note: if you cannot restart the machine, then as a workaround, you can break Windows Management Instrumentation service into its own svchost process outline in step 2. a-c below.

If bumping the quota limits does not resolve the issue, then as workaround you can try to move suspected leaking providers into their own group (wmiprvse) to avoid the memory quota caused by other providers running in the group or kill the instance of wmiprvse exhibiting high memory until issue is resolved. This is outlined below in Scenarios 1a and 2a.

First thing we need to determine is if the memory consumption being caused by private data or heap data. We have to address the 2 types differently.

1. Download a Windows Sysinternals tool call VMMap from following url: http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx

VMMap is a process virtual and physical memory analysis utility. It shows a breakdown of a process's committed virtual memory types as well as the amount of physical memory (working set) assigned by the operating system to those types.

This tool is used to attach to an individual process allowing a snapshot to be taken to see the memory map for that process.

2. Simply launch VMMap and from the process list it displays, pick the instance of wmiprvse showing the high working set memory usage.

3. If it is a svchost process that is exhibiting high memory, from a command run scqueryex winmgmt to identify the PID of the svchost process that is hosting WMI Service (winmgmt). From experience it will be the WMI service more times than not but not always as the service using majority of the memory; as such I would try to break it out first on its own and monitor to see if it is the one driving up high memory usage in the shared svchost process.

From this point, I will assume it is the WMI service as this article is only addressing WMI and no other services.

You will need to break the WMI service out into its own svchost process first if it hasn’t already been accomplished so you can run VMMap specifically against the WMI service to truly know if it is being consumed by Heap or Private Data. By default the WMI service runs in a shared svchost process with a community of other services. You can do so by the following directions. If it is caused by Heap, you will find later in the Scenario directions below that you will have to go back and uniquely name the svchost process for the service to run in to be able to enable User Stack Tracing against it.

a. Open command prompted with elevated privileges

b. Break wmi service out into its own svchost process by running following command: sc config winmgmt type= own

c. Restart wmi service with net stop winmgmt and net start winmgmt commands

d. Verify winmgmt service running in its own svchost process by runnning tasklist /svc

4. Once it displays the result, look under the size column for Private Data and Heap. This should tell you if the majority of the memory being consumed is Private Data or Heap.

5. Follow appropriate Scenario below based on if issue is with Windows Management Instrumentation service or wmiprvse and if caused by Heap or Private Data memory.

Scenario 1a: High Memory Consumption by Wmiprvse.exe caused by Heap memory

1. Download Windows Debugging Tools for Windows from following link: http://msdn.microsoft.com/en-us/windows/hh852365.aspx

You can probably just get the standalone version since we only need the debugging tool and not the whole WDK package.

2. Go to the directory where you installed the tool and you will find gflags.exe as one of the files, right click on it and select run as administrator

3. Click on “Image File” tab

4. Type in wmiprvse.exe

5. Hit the keyboard TAB key

6. Place check mark in “Create user mode stack trace database

7. Click Ok

8. Download the latest version of the Windows Sysinternals tool Process Explorer. http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

9. Find the instance of wmiprvse.exe with high memory consumption and right click on it and bring up the properties sheet. Click on the WMI Providers tab and document the listed providers

Alternatively you could run following wmic command from command prompt to get a list of loaded providers and their associated PID you could then match up to PID with instance of wmiprvse with high memory usage:

wmic path msft_providers get Provider,HostProcessIdentifier /format:list

10. We now want to take that list of providers and configure them to run in their own instance of wmiprivse.exe. Open an instance of PowerShell with admin rights

11. Run the following commands: Replace ProviderName below with actual ProviderNamer found from step 9, retain the quote marks.

$prv = gcim -namespace root/standardcimv2 __win32provider -filter "name='ProviderName'"

$prv.HostingModel = $Prv.HostingModel + ":OWN"

set-ciminstance -inputobject $prv

Repeat the above for each Provider found in step 9

12. Restarting of Wmi service will put the settings into effect without having to reboot machine

13. Now you will want to take a process dump of the instance of wmiprvse when memory usage is high. Download Windows Sysinternals tool called Procdump from URL: http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

14. Open a command prompt with elevated or administrative rights and change to the directory where you saved Procdump

15. Open Task Manager and add the PID column view then go locate the instance of wmiprvse.exe with high memory usage and note the PID, or use Process Explorer

16. Run the following command: procdump –ma -s 300 -n 3

Note: Replace with actual PID you documented for instance of wmiprvse.exe exhibiting high memory usage

The above command will produce 3 dumps spaced at 5 minutes apart each in same directory you ran the procdump command from

17. Note also as workaround until issue gets resolved you could simply kill the instance of wmiprvse with high memory from task manager or from PowerShell can run following:

kill -f

At this point you will now need to open a Support Incident Case with Microsoft to get the data analyzed to determine cause of high memory usage

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Scenario 1b: High Memory Consumption by WMI (Windows Management Instrumentation) service caused by Heap memory

The Windows Management Instrumentation service runs under the display name of winmgmt and is located in networking svchost.exe process shared along with several other services. You need to break the WMI service out into its own unique svchost process for data collection purposes.

NOTE: If you have already broken the WMI service out to run in its own general svchost process following directions at beginning of this article, then you can skip to step 6 to uniquely name the svchost process it is running in. We do this because we only want to enable User Stack Tracing against just the WMI service and not every svchost process.

  1. Open command prompted with elevated privileges
  2. Break wmi service out into its own svchost process by running following command: sc config winmgmt type= own
  3. Restart wmi service with net stop winmgmt and net start winmgmt commands
  4. Verify winmgmt service running in its own svchost process by runnning tasklist /svc
  5. Change command focus to system32 folder and run following command: copy svchost.exe wmisvchost.exe
  6. From start run type in regedit and navigate to HKLM\System_CurrentControlSet\Services\Winmgmt
  7. Modify existing ImagePath from %systemroot%\system32\svchost.exe -k netsvcs to %systemroot%\system32\wmisvchost.exe -k netsvcs

Note: It is important that you go back and reverse what you did in step 7 and modify path back to original after you are no longer needing the service to be broken out and uniquely named as failure to do this can prevent future WMI hotfixes from being installed.

Simply run following command then restart wmi service: sc config winmgmt type= share

8. Restart wmi service with net stop winmgmt and net start winmgmt commands again

9. Verify you now see wmisvchost.exe process running by running tasklist or looking in task manager at process list

10. For sake of brevity here, follow steps 4-14 from Scenario 1a with the exception of typing in wmisvchost.exe in place or wmiprvse.exe for process we are enabling “Create user mode stack trace database” against.

11. Here we want to use procdump to dump the wmisvchost.exe process along with every instance of wmiprvse.exe that is running. Reference steps 9-11 listed in Scenario 1a above.

First command will dump wmisvchost.exe 3 times spaced at 5 minute interval. Once it has completed, and then run second command to dump out each instance of wmiprvse.exe that is running.

Command for dumping wmisvchost.exe would be: procdump –ma -s 300 -n 3 wmisvchost.exe

Command for dumping each instance of wmiprvse just once: procdump –ma

Note: Replace with actual PID for each instance of wmiprvse.exe

At this point you will now need to open a Support Incident Case with Microsoft to get the process dumps analyzed to determine cause of high memory usage

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Scenario 2a: High Memory Consumption by Wmiprvse.exe caused by Private Data memory

This scenario is a little bit different than being caused by Heap, as just dumps in of themselves normally do not tell the full story. In this type of case, we need to know what type of wmi activity is occurring and it becomes significantly harder and more involved to try and determine cause.

We will need to collect procdumps still, but also need to add in WMI activity logging.

1. From start run type in eventvwr.msc

2. On the View menu at the top select “show analytical and debug logs” so it displays check mark next to it

3. Expand Applications and Services\Microsoft\Windows\WMI-Activity

          Right click on items Debug and Trace and select “Enable” for each one

4. Download the latest version of the Windows Sysinternals tool Process Explorer http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx.

5. Find the instance of wmiprvse.exe with high memory consumption and right click on it and bring up the properties sheet. Click on the WMI Providers tab and document the listed providers

Alternatively you could run following wmic command from command prompt to get a list of loaded providers and their associated PID you could then match up to PID with instance of wmiprvse with high

memory usage:

wmic path msft_providers get Provider,HostProcessIdentifier /format:list

6. We now want to take that list of providers and configure them to run in their own instance of wmiprivse.exe. Open an instance of PowerShell with admin rights

7. Run the following commands: Replace ProviderName below with actual ProviderNamer found from step 9, retain the quote marks.

$prv = gcim -namespace root/standardcimv2 __win32provider -filter "name='ProviderName'"

$prv.HostingModel = $Prv.HostingModel + ":OWN"

set-ciminstance -inputobject $prv

Repeat the above for each Provider found in step 5

8. Restarting of Wmi service will put the settings into effect without having to reboot machine

9. When memory usage is high, use Procdump tool to dump out the wmiprvse.exe exhibiting high memory usage. http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

10. Open a command prompt with elevated or administrative rights and change to the directory where you saved Procdump

11. Open Task Manager and add the PID column view then go locate the instance of wmiprvse.exe with high memory usage and note the PID, or use Process Explorer

12. Run the following command: procdump –ma -s 300 -n 3

Note: Replace with actual PID you documented for instance of wmiprvse.exe exhibiting high memory usage

The above command will produce 3 dumps space out 5 minutes apart each in same directory you ran the procdump command from

13. Collect a network trace for 2 minutes using Network Monitor. Latest version can be found at: http://www.microsoft.com/en-us/download/details.aspx?id=4865

14. Now save wmi-activity traces in Event Viewer, do so by right clicking on each and select “Save all events as” option

At this point you will now need to open a Support Incident Case with Microsoft for data analysis and most likely for more in depth troubleshooting and data collection methods

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Scenario 2b: High Memory Consumption by WMI (Windows Management Instrumentation) service caused by Private Data memory

NOTE: If you have already broken the WMI service out to run in its own general svchost process following directions at beginning of this article, then you can skip to step 5

  1. Open command prompted with elevated privileges
  2. Break WMI service out into its own svchost process by running following command: sc config winmgmt type= own
  3. Restart WMI service with net stop winmgmt and net start winmgmt commands
  4. Verify winmgmt service running in its own svchost process by runnning tasklist /svc
  5. From start run type in eventvwr.msc
  6. On the View menu at the top select “show analytical and debug logs” so it displays check mark next to it
  7. Expand Applications and Services\Microsoft\Windows\WMI-Activity

          Right click on items Debug and Trace and select “Enable” for each one

8. Here we want to use procdump to dump the svchost process housing the WMI Service along with every instance of wmiprvse.exe that is running. Reference steps 9-10 listed in Scenario 1a above

a. From command prompt run tasklist /svc and locate the instance of svchost that winmgmt is running in and note the PID

b. First command will dump svchost.exe 3 times spaced at 5 minute interval. Once it has completed, and then run second command to dump out each instance of wmiprvse.exe that is running just once

Command for dumping svchost.exe housing winmgmt would be: procdump –ma -s 300 -n 3

Note: Replace with actual PID for svchost process housing winmgmt

Command for dumping each instance of wmiprvse running would be: procdump –ma

Note: Replace with actual PID for each instance of wmiprvse.exe

 

  1. Collect a network trace for 2 minutes using Network Monitor. Latest version can be found at: http://www.microsoft.com/en-us/download/details.aspx?id=4865
  2. Now save wmi-activity traces in Event Viewer, do so by right clicking on each and select “Save all events as” option

At this point you will now need to open a Support Incident Case with Microsoft for data analysis and most likely for more in depth troubleshooting and data collection methods

Reference this blog when you open the Support Incident Case with Microsoft as it will help the engineer understand what actions have been taken or followed and will help us track the effectiveness of the blog.

Next up: WMI: How to troubleshoot High CPU Usage by WMI Components

Sample C# code for using the latest WMI classes to manage Windows Storage

$
0
0

 

This blog post shows a bit of C# code to use the Windows Storage Management API (SM-API) classes that were introduced in Windows Server 2012 and Windows 8.

You can find a list of these classes at class described at http://msdn.microsoft.com/en-us/library/hh830612.aspx, including MSFT_PhysicalDisk, MSFT_StoragePool or MSFT_VirtualDisk.

I found a number of examples with the old interface using the old classes like Win32_Volume, but few good ones with the new classes like MSFT_Volume.

This is some simple C# code using console output. The main details to highlight here are the use of System.Management and how to specify the scope, which allows you to manage a remote computer.

Please note that you might need to enable WMI on the computer, which can be easily done with the command line “winrm quickconfig”.

 

Here is my first attempt is below, using just only System.Management and the ManagementObject class.

It’s implemented in a simple console application, which lists information about volumes and physical disks on the local machine.

 

using System;
using System.Text;
using System.Threading;
using System.Management;

namespace SMAPIQuery
{
    class Program
    {
        static void Main(string[] args)
        {
            // Use the Storage management scope
            ManagementScope scope = new ManagementScope("\\\\localhost\\ROOT\\Microsoft\\Windows\\Storage");
            // Define the query for volumes
            ObjectQuery query = new ObjectQuery("SELECT * FROM MSFT_Volume");

            // create the search for volumes
            ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
            // Get the volumes
            ManagementObjectCollection allVolumes = searcher.Get();
            // Loop through all volumes
            foreach (ManagementObject oneVolume in allVolumes)
            {
                // Show volume information
                if (oneVolume["DriveLetter"].ToString()[0] > ' '  )
                {
                    Console.WriteLine("Volume '{0}' has {1} bytes total, {2} bytes available", oneVolume["DriveLetter"], oneVolume["Size"], oneVolume["SizeRemaining"]);
                }
            }

            // Define the query for physical disks
            query = new ObjectQuery("SELECT * FROM MSFT_PhysicalDisk");

            // create the search for physical disks
            searcher = new ManagementObjectSearcher(scope, query);

            // Get the physical disks
            ManagementObjectCollection allPDisks = searcher.Get();

            // Loop through all physical disks
            foreach (ManagementObject onePDisk in allPDisks)
            {
                // Show physical disk information
                Console.WriteLine("Disk {0} is model {1}, serial number {2}", onePDisk["DeviceId"], onePDisk["Model"], onePDisk["SerialNumber"]);
            }

            Console.ReadLine();
         }
        }
    }

 

Here is some sample output from this application:

 

Volume 'D' has 500104687616 bytes total, 430712184832 bytes available
Volume 'E' has 132018860032 bytes total, 110077665280 bytes available
Volume 'F' has 500105216000 bytes total, 356260683776 bytes available
Volume 'C' has 255690010624 bytes total, 71789502464 bytes available

Disk 2 is model SD              , serial number
Disk 0 is model MTFDDAK256MAM-1K12, serial number         131109303905
Disk 3 is model 5AS             , serial number 00000000e45ca01b30c1
Disk 1 is model ST9500325AS, serial number             6VEK9B89

 

Next, I got some help from other folks from Microsoft, including Cosmos Darwin (PM Intern) and Gustavo Franco (Senior Developer).

I wanted to use the more modern CimInstance objects, which offer more flexibility. Here’s the same code as above, but now using the Microsoft.Management.Insfrastructure namespace:

 

using System;
using System.Text;
using System.Threading;
using Microsoft.Management.Infrastructure;

namespace SMAPIQuery
{
    class Program
    {
        static void Main(string[] args)
        {

            string computer = "localhost";

            // Create CIM session
            CimSession Session = CimSession.Create(computer);

            // Query Volumes, returns CimInstances
            var allVolumes = Session.QueryInstances(@"root\microsoft\windows\storage", "WQL", "SELECT * FROM MSFT_Volume");

            // Loop through all volumes
            foreach (CimInstance oneVolume in allVolumes)
            {
                // Show volume information

                if (oneVolume.CimInstanceProperties["DriveLetter"].ToString()[0] > ' '  )
                {

                Console.WriteLine("Volume '{0}' has {1} bytes total, {2} bytes available", oneVolume.CimInstanceProperties["DriveLetter"], oneVolume.CimInstanceProperties["Size"], oneVolume.CimInstanceProperties["SizeRemaining"]);
                }

            }

            // Query Physical Disks, returns CimInstances
            var allPDisks = Session.QueryInstances(@"root\microsoft\windows\storage", "WQL", "SELECT * FROM MSFT_PhysicalDisk");

            // Loop through all physical disks
            foreach (CimInstance onePDisk in allPDisks)
            {
                // Show physical disk information
                Console.WriteLine("Disk {0} is model {1}, serial number {2}", onePDisk.CimInstanceProperties["DeviceId"], onePDisk.CimInstanceProperties["Model"].ToString().TrimEnd(), onePDisk.CimInstanceProperties["SerialNumber"]);
            }

            Console.ReadLine();
         }
        }
    }

 

The output is the same as before, but you can see that the top portion of the code uses a completely different set of classes to create a CimSession, then query the objects, which return in the form of CimInstance objects.

That code works well if the user running it has the right credentials to access the objects. If you want to provide specific credentials for your CimSession, that’s also possible with a bit more code. Here’s what it would look like:

 

using System;
using System.Text;
using System.Threading;
using Microsoft.Management.Infrastructure;
using Microsoft.Management.Infrastructure.Options;
using System.Security;

namespace SMAPIQuery
{
    class Program
    {
        static void Main(string[] args)
        {

            string computer = "10.1.1.1";
            string domain = "Domain1";
            string username = "User1";

            string plaintextpassword;

            Console.WriteLine("Enter password:");
            plaintextpassword = Console.ReadLine();

            SecureString securepassword = new SecureString();
            foreach (char c in plaintextpassword)
            {
                securepassword.AppendChar(c);
            }

            // create Credentials
            CimCredential Credentials = new CimCredential(PasswordAuthenticationMechanism.Default, domain, username, securepassword);

            // create SessionOptions using Credentials
            WSManSessionOptions SessionOptions = new WSManSessionOptions();
            SessionOptions.AddDestinationCredentials(Credentials);

            // create Session using computer, SessionOptions
            CimSession Session = CimSession.Create(computer, SessionOptions);

            var allVolumes = Session.QueryInstances(@"root\microsoft\windows\storage", "WQL", "SELECT * FROM MSFT_Volume");
            var allPDisks = Session.QueryInstances(@"root\microsoft\windows\storage", "WQL", "SELECT * FROM MSFT_PhysicalDisk");

            // Loop through all volumes
            foreach (CimInstance oneVolume in allVolumes)
            {
                // Show volume information

                if (oneVolume.CimInstanceProperties["DriveLetter"].ToString()[0] > ' '  )
                {

                Console.WriteLine("Volume '{0}' has {1} bytes total, {2} bytes available", oneVolume.CimInstanceProperties["DriveLetter"], oneVolume.CimInstanceProperties["Size"], oneVolume.CimInstanceProperties["SizeRemaining"]);
                }

            }

            // Loop through all physical disks
            foreach (CimInstance onePDisk in allPDisks)
            {
                // Show physical disk information
                Console.WriteLine("Disk {0} is model {1}, serial number {2}", onePDisk.CimInstanceProperties["DeviceId"], onePDisk.CimInstanceProperties["Model"].ToString().TrimEnd(), onePDisk.CimInstanceProperties["SerialNumber"]);
            }

            Console.ReadLine();
         }
        }
    }

 

Notice that the only thing that changed is how you create the CimSession object, using the SessionOptions to provide explicit credentials.

This sample code if focused on the storage side of things, so I am letting the user enter a visible plaintext password here. It should go without saying that you should provide a better mechanism to enter passwords.

You can get all the details on the other classes in the Microsoft.Management.Infrastructure namespace at http://msdn.microsoft.com/en-us/library/microsoft.management.infrastructure(v=vs.85).aspx.

All right, that should give you plenty of food for thought. Now go write some code!

Top Support Solutions for Windows Server 2012 Essentials and Windows Server 2012 R2 Essentials

$
0
0

These are the top Microsoft Support solutions for the most common issues experienced when you use Windows Server 2012 Essentials and Windows Server 2012 R2 Essentials.

1. Solutions related to Remote Web Access:

2. Solutions related to Office 365 integration issues:

3. Solutions related to installation issues:

4. Solutions related to Migrating SBS to a new server or to new servers:

5. Solutions related to Server activation:

Top Support Solutions for Windows Server 2008 and Windows Server 2008 R2

$
0
0

Top Microsoft Support solutions for the most common issues experienced when you use Windows Server 2008 (updated quarterly).

1. Solutions related to bugchecks, stop errors, and unexpected restarts:

2. Solutions related to Active Directory issues:

3. Solutions related to Active Directory replication:

4. Solutions related to DNS:

5. Solutions related to Active Directory Federation Services (AD FS):

6. Solutions related to File Replication Technologies (FRS and DFSR):

7. Solutions related to installing Windows updates or hotfixes:

8. Solutions related to system hangs:

9. Solutions related to Active Directory Certificate Services:

10. Solutions related to TCP/IP communications issues:

Top Support Solutions for Windows 8 or 8.1

$
0
0

Here are the top Microsoft Support solutions for the most common issues IT Pros experience when using or deploying Windows 8 or 8.1 (updated quarterly).

1. Solutions related to installing Windows updates or hotfixes:

2. Solutions related to installing or upgrading Windows:

3. Solutions related to wireless networking and 802.1X authentication:

4. Solutions related to routing Windows V3\Windows Security Technologies\BitLocker:

5. Solutions related to “Cannot activate Windows’:

6. Solutions related to networking or file sharing technologies

7. Solutions related to Sysprep

8. Solutions related to Inbox apps such as Mail, Calendar, People, Photos, Messaging, and News

9. Solutions related to Bugchecks, Stop errors, and unexpected restarts:

10. Solutions related to Driver management

Python Tools for Visual Studio 2.1 RC

$
0
0

Today we released the Python Tools for Visual Studio 2.1 RC for download on CodePlex. Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio that supports programming with the Python language. PTVS supports a broad range of features including CPython/IronPython, editing, IntelliSense, interactive debugging, profiling, IPython REPL with inline graphics cross-platform/language debugging and running Python websites on Microsoft Azure with tooling integration for both publishing and debugging.

Python Tools For Visual Studio

PTVS 2.1 RC is now also available for Visual Studio Express 2013 for Desktop or Web (starting with Update 2) and users of Visual Studio 2013, 2012 or 2010 Professional or higher.

Here are the highlights in today’s release:

  • Numerous bug fixes throughout the entire product, especially for IntelliSense and code completions, debugging, general stability and performance
  • Search paths within a project are now used for IntelliSense
  • Django​ template debugging now works on Python 3.4
  • Anaconda environments can now use 'conda install' from PTVS
  • The standard string visualizers (HTML, XML, JSON) can now be used when debugging
  • Brace highlight color can now be changed

​For a full list of changes please see the release notes and the Issues​ page.

clip_image004

Shahrokh Mortazavi, Partner PM, Visual Studio Cloud Platform Tools

Shahrokh Mortazavi currently works in the Developer Division of Microsoft on Python and Node.js tool chain. Previously, he was in the High Performance Computing group at Microsoft. He worked on the Phoenix Compiler tool chain (code gen, analysis, JIT) at Microsoft Research and for 10 years led Sun Microsystems’ Code Generation & Optimization compiler backend teams.


Hyper-V backup at Private Cloud scale

$
0
0

Update Rollup 3 (UR3) for DPM 2012 R2 brings key enhancements for VM backups that will ensure guaranteed backup SLAs and make backups much more efficient at scale for a virtualized deployment. The current update is aimed at minimizing the impact that backup has on the production storage infrastructure for private cloud deployments (1000s of VMs) on Windows Server 2012 R2.

We support both the configurations for Hyper-V deployments as listed below:

  • VMs hosted on a Hyper-V cluster with storage on SMB shares backed by a Scale-Out File Server cluster (Hyper-V over SOFS)
  • VMs hosted on a Hyper-V cluster with storage on Clustered Shared Volumes (Hyper-V over CSV)

Scale testing on SOFS

We have done extensive scale testing by taking continuous daily backups for 3 weeks using Virtualized DPM servers. The guest OS used for the protected VMs was Windows Server 2012 R2. The workload running inside each of the VMs was spread across multiple IO profiles (SQL OLTP, Exchange, File Server, Video Streaming, SQL Decision Support System). 

Here are the details of the Hyper-V over SOFS deployments:

image
ConfigurationHyper-V over SOFS
# of Hyper-V Hosts24
VM Config (RAM)2-8 GB
VM Disk Size120 GB (20 GB for OS + 100 GB for data)
Total # of VMs1000
VM Churn per day5%
SOFS Cluster Nodes4
# of Virtual DPM Servers8

We scale tested with each DPM server protecting between 50 to 250 VMs. DPM VMs were deployed in scale-out configuration to protect VMs from the same Hyper-V cluster nodes. We pivoted the results around the following criteria:  

  • Backup success rate per day – This signifies the percentage of VMs having successful backups in a single day.
  • Overall backup success rate – This signifies overall percentage of successful backups across all VMs for a 3 week duration.

We achieved more than 98% for both the metrics. It also implies that there were more than 20,000 jobs than ran successfully during this 3 weeks duration. The few errors that we encountered were due to known auto-recoverable failures - such as "Out of storage space" and "Retry-able VSS errors".

Stress testing on SOFS

We stress tested the Hyper-V backups on a slightly different scale (2 DPM servers protecting 500 VMs), taking 8 backups a day (every 3 hours) for more than a week. Here’s a 3 min video which shows the backup in action:

Scale testing on CSV

We did scale testing for Hyper-V over CSV and got similar results. 

image
ConfigurationHyper-V over CSV
# of Hyper-V Hosts12
VM Config (RAM)1-8 GB
VM Disk Size50 GB (20 GB for OS + 30 GB for data)
Total # of VMs600
SAN Make/ModelDell Compellent SC8000
# of CSV12
# of Virtual DPM Servers2

 

DPM Deployment

The recommended virtualized deployment model is to provision backup storage through VHDs residing on Scale-out File Server (SOFS) shares.

A suggested DPM deployment configuration would look like the one mentioned below:

Virtual Processors4
RAM8 GB
NIC10 Gbps
Storage20 TB (1 TB X 20) Dynamic VHDs on SMB share

This configuration has a few advantages:

  1. Virtualized DPM setup allows easy scale-out
  2. SOFS cluster provides storage resiliency
  3. VHDs used as the backup storage provides flexibility for data growth

Additionally, we heard some customers required the flexibility to run backups during off-peak hours, so the concept of a Backup Window for VM data sources was introduced. Here is how you can set the backup window using PowerShell (ensure that the backup schedule aligns with the StartTime parameter used in Set-DPMBackupWindow):

Set-DPMBackupWindow -ProtectionGroup -StartTime 23:00 -DurationInHours 6

Set-DPMProtectionGroup

Now that you have seen scalable VM backup in action, try it out yourself. Installation instructions for this DPM update are provided in KB 2966014.

    MSRT August - Lecpetex

    $
    0
    0

    ​This month we added Win32/Lecpetex to the Microsoft Malicious Software Removal Tool (MSRT).

    The addition will assist with the detection and clean-up of this family following the recent Facebook take-down of the Lecpetex botnet. The graph below shows the number of unique machine encounters we have seen since February this year.

    Lecpetec encounters 

    The primary Lecpetex payload is a Litecoin miner that is installed to the infected system. A malicious hacker can then use the compromised PC to generate Litecoins. 

    We have seen Lecpetex being distributed through spam emails, exploit kits, and malware downloaders, such as TrojanDownloader:VBS/Lecpetex.A. It usually employs a scare campaign to trick users into clicking on URLs containing the malware’s components. This social engineering technique is not new, but the prevalence of Lecpetex in recent months proves that it is still very effective.

    For example, the spam emails usually use the following format:

    Subject: RE: Documents  
    Body: Here re the required documents you asked for.
    Documents.zip 
    Keep me posted for any complaints or anything.
    Thank you.

    In this example Documents.zip is hyperlinked to a URL that downloads the malware.

    Lecpetex can also spread by sending Facebook messages to the friends of infected users. Figure 1 shows some of the instant message templates seen from the malware code. Lecpetex sends these messages to the infected user’s buddy list, or uses the Facebook Graph Search to find potential targets. 

    It is interesting how Lecpetex constructs these messages to catch the attention of its recipients and encourage them to respond urgently by clicking on a ZIP file. The message is composed of four parts:

    Lecpetex spam message components 

    Figure 1: The spam Facebook messages sent by Lecpetex are assembled from four separate components

    The malware is attached to the message as a ZIP file. More recent messages sent by Lecpetex also include “Hahaha” and “lol”.

    If you have received or clicked on a message similar to that shown above, you should run a full scan of scan your PC using an up-to-date real-time security product, such as Microsoft Security Essentials.

    You can also read more about this malware in the Win32/Lecpetex family description. 

    Zarestel Ferrer
    MMPC Melbourne

    Follow us on Twitter (@MSFTMMPC) and like us on Facebook to get notifications of our blog posts and industry news.

    Power BI July Roundup

    $
    0
    0

    “Microsoft received high client feedback scores for its agile, business user self-service and advanced data visualization functionality. Clients also gave Microsoft BI a high score for its product vision”. This quote from the Forrester Wave: Agile Business Intelligence Platforms report released last month shows Microsoft's commitment to bring business intelligence to a billion users by making data accessible through the tools that people use every day.

    July was full exciting announcements around Power BI. On top of our classic Power Query monthly update, which always generates a lot of positive buzz, we announced several Power Map improvements and the release of cloud modeling for Q&A, which you can see in action on our post talking about the end to end construction of our World Cup Q&A model. Also, like usual, our amazing community created tons of articles and guides that we highlight every month on this news roundup.

    Enjoy and don't forget to send our way any interesting posts or articles you find about Excel and Power BI!

    July Product Updates

    07/15/14 - New in Power BI: Cloud Modeling for Q and A

    07/16/14 - Power Map July Update

    07/30/14 - 6 new updates in Power Query - July 2014 

    July Power BI Articles

    07/08/14 - Instant, Interactive 3D mapping of your data – Power Map: Dr. Nitin Paranjape created this complete series to get started with Power Map 3D geomapping

    07/11/14 - Visualizing Retailer POS Data using Power BI: Shish Shridhar shows us how he used Power Query, Power Pivot, Power View and Power Map to build interactive dashboards in Excel to analyze retail data

    07/14/14 - New Power BI Features Shown At WPC: Chris Webb summarizes the new Power BI features announced at WPC

    07/16/14 - Forrester names Microsoft as a Leader in Agile Business Intelligence: Download the full report to find out why Forrester named Microsoft a leader in Agile BI

    07/17/14 - NBA games live tweeting and buzzer beating: Hear directly from Michael Carper, our Power BI Demo Contest winner, about how he created this amazing model including real time tweets and NBA games

    07/29/14 - Behind the Scenes: How Power BI Handled The World Cup: an end to end summary of how we built the World Cup Q&A demo

     

    Help us find great Power BI content @MSPowerBI with the hashtag #PowerBIroundup

    Thanks again to our community!

    Visionaries need great productivity and collaboration tools

    $
    0
    0

    Connect and collaborate with the powerful tools in Office 365 for Enterprise

    The business dreams of the future are imagined every day. For kids, it happens in play. For adults, it happens in work. Neither can go it alone. What sets dreams apart from reality is the tool belts we wear—using tools lets us collaborate, stay productive, and be efficient. Even the toddlers in this video know that working together with the right tools is the best way to get down to business.

    Office 365 Enterprise delivers tools optimized for business, tools that are crafted for the many players involved in the journey from dream to reality. From the CEO to field workers, everyone needs ways to connect and collaborate.

    The dreamers: visionaries

    The CEO has a big dream. He is passionate about towers and wants to build the tallest one possible. He needs help to collect and share his ideas, and he needs a way to unite people under his cause. The CEO could benefit from Yammer. If he used social media for enterprise, he could say, “Let’s build a tower!” and get feedback within minutes instead of hours or potentially months. He could also get others onboard with his dream easily, because using Yammer is fun.

    The drafters: engineers

    The engineers draft the dream. They say, “Let’s make that tower out of wood blocks. And let’s make it taller than yesterday’s tower.” They need not only plans, but also the ability to innovate new solutions on the fly should their plans fail the first time around. Engineers need one place where they can confer, no matter their location. Office 365 Enterprise delivers features that can help. Power BI for Office 365 lets them visualize the journey with self-service analytics, and Lync HD video conferencing makes it possible for them to connect: they can whiteboard, share screens, or initiate group conference calls from the same application, on whatever device they want.

    The doers: field workers

    Onsite workers need to be able to access the latest set of directions as quickly as possible. They might say, “Hey, let’s use this bench to get the height we need,” without realizing that the plan for the tower’s height has been changed. The visionary’s dream and engineering’s hard work is lost if workers on the ground don’t know, and therefore can’t implement, the new plans. OneDrive for Business can give them the confidence to know they are working from the latest version of the plans. When you store and share files on OneDrive, everyone has access to the most recent version.

    Throughout each stage of the journey from dream to reality, the security enhancements of Microsoft Office 365, like rights management and encrypted email, help keep access controls in place so that the right plans are seen by the right people at the right time.

    Tools can bring us together

    As these tower-building toddlers show, humans are on a continual journal of discovering our togetherness. We learned long ago that to accomplish anything on this planet, we needed help from the right people and from the right tools. Businesses need the right tools too. Office 365 can help your business reach even greater heights by helping everyone—from the dreamers to the doers—collaborate with great productivity tools. Learn more at office.com/enterprise.

     

     

     

    The post Visionaries need great productivity and collaboration tools appeared first on Office Blogs.

    Office 365 APIs using AngularJS standalone websites—samples shipped

    $
    0
    0

    Today we shipped two new samples that focus on standalone web applications that use the AngularJS framework communicating back to Office 365 using the Office 365 API. One is a Research Project Tracker scenario that was written by Andrew Connell (@AndrewConnell) and Scot Hillier (@ScotHillier), and the other is an Expense Tracker scenario written by Dan Wahlin (@DanWahlin). These scenarios highlight the power of Office 365 in real-world examples and show the end-to-end build of the entire solution in Visual Studio. The samples include setup guides (as GitHub markdown files) in each repo that you can follow to get the scenarios running against your own developer tenants, and Channel 9 videos you can watch.

    Research Project Tracker

    ROffice 365 APIs 1

    The Research Project Tracker scenario allows you to create research projects and then capture research links via a Mail App in Outlook and browser bookmarklet. Once the research has been captured, you can then inject it as a bibliography in your Word document through a Task Pane app. This sample was built with an AngularJS standalone website and two ASP.NET MVC 5 provider-hosted websites for the Word and Outlook apps. The research project data is all stored in SharePoint lists. The code can be found at https://github.com/OfficeDev/Research-Project-Code-Sample.

    Expense Tracker

    Expense Tracker

    The Expense Tracker scenario allows managers to track the expenses each employee has created. The data in this scenario is stored in SharePoint lists and fetched in the AngularJS standalone web application via the Office 365 APIs. The code can be found at https://github.com/OfficeDev/SP-AngularJS-ExpenseManager-Code-Sample.

    Benefits of Office 365 APIs

    Benefits of Office 365 APIs

     

    Both of these samples take advantage of the new Azure Active Directory authentication mechanism with the Office 365 APIs that can be called from standalone web applications and mobile device applications. These APIs allow you not only to call into OneDrive for Business, Mail, Calendar, Contacts, Sites, and Users & Groups, but also into the existing SharePoint Client Side API to do more advanced SharePoint scenarios. You can find more documentation on the Office 365 API on MSDN.

    Contribute

    Do you have ideas about how to improve these scenarios and want to contribute? Feel free to submit pull requests with your changes and we’ll work through them. If there are any budding mobile device application developers out there, we’d love to see some integration with these scenarios: for instance, submitting your scanned receipts directly as an expense against your employee record from an Android native app using the Office 365 API Android SDK.

    There are plenty more code samples on our GitHub.com/OfficeDev area, so please check them out!

    Last Friday we ran a live streamed Introduction to Office 365 Development session on Microsoft Virtual Academy course.  This will be available on-demand within the next few weeks. All of the slides, demo code, and hands-on labs are available in GitHub.com for you to use now too.

    The post Office 365 APIs using AngularJS standalone websites—samples shipped appeared first on Office Blogs.

    Viewing all 13502 articles
    Browse latest View live


    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>