How to find MTU on a list of Windows Servers, using PowerShell ?

# This script can be used to find MTU size on a list of servers. Choose FQDN or make sure all servers are accessible using server name. # Get-NetIPInterface  is part of PowerShell module NetTCPIP, and should work for all servers with PowerShell v3+, though this is not tested.# Any errors will be displayed in the console window.

$servers = Get-Content "D:\temp\all-servers.txt
@(
foreach ($name in $servers) 
{ 
 if ( Test-Connection -ComputerName $name -Count 1 -ErrorAction SilentlyContinue )
 {
 $var1 = New-PSSession -ComputerName $name
 Invoke-Command -Session $var1 -ScriptBlock { Get-NetIPInterface | where {($_.AddressFamily -eq "IPv4") -and ($_.NlMtu -lt 10000)} | select NlMtu, interfacealias, pscomputername } | ft -a
 #Invoke-Command -Session $var1 -ScriptBlock { netsh interface ipv4 show subinterface} | fl *       #we can use this line using netsh as an alternative to the invoke-command in the above line
 sleep 5
 $var1 | Remove-PSSession #this will remove/close all existing ps sessions
 $var1 = $null
 }
 else
 {
 Write "$name is not pinging/not accessible"
 }
}) | out-file "D:\temp\MTU-all-servers-1.csv"

#script ends here#

Advertisements

Licensing for SQL Server 2012

http://www.mssqltips.com/sqlservertip/2942/understanding-the-sql-server-2012-licensing-model/

http://sqlmag.com/sql-server-2012/sql-server-2012-editions

Editions and Components of SQL Server 2012

http://technet.microsoft.com/en-us/library/ms144275.aspx

Compute Capacity Limits by Edition of SQL Server

http://technet.microsoft.com/en-us/library/ms143760.aspx

Features Supported by the Editions of SQL Server 2012

http://technet.microsoft.com/en-us/library/cc645993.aspx

How To Fix Non Starting SQL Reporting Services

The SQL Server Reporting Services … service failed to start due to the following error:  The service did not respond to the start or control request in a timely fashion.

Sound familiar? It was a problem I was having with a couple of SQL Server 2008 R2 machines built on VMWare 5.1 hosts. The SQL Server Reporting Services don’t start automatically on reboot and won’t start when manually instigated.

Fortunately it can be easily remedied by increasing the default service time-out:

  • Open Regedit
  • Navigate to: KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  • Create a new DWORD value called ServicesPipeTimeout
  • Modify it and ensure it is set to Decimal and enter the value 60000
  • Close Regedit and reboot the server

Note: Incorrect modification of the registry can lead to serious problems, please be careful. For protection it’s worth taking a backup of the registry before hand.

If this does not work then you may have a more serious issue, if this is the first time you have tried to start the service then double check you have met the prerequisites for installation and have it configured correctly.

 

This blog was copied from: http://sysbadmin.wordpress.com/2013/03/25/how-to-fix-non-starting-sql-reporting-services/

 

How To Backup/Restore An Active Directory Integrated DNS Zone

Whenever you make a fundamental change to a DNS zone it’s a good idea to back it up, but how do you do that when your DNS is Active Directory Integrated without taking a system state backup? We’ll take a look at both AD integrated and standalone methods to get a better understanding.

Non-AD integrated (Standalone) DNS:

If you’re running standalone DNS and simply have a Primary/Secondary setup then performing this style of backup is really very simple.  As standard DNS zone file information is stored in the %systemroot%\system32\dns folder (typically C:\Windows\System32\dns). When the DNS service starts it simply loads the dones from these files, likewise when a change is made it creates a backup and places it in the backup folder on the aforementioned path. It’s worth noting that only one backup is maintained so if you make another change the previous backup is overwritten, therefore if you make a sideways copy of these backups you can keep a version as long as you need.

AD Integrated Zones:

As AD integrated zones are stored within the Active Directory they do not have  any files associated with them and therefore are not backed up to the backup directory. So how do we get it out? Using DnsCmd.exe is how!

The Microsoft example of a zone export is as follows:

dnscmd [] /zoneexport 

This looks great but here it is in a more useful looking format:

DnsCmd DNSserver1 /ZoneExport example.com example.com.bak

Note that the backup file you have created will land in %systemroot%\System32\dns

How to restore AD Integrated Zones:

Warning: You should only attempt to restore this file as a last resort as it could impact your users especially then allowing for replication to the DNS holding DC’s.

  • Hop onto the DNS Management Console and delete the zone
  • Rename your zone backup to have a .dns extension, in the example above this would go from example.com.bak to example.com.dns
  • Create a new zone with the FQDN of the zone you deleted, if using the New Zone Wizard be sure to uncheck the Store in Active Directory option.
  • When prompted to create a new zone file or use an existing file, choose an existing file, the wizard should automatically fill in the zone FQDN with the .dns extension, this should look the same as your renamed zone file (example.com.dns)
  • Complete the wizard
  • Check the zone information is as per the zone before the changes
  • If all is well, simply change the zone type to Active Directory Integrated.

Job done.

How To Clean Up C:\Windows\Winsxs

So you’ve been taking a look at what’s eating your hard drive space with WinDirStat or TreeSizeFree or similar and have spotted the C:\Windows\Winsxs folder.

Winsxs stands for Windows Side by Side and is basically where Windows keeps multiple versions of the same .dll’s to allow multiple applications to run without any compatibility problems. If you browse it you’ll see what looks like a lot of duplicate .dll files. I’m not going to go into the in’s and out’s of it here as there are plenty of good run through pages on the web.

What I will do is give you the easy and safe way to clear it down.

From the C:\Windows\System32 folder run:

DISM /online /Cleanup-Image /SpSuperseded

 

This blog was copied from: http://sysbadmin.wordpress.com/2012/10/14/how-to-clean-up-cwindowswinsxs/

 

How To Find Your Local NTP Server

So, you get on site and no one knows where their NTP server is, there’s a quick and easy way to find out.

The old schoolers will tell you to use the net time commmand, but this was deprecated and is no longer recommended for use by Microsoft.

If you still want to use it or you’re on a Windows Server 2000 box

  • Open up a command prompt
  • Type: net time /query \\serveryouwanttoquery

If you’re on anything newer:

  • Open up a command prompt
  • Type: w32tm /query /computer:computeryouwanttoquery /source
  • If you’re having trouble w32tm.exe is found in “C:\Windows\System32″.

W32tm.exe is a powerful little tool that not only allows you to check the basic status but also completely configure the NTP server/service to whatever your heart desires. For more, check out this technet article over at the Microsoft site.

 

This blog was copied from: http://sysbadmin.wordpress.com/2012/09/27/how-to-find-your-local-ntp-server/

 

Backing up Zone Files in Windows Server 2008 DNS Zone

Someone asked me to turn re-use an old server from having a catalog installed to just hosting primary DNS zones. So before I make this Active directory integrated DNS server to just a primary or do anything worthwhile I wanted to backup the zones. How?

First stop the DNS service by doing this command at the cmd prompt “net stop “DNS Server”

Next, just create a separate copy of the “%WinDir%\System32\dns” in my case C:\Windows\System32\dns directory that contains flat files (text files) of your zones. There are also some samples inside this directory, not required to be included.

Lastly is start the DNS service again by doing “net start “DNS Server”

To restore it just stop the DNS service, copy your backup back to the above directory then start the DNS service again and the zones are restored :D

I found my first hint on how to do this here: http://technet.microsoft.com/en-us/library/dd392269(WS.10).aspx

 

This blog was copied from : http://johndelizo.wordpress.com/2009/08/12/backing-up-windows-server-2008-dns-zone-files/