PowerShell script to find network info for all NICs on a list of Windows servers

### PowerShell script to find for all NICs on a Windows server : IP address, Subnet Mask, Gateway, if DHCP is enabled, DNS servers, WINS servers
# This works on a given list of servers, and collects info for all NICs of server.
################################################################

$outputfile = “D:\temp\Networkinfo-4.csv”
$servers = get-content “D:\temp\test2.txt”
$report = @()

foreach ($Computer in $servers)
{
if(Test-Connection -ComputerName $Computer -Count 1 -ea 0)
{
$Networks = $null
$Networks = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $Computer -ea silentlycontinue | ? {$_.IPEnabled}

if($Networks)
{
foreach ($Network in $Networks)
{
$IPAddress = $null
$SubnetMask = $null
$DefaultGateway= $null
$DNSServers = $null
$WINSPrimaryserver = $null
$WINSSecondaryserver = $null
$IsDHCPEnabled = $null

$IPAddress = $Network.IpAddress[0]
$SubnetMask = $Network.IPSubnet[0]
$DefaultGateway = $Network.DefaultIPGateway -join ‘,’
$DNSServers = $Network.DNSServerSearchOrder -join ‘,’
$WINSPrimaryserver = $Networks.WINSPrimaryServer
$WINSSecondaryserver = $Networks.WINSSecondaryserver
$IsDHCPEnabled = $false

If($network.DHCPEnabled) { $IsDHCPEnabled = $true }

$OutputObj = New-Object -Type PSObject
$OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.ToUpper()
$OutputObj | Add-Member -MemberType NoteProperty -Name IPAddress -Value $IPAddress
$OutputObj | Add-Member -MemberType NoteProperty -Name SubnetMask -Value $SubnetMask
$OutputObj | Add-Member -MemberType NoteProperty -Name Gateway -Value $DefaultGateway
$OutputObj | Add-Member -MemberType NoteProperty -Name IsDHCPEnabled -Value $IsDHCPEnabled
$OutputObj | Add-Member -MemberType NoteProperty -Name DNSServers -Value $DNSServers
$OutputObj | Add-Member -MemberType NoteProperty -Name WINSPrimaryserver -Value $WINSPrimaryserver
$OutputObj | Add-Member -MemberType NoteProperty -Name WINSSecondaryserver -Value $WINSSecondaryserver

$OutputObj
$report += $OutputObj

} # foreach ends here
} # if Networks ends here
else { Write-Warning “Could not find any info on networks/NICs on server $Computer” }

} #if ping ends here
else { Write-Warning “Unable to access/ping $Computer” }

}

$report | Export-Csv $outputfile -NoClobber -NoTypeInformation

###########################################################

PowerShell script to find all IP addresses assigned on a list of Windows Servers

### PowerShell script to find all IP addresses assigned on a list of Windows Servers.
### List all IP addresses assigned in each server, includes IPv6
###############################################################################

$servers = Get-Content “D:\temp\test2.txt”
$reg=””
foreach ($server in $servers)
{
$reg+=$server+ “`t”+([System.Net.Dns]::GetHostAddresses(“$server”) | foreach {echo $_.IPAddressToString})+”`n”
}
$reg > “D:\temp\ping-IPs-1.csv”

PowerShell script to find FQDN and get ping status of Windows Servers

### PowerShell script to find FQDN and get ping status for given list of windows servers
# Servers which we failed to connect to get any info are collected in to a txt file.
### Writing credits : VM ###
###########################################################################

$servers = Get-Content “D:\temp\test2.txt”

@(
foreach ($name in $servers)
{
if ( Test-Connection -ComputerName “$name.domain.com” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name.domain.com is up”}
elseif ( Test-Connection -ComputerName “$name.a.domain.com” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name.a.domain.com is up”}
elseif ( Test-Connection -ComputerName “$name.b.domain.com” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name.b.domain.com is up”}
elseif ( Test-Connection -ComputerName “$name.c.domain.com” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name.c.domain.com is up”}
elseif ( Test-Connection -ComputerName “$name.newdomain.com” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name.newdomain.com is up”}
#elseif ( Test-Connection -ComputerName “$name” -Count 1 -ErrorAction SilentlyContinue ) { Write-output “$name is up”}
else
{
Write “$name FQDN not found/ server is not pinging” | out-file -Append “D:\temp\failed-ping-1.txt” -NoClobber
}
}
) | Out-file -FilePath “D:\temp\FQDN-1.csv”

PowerShell script to find a server is physical server or virtual machine

### Powershell script gives Manufacturer and Server Model for a given list of servers, and we can find if its a VM or a physical server.
### eg: for a VM, manufacturer will be “VMware, Inc.”, and model will be “VMware Virtual Platform”
### eg: for a physical server, manufacturer will be “HP” (or others), and model will be “ProLiant BL460c G7”
### Servers which we failed to connect to get any info are collected in to a txt file.
### writing credits : VM ###
#######################################################################################

$servers = Get-Content “D:\temp\test2.txt”
$result = @()
$finalresult = @()

foreach ($computer in $servers)
{
$result = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computer | select pscomputername, manufacturer, model
$finalresult+=$result
if (!$result) { Write “No info on server $computer” | out-file -Append “D:\temp\notfound-phy-vm.txt” -NoClobber }
$computer = $null
$result = $null
}

$finalresult | export-csv “D:\temp\VMphys-1.csv” -NoTypeInformation

PowerShell script to find OS name, Service Pack Version and OS-Architecture (32/64 bit)

### PowerShell script to find OS name, Service Pack Version and OS-Architecture (32/64 bit) for given list of servers
# servers which we failed to connect to get any info are collected in to a txt file
### writing credits : VM ###
#######################################################################################

$servers = Get-Content “D:\temp\test2.txt”
$result = @()
$finalresult = @()

foreach ($srv in $servers)
{
$result = Get-WMIObject Win32_OperatingSystem -ComputerName $srv | Select-Object csname, caption, ServicePackMajorVersion, OSArchitecture
$finalresult+=$result
if (!$result) { Write “No info on server $srv” | out-file -Append “D:\temp\notfound.txt” -NoClobber }
$srv = $null
$result = $null
}

$finalresult | export-csv “D:\temp\OS-outputs.csv” -NoTypeInformation

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#

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

What is IOPS and how to calculate IOPS for an application (Exchange, SQL, Sharepoint,etc.)

What is it and how to calculate IOPS

This question is frequent, mostly because how Dell solutions Consultant that is a hardware manufacturer we know.

What are IOPS?

Is the number of operations per second that an individual disk can arrive. For example, a 10 k SAS disk achieves on average 140 IOPS.

This speed is standard in the industry with variations between models, but we can have a base of what is acceptable and the disk manufacturer can tell you this number.

However, note that the difference is very large, especially taking into account the new SSD drives. For example, the disk Intel x 25-E (See the pdf with the characteristics http://download.intel.com/design/flash/nand/extreme/extreme-sata-ssd-datasheet.pdf) arrives at numbers 30 times larger than the SAS and SATA disks.

 

model

Because the IOPS is so important?

This question is obvious, but the explanation may not be so simple. It turns out that in most cases we have the tendency to minimize the issue saying it is “performance” or “user perception” but in fact can impact directly on the running of an application, in some cases may even paralyze the application.

For example, an Exchange 2003 environment with 2 thousand mailboxes need 1.5 thousand IOPS and this number is not easy to achieve. The SQL Server database to a SharePoint needs 5 thousand IOPS to work.

How to calculate the IOPS?

Multiply the total number of disks for the RAID type and will get your number. Here some examples:

table

RAID 1, RAID 10 or RAID 0 will give you proportional the largest number of IOPS possible because RAID 5,  the calculation takes into account disk 1 and unless 2 disks RAID 50 unless parities.

How to achieve the highest IOPS possible with greater capacity?

We have three ways to do this:

  1. Use high-performance disks as the 15 k SAS or SSD, but are expensive and in the case of SSD only sizes 32/50/64/100 GB
  2. Use the proper RAID type for the performance and not to the size you want as many today make, which often involves using RAID 10 for total performance rather than RAID 50, we would lose into ability but we gain in performance
  3. Buy a storage that works with virtual LUNs, i.e. it allocates the data on the disks as the need for this given and does not need to say the RAID type

What are virtual LUNs?

Let’s not go into technical point since this is much more complex, but we can understand what is this new technology without becoming experts in storage.

Using the Dell arrays as an example, the MD3200i works with LUNs in the normal way we know. You indicate that the disks X the Y form a RAID 0, Z to W RAID 5 and so on. I.e. we map directly to the disks and are dependent on the ability of each individual IO.

Already in the series EqualLogic we can define the size of the LUN without indicate the disks and storage will automatically allocate more data accessed on disks faster (!!!!). You must be thinking it is joke or something like “concept”, but it is not!!

The new arrays sold by Dell, EMC, IBM and others are smart and allow you to mix the disks. For example, can I put in SSD disks storage drawer and one more additional drawer with 24 SAS 15 k disks and not worry if the LUN created is the disks more performance, who will do this job is storage.

And, the more interesting, when the storage “perceive” that certain data (LUN) is more accessible than another it will relocate to faster disks and make the shift of data without performance loss and intervention, since works in background and automatic!!!!

Interesting references

How to calculate IOPS for Exchange 2003 http://technet.microsoft.com/en-us/library/bb125019 (EXCHG. 65) .aspx

How to calculate IOPS for Exchange 2010 http://technet.microsoft.com/en-us/library/ee832791.aspx

How to calculate IOPS for the SharePoint 2010 and SQL http://technet.microsoft.com/en-us/library/cc298801.aspx

Utility to measure IOPS for SQL Server (SQLIO) http://www.microsoft.com/download/en/details.aspx?displaylang=br&id=20163

References of EqualLogic S6000 http://www.equallogic.com/products/default.aspx?id=9511

This Blog was copied from:
http://msincic.wordpress.com/2011/07/03/what-is-it-and-how-to-calculate-iops-exchange-sql-sharepoint-others/

Practical tips on simplifying GPOs and OU organization

Practical tips on simplifying GPOs and OU organization

Summary: Deep paths within Active Directory can complicate Organizational Units and Group Policy Objects organization. IT pro Rick Vanover shares his approach to managing the complexity of GPOs.

One of the most powerful centralized administration tasks for Windows Servers and PCs is deploying Group Policy Objects (GPOs). So much so, in fact, that I could argue Group Policy is one of the best solutions Microsoft has ever provided.

While I’m very fond of GPOs and their flexibility to configure user and computer settings centrally, we can easily get out of control with conflicting rules and overly complicated implementations. I’m sure we’ve all seen a domain that has a very ugly configuration of GPOs, and let’s not even get started on the security groups.

In my Active Directory practice, I go back and forth in determining how deep the GPOs and Organizational Units (OUs) should go. I frequently don’t do more than three GPOs flowing in series with the OUs.

By series I mean one GPO in a parent OU and another GPO in a child OU, like Figure A where the green GPO applies to the parent OU and the red GPO applies to the child OU (as well as the green GPO).

Figure A

Click the image to enlarge.

OUs are great for granular classification of various Active Directory objects, though I don’t really have an incredible issue going very deep (within reason) in terms of levels for this configuration. GPOs, on the other hand, are not good candidates for multiple applications for each OU as the tree goes deeper.

It is too complicated to keep the configuration rules in mind for planning and quick thinking. To help simplify how GPOs are organized, here are some tips:

  • Leverage GPO filtering by security group to make more GPOs at a higher OU instead of more GPOs in deeper OUs
  • Never add individual users or computer accounts (always use the group trick above)
  • Combine user and computer settings by role, rather than separate GPOs
  • Self-document the names of the GPOs to be intuitive to the role and location
  • Use a consistent GPO nomenclature, including renaming GPOs to get there
  • Scour around for GPOs that have one setting and consolidate it with other GPOs

GPOs are great, but the tools require organization and thought. These tips are general guidelines, and any of you keeping score will note that my screenshot from my personal lab is not exactly following all of these recommendations. It’s fine for a lab, but in production, that’s a different story.

Rick Vanover is an IT infrastructure manager for a financial services organization in Columbus, Ohio. He has years of IT experience and focuses on virtualization, Windows-based server administration and system hardware.

Also read:

 

Configure server, desktop, laptop power options with Group Policy

Disable Server Manager and Initial Configuration Tasks via Group Policy

VHDX

With Windows Server 2012 Microsoft released a new Virtual Disk Format called VHDX. VHDX improves the Virtual Disk in a lot of way.

Back in October I wrote a blog post on the improvements of the VHDX Format in the Windows Server 8 Developer Preview. Back then VHDX supported a size of 16TB, with the release of the Windows Server 8 Beta (Windows Server 2012 beta) the new Maximum size changed to 64TB.

Some of the VHDX improvements:

  • Support up to 64TB size
  • Supports larger block file size
  • improved performance
  • improved corruption resistance
  • the possibility to add meta data

You can download the VHDX Format Specification.

To use this new features you have to convert your existing VHDs into the new VHDX format. You can this do in two different ways, with the Hyper-V Manager or with Windows PowerShell.

Convert VHD to VHDX via Windows PowerShell

To convert a VHD to a VHDX with Windows PowerShell you can use simple this PowerShell command:

1
 Convert-VHD TestVHD.vhd -VHDFormat VHDX -DestinationPath C:\temp\VHDs\TestVHDX.vhdx -DeleteSource

Of course you can convert the VHDX back to a VHD using the following command:

1
 Convert-VHD TestVHDX.vhdx -VHDFormat VHD -DestinationPath C:\temp\VHDs\TestVHD.vhd -DeleteSource

Convert VHD to VHDX via PowerShell

Convert VHD to VHDX via Hyper-V Manager

  1. Start the Hyper-V Manager and click on “Edit Disk…
    Hyper-V Manager
  2. Now select the VHD you want to convert
    Edit Virtual Hard Disk
  3. Select “Convert
    Convert Virtual Hard Disk
  4. Select the target format in this case VHDX
    Convert VHD to VHDX
  5. Select the new location for your new VHDX
    Convert VHD to VHDX Location
  6. Check the summary and click finish
    Convert VHD to VHDX Finish

Same as with the PowerShell command, you can also convert a VHDX to a VHD. But you have to make sure that the VHDX is not bigger than 2TB.

Aviraj Ajgekar already did a post on this TechNet blog about how you can convert a VHD to VHDX via Hyper-V Manager.