≡ Menu

How to query service startup type using Powershell

In this post, I will show you how to query startup type (manual/automatic/disabled) of windows service on local or remote computer using Powershell and WMI.

Often people ask me why Get-Service is not returning Service startup type. That is Automatic/manual/disabled. I too don’t have a reason for that. But all I can say is, Get-Service is not tuned to give that information. The next question is how to query and what is the alternative.

The Win32_Service WMI class in Windows provides way to get this information. Most people neglect WMI and rely more on built-in cmdlets. While I don’t blame built-in cmdlets for anything, apart from limited functionality, I recommend using WMI or dotnet classes to get the information. They are fast, reliable, and the way is efficient.

Now let us move on to the original topic of how to query service startup type using Powershell and WMI. Since we decided to use WMI, use Get-WMIObject cmdlet to query the Win32_Service class.

Here is a small powershell script (Get-ServiceStartupType.ps1) which queries the startup type of given service.

[cmdletbinding()]            

param(            
 [string[]]$Service,            
 [switch]$Disabled,            
 [switch]$Automatic,            
 [switch]$Manual,            
 [string]$ComputerName = $env:ComputerName            
)            

foreach($Ser in $Service) {            
 try {            
  $Obj = Get-WmiObject -Class Win32_Service -Filter "Name='$Ser'" -ComputerName $ComputerName -ErrorAction Stop            
  $Obj | select Name, DisplayName, StartMode            
 } catch {            
  Write-Error " Failed to get the information. More details: $_"            
 }            
}

 

Examples:

  1. .\Get-ServiceStartupType.ps1 –Service Wsearch — queries the startup type of single service
  2. .\Get-ServiceStartupType.ps1 –Service Wsearch –ComputerName mypc1 — queries the startup type of single service on remote computer, mypc1.
  3. .\Get-ServiceStartupType.ps1 –ComputerName mypc1 – queries the startup type of all services on remote computer, mypc1.
  4. .\Get-ServiceStartupType.ps1 –Service Wsearch, wwansvc – queries the startup type of multiple services.

Output:

{ 6 comments }

Tip of the day: I will show to how to copy contacts from Global Address List(GAL) to Contacts in Outlook and Contacts in BlackBerry.

The procedure is very simple.

  • Open Outlook
  • Open GAL(either you can press Ctrl+B or select the GAL from outlook ribbon)
  • Now look for the contacts in GAL that you want to add to Contacts folder in Outlook
  • Select them(Outlook GAL allows multi selection, so select as many no. of contacts you want by holding control key) and right click on it
  • Select “Add to contacts”
  • You are done. Now the selected GAL contacts will be visible in local contacts. These will get synced to your blackberry so you can view them from blackberry as well.

The advantage with this is, if you have mail delivery set to PST and working from a place where you don’t have connectivity to Exchange server, then still you can see the contact details of the required people without establishing connection to Exchange.

Hope this little tip helps.

 

{ 1 comment }

Windows 2012 Licensing FAQs

This post contains the Frequently Asked Questions about Microsoft Windows 2012 licensing changes. This is a must read for System administrators and other IT staff who deals with licensing. source: Microsoft Download Center

As you might already aware, Microsoft has reduced their no. of versions with Windows 2012. It has only two versions a) Standard edition b) Data center edition. There is absolutely no difference between these two versions in terms of features. Only thing that varies is licensing terms.

Below are the licensing related FAQ’s from Microsoft (source: Microsoft Download Center)

Q1.   What is new in Windows Server 2012?

Windows Server 2012 brings our company’s experience building and operating public clouds to the server platform for private clouds. The new licensing and packaging makes it easier to manage workloads in highly virtualized public and private cloud environments. Windows Server 2012 will move to a consistent licensing model and will have common features enabling the reduction of editions. These include

  • Two editions, Standard and Datacenter.
  • Single licenses that cover up to two physical processors.
  • Editions differentiated by virtualization rights only (two for Standard; unlimited for Datacenter).

Q2. What is the difference between Windows Server 2012 Standard edition and Windows Server 2012 Datacenter edition?

Both Standard and Datacenter editions provide the same set of features; the only thing that differentiates the editions is the number of Virtual Machines (VMs). A Standard edition license will entitle you to run up to two VMs on up to two processors (subject to the VM use rights outlined in the  Product  Use Rights document). A Datacenter edition license will entitle you to run an unlimited number of VMson up to two processors.

Q3. Will Windows Server 2012 Standard edition have all of the same features as Windows Server 2012 Datacenter edition?

 Yes. All features that are available in the Datacenter edition are also available in the Standard edition, including high availability features like failover clustering. The only difference between the two editions will be virtualization rights.

Q4. Is Windows Server 2012 aligning to the System Center 2012 and Enrollment for Core Infrastructure (ECI) model?

 Yes. As part of the alignment with the Microsoft private cloud licensing model, Windows Server 2012 and System Center 2012, as well as Enrollment for Core Infrastructure (ECI), will have the same licensing and packaging structure. These include

  • Two editions, Standard and Datacenter.
  • Single licenses that cover up to two physical processors.
  • Editions differentiated by virtualization rights only (two for Standard; unlimited for Datacenter). Client Access Licenses (CALs) will continue to be required for access to Windows Server 2012 servers.

Q5. What are some of the features now available in Windows Server 2012 Standard that were previously only available in Windows Server 2008 R2 Enterprise and Datacenter editions?

There are a variety of new features in Windows Server 2012 Standard edition. Here are just a few examples of what was previously only available in the premium editions:

  • Windows Server Failover Clustering
  • BranchCache Hosted Cache Server
  • Active Directory Federated Services
  • Additional Active Directory Certificate Services capabilities
  • Distributed File Services (support for more than 1 DFS root)
  • DFS-R Cross-File Replication

Q6. How do I determine which Windows Server 2012 edition is right for me?

 Since there is feature parity between Windows Server 2012 Standard and Datacenter editions, your decision will be based solely on your virtualization strategy as virtualization rights become the only differentiator between editions. If your strategy calls for a highly virtualized environment, Datacenter edition will provide you with optimum flexibility since it allows for unlimited virtualization. If you do not plan on a highly virtualized environment at this time, Standard edition is the right product for your needs. If you purchase Standard edition today but find that you need more capacity in the future you will have two options to expand the virtualization capacity of your licensed server:Purchase additional Standard edition licenses and assign them to the same physical server giving you the rights to run additional instances of Windows Server, or

  1. Purchase additional Standard edition licenses and assign them to the same physical server giving you the rights to run additional instances of Windows Server, or
  2. If you have Software Assurance on your Standard license you can purchase a Software Assurance Step-Up and migrate to a Datacenter edition license on that server

If you are running a highly virtualized environment, management may also be a need for you. You should consider purchasing System Center 2012 with Windows Server 2012 together in the Core Infrastructure Suite, which is available inside or outside of an Enrollment for Core Infrastructure (ECI) agreement.

Q7. If I have a Windows Server 2012 Standard edition license, how can I increase my virtualization rights?

With the Windows Server 2012 Standard edition licensing model, you can grow your virtualization environment by either stepping up your license to Datacenter edition if you have Software Assurance, or by simply buying additional Standard edition licenses and assigning them to the same physical server. For example, if you have a 2-processor server and want to run a total of 4 VMs, you can purchase two Standard edition licenses and assign them to the same server. Additional examples are shown in the table below

# of Standard edition licenses

Total number of VMs

on a single server

 
   

1

2

   

2

4

   

3

6

   

4

8

Q8. Why is Windows Server 2012 licensing moving to a processor model?

By making this change, Windows Server 2012, System Center 2012 and the Core Infrastructure Server (CIS) will all have consistent licensing model creating alignment across Microsoft infrastructure products. Having a single-licensing model will make it easier for you to buy the right product for your needs and to compare the cost of alternatives (such as individual products, the CIS SKU outside of ECI, ECI and so on). Additionally, the new licensing model provides a single, familiar, and easy-to-track metric for all infrastructure products further reducing management overhead.

Q9.   How do I calculate the number of licenses I need for a server?

The number of licenses you will need depends on the number of physical processors on the server and the number of server instances that you will be running. (This only applies for Standard edition because Datacenter edition allows for unlimited VMs.) The larger of these two numbers determines the number of total licenses required.

Determining the number of physical processor licenses

Each license covers up to two physical processors, so to determine the number of licenses needed to fully license a physical server, simply count the number of physical processors in the server, divide that number by two and that tells you the number of licenses that will be needed.

Here are some examples:

  • You have a 2-processor server. 2 physical processors / 2 (number of processors covered by a license) equals 1. You will need one license to cover a 2-processor server.
  • You have a 4-processor server. 4 physical processors / 2 (number of processors covered by a license) equals 2. You will need two licenses to cover a 4-processor server.
  • You have an 8-processor server. 8 physical processors / 2 (number of processors covered by a license) equals 4. You will need four licenses to cover an 8-processor server.

Determining the number of virtual instances running

If you want to run additional VMs but do not require the highly virtualized environment that Datacenter provides (which is unlimited VMs), then you can simply purchase additional Standard edition

licenses and assign them to a single physical server to increase your VM entitlements on that server. Each Standard edition license provides you with the rights to run up to two VMs, so to determine the number of Windows Server Standard edition licenses you need, count the total number of total VMs that you will run on the server; divide that number by two, and round up to the nearest whole number.

For example, if you assign 2 Standard edition licenses to a single server, you will be able to run a total of 4 VMs on that server. If you add additional Standard edition licenses to that server the number of allowed VMs on that particular server will increase by two for a total of six VMs on that server.

Once the number of licenses needed to cover a physical processor and/or additional VMs is determined, the higher of those two numbers represents the total number of licenses required.

For example, if you are running 4 virtual machines on a 2-processor server, you will require 1 license to cover the 2 processors; but you will need an additional license to run 4 virtual machines, which means you will need a total of 2 licenses.

Q10. Can I use one Standard license to cover a 1-processor server?

 Yes. The Standard edition license will allow you to license up to two physical processors on a single server; however it does not require that the server has two physical processors.

Q11. Can I split my Windows Server 2012 license across multiple servers?

No. Each license can only be assigned to a single physical server.

Q12. Can I assign a Windows Server 2012 license to a virtual machine?

No. A license is assigned to the physical server. Each license will cover up to two physical processors.

Q13. Can I mix Datacenter and Standard licenses on the same server?

No. All of the processors on a given server must be licensed with the same version and edition. You can run different editions or older versions of Windows Server software as guests within VMs, but you are not allowed to assign multiple licenses of different versions or editions to the same physical server to license the processors on the server.

Q14. If I want to use the bits from an earlier version or edition, what are my options?

If you have Windows Server 2012 Datacenter edition you will have the right to downgrade your bits to any prior version or lower edition. If you have Windows Server 2012 Standard edition, you will have the right to downgrade your bits to any prior version of Standard edition or Enterprise edition.

The ability to run downgrade bits does not change the licensing or support terms in which you can use the product; the purchased product (Windows Server 2012) rights apply. This means that the license will continue to cover two physical processors and the virtualization rights do not change.

Here are a few examples.

       
Purchased Downgraded Bit rights that Licensing rights
License version or edition apply that apply
       
Datacenter 2012 Datacenter 2008 Datacenter 2008 Datacenter 20121
       
Standard 2012 Enterprise 2008 R2 Enterprise 2008 R2 Standard 20121,2
       
Standard 2012 Standard 2008 Standard 2008 Standard 20121,2
     

1 The license will cover up to two processors.

2 The license entitles up to two virtual machines.

Q15. Is Enterprise edition going away as part of Windows Server 2012 and why?

Yes. Enterprise edition will be retired as part of the Windows Server 2012 release. Windows Server 2012 Standard edition will include all the premium features previously included in Enterprise edition in the past and the price to purchase the rights to 4 instances of Windows Server 2012 will actually be less expensive than the price of Windows Server 2008 R2 Enterprise edition today. Due to these changes, we have been able to simplify the product lineup while reducing the price per instance of Windows Server for these customers.

Q16. Is Web Server going away as part of Windows Server 2012 and why?

Yes. The Web Server product was designed primarily for end customers and service providers that wanted to host web sites. However, consistent feedback from these customers and partners has been that they prefer to use an edition of Windows Server that does not restrict usage to running web workloads.

Despite the removal of Web Server edition, web workloads running on a Windows Server 2012 edition will continue to receive the “CAL waiver” that is in effect for these workloads today. Windows Server CALs will not be required to access the licensed server if it is only being used to run web workloads. See  Product Use Rights fordetails.

Q17. Are the HPC products going away as part of Windows Server 2012 and why?

While the HPC edition is being retired, Microsoft will be delivering the HPC Pack 2012 as a free download that can be used with any Windows Server 2012 Standard or Datacenter license. As a result, customers who want to run HPC workloads will be able to do so on any of their Windows Server 2012 licensed servers (Click  herefor a free download.).

HPC workloads running on Windows Server 2012 Standard or Datacenter editions will continue to receive the “CAL waiver” that is currently in effect for these workloads. Windows Server CALs will not be required to access instances of Windows Server in the Windows Server 2012 licensing model if these instances are simply running HPC workloads. See  Product Use Rightsfor details.

Q18. If I have Software Assurance in place at the time that Windows Server 2012 is generally available, when will my grant be reflected in my licensing records?

 While you will immediately be able to use the new product and will own the perpetual rights to the edition of Windows Server 2012 that you are transitioning to, your grant will not be reflected in the license position database until you renew your agreement and purchase Software Assurance on the granted licenses. If you do not renew your Software Assurance, your license position will not be reflected in the license position database; however the fact that you had Software Assurance in place at the time of Windows Server 2012 General Availability will establish your proof of license for the new product.

Q19. If I have Datacenter edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

If you have Software Assurance on Datacenter edition, you will be entitled to Windows Server 2012 Datacenter edition. Today, a Datacenter license covers up to 1 processor. A Windows Server 2012 Datacenter license will cover up to 2 processors. So for every two current Datacenter licenses with Software Assurance, you will receive one Windows Server 2012 Datacenter edition license.

Q20. If I have Enterprise edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

If you have Software Assurance on Enterprise edition, you will be entitled to receive two Standard edition licenses for each Enterprise edition license you have.

If you are considering moving to a more highly virtualized or private cloud environment, you should consider taking advantage of the Software Assurance Step-Up* benefit to upgrade to Datacenter edition prior to the Windows Server 2012 General Availability since the Step-Ups from Enterprise edition to Datacenter edition will be removed from the price lists at that time.

* If you have an Enterprise Agreement and already have an SA Step-Up from Enterprise edition to Datacenter edition on your Channel Price Sheet (CPS), you will be able to Step-Up from Enterprise edition to Datacenter edition until the end of your enrollment.

Q21. If I have Standard edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

 If you have Software Assurance on Standard edition today, you will be entitled to receive Standard edition at the general availability of Windows Server 2012. You will receive one Windows Server 2012 Standard edition license for each Standard edition license you have.

Q22. If the normal Software Assurance transition grant will not cover all of the processors in my server do I need to purchasing additional licenses?

 No. If you have Software Assurance on Enterprise, Standard or Windows Server 2008 R2 HPC editions when Windows Server 2012 is released and the normal Software Assurance transition grant does not cover all of the processors on your physical server, you can qualify for additional licenses by documenting your environment to show where you have Windows Server 2008 R2 Standard edition or Windows Server 2008 R2 HPC editions running on 4-processor servers and/or Windows Server 2008 R2 Enterprise edition running on an 8-processor server. You will then be entitled to the additional licenses needed to cover these processors.

It is recommended that you complete your self-assessment using the Microsoft Assessment and Planning (MAP) Toolkit or another inventory tool that can accurately archive a time/date-stamped inventory of your hardware with Windows Server installations.

Upon contract expiration, you can renew Software Assurance on all licenses granted as a result of transitioning to the Windows Server 2012 licensing model.

 Q23. If I have Web Server edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

If you have Software Assurance on Web Server edition, you will receive an additional Windows Server 2012 Standard edition license that you can use while also maintaining your rights to run your current Web Server license. For every two Windows 2008 R2 Web Server edition licenses, you will receive one Windows Server 2012 Standard edition license. If you have an odd number of Windows 2008 R2 Web Server edition licenses, your grant will be based on rounding up to the next whole even number.

You will continue to have the ability to host web content on your new Windows Server 2012 Standard edition license without needing a Windows Server CAL to access the server, but any other workloads that you decide to run on your new server will follow the standard Windows CAL licensing requirements.

Q24. If I have an HPC edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

If you have Software Assurance on Windows HPC Server 2008 R2 Suite, you will receive a license grant for Windows Server 2012 Standard edition. For each Windows HPC Server 2008 R2 Suite (which includes both a Windows Server 2008 R2 HPC edition license and Microsoft HPC Pack 2008 R2 Enterprise software) you will receive one Windows Server 2012 Standard edition license.

If you have Software Assurance on Windows Server 2008 R2 HPC edition or Microsoft HPC Pack 2008 R2 Enterprise, you will receive an additional Windows Server 2012 Standard edition that you can use while also maintaining your rights to run your current HPC licenses. You will receive one Windows Server 2012 Standard edition license for every two Windows Server 2008 R2 HPC edition license or Microsoft HPC Pack 2008 R2 Enterprise licenses you have. If you have an odd number of Windows Server 2008 R2 HPC edition or Microsoft HPC Pack 2008 R2 Enterprise licenses, your grant will be based on rounding up to the next whole number.

You will continue to have the ability to run HPC workloads on your new Windows Server 2012 Standard edition license without needing a Windows Server CAL to access the server, but any other workloads that you decide to run on your new server will follow the standard Windows CAL licensing requirements.

 Q25. What are my Software Assurance migration rights by Microsoft purchase program?

Each Microsoft purchase program has different rules for your Software Assurance migration entitlement at the end of your enrollment. See the chart below.

Program Software Assurance at time of release
   
Enterprise Agreement You will receive perpetual rights to the current
  (Windows Server 2012) edition.
   
Enterprise Agreement You will be able to use the Windows Server 2012 edition of your license
Subscription during your enrollment. At the end of your enrollment you will be able to
  choose to buy out the original Windows Server 2008 R2 product that was on
  your agreement at the original CPS price, buy out the new Windows Server
  2012 product at the buy-out price on the published price list at the time
  your enrollment expires, or renew your enrollment at the new Windows
  Server 2012 annual subscription price.
   
Enrollment for Education You will be able to use the Windows Server 2012 edition of your license
Solutions – School Enrollment during your enrollment. At the end of your enrollment you will be able to
  choose to buy out the original Windows Server 2008 R2 product or buy out
  the new Windows Server 2012 product at the buy-out price on the published
  price list at the time your enrollment expires, or renew your enrollment at
  the new Windows Server 2012 annual subscription price.
   
Open Value You will receive perpetual rights to the current
  (Windows Server 2012) edition.
   
Open Value Subscription You will be able to use the Windows Server 2012 edition of your license
  during your enrollment. At the end of your enrollment you will be able to
  choose to buy out the original Windows Server 2008 R2 product that was on
  your agreement at the original CPS price, buy out the new Windows Server
  2012 product at the buy-out price on the published price list at the time
  your enrollment expires, or renew your enrollment at the new Windows
  Server 2012 annual subscription price.
   
Open Value Subscription – You will be able to use the Windows Server 2012 edition of your license
Education Solutions during your enrollment. At the end of your enrollment you will be able to
  choose to buy out the original Windows Server 2008 R2 product or buy out
  the new Windows Server 2012 product at the buy-out price on the published
  price list at the time your enrollment expires, or renew your enrollment at
  the new Windows Server 2012 annual subscription price.
   
Select/Open You will receive perpetual rights to the current
  (Windows Server 2012) edition.

 

Note: The Enrollment for Core Infrastructure (ECI) follows the same rules as stated for the Enterprise Agreement in the chart above.

Q26. How much will Windows Server 2012 Standard and Datacenter editions cost?

For your specific pricing, contact your Microsoft reseller. Actual prices may vary. Microsoft does not determine pricing or payment terms for licenses acquired through resellers.

Edition

Volume Licensing Open No Level

 

Estimated Retail Price

   
Datacenter

$4,809

   
Standard

$88

Q27. Can I use my Windows Server 2008 CAL to access Windows Server 2012?

No. The CAL accessing the instance of Windows Server must be equivalent or higher in version than the server being accessed. You will need a Windows Server 2012 CAL to access a Windows Server 2012 instance.

 Q28. Do I still need a separate CAL to access Remote Desktop Services (RDS) and Active Directory Rights Management Service (ADRMS)?

Yes. The licensing requirements for Remote Desktop Services (RDS) and Active Directory Rights Management Service (ADRMS) have not changed with Windows Server 2012. Customers are still required to purchase an ADRMS or RDS CAL in addition to a Windows Server CAL to access ADRMS or RDS functionality. The CAL accessing the instance of Windows Server must be equivalent or higher in version than the server being accessed.

 Q29. What support is available for an older version of Windows Server?

See the  Windows Server Support Lifecyclewebsite for details.

Q30. What is Windows Server 2012 Essentials?

Windows Server 2012 Essentials is the latest version of Windows Small Business Server Essentials. It is a cloud enabled first server with an intuitive user interface. It can run on physical servers with up to two processors and has been designed for small businesses with up to 25 users.

Q31. What are some of the features that are now available in Windows Server 2012 Essentials?

Windows Server 2012 Essentials incorporates best-of-breed 64-bit product technologies to deliver a server environment well-suited for the vast majority of small businesses. The product technologies include:

  • Windows Server 2012 operating system
  • Data protection
  • “Anywhere” access
  • Health monitoring
  • Workload flexibility
  • Extensibility
  • Add-ons for many small business solutions, including a connector to Office 365

Customers can use Windows Server 2012 Essentials as a platform to run critical line-of-business applications and other on-premise workloads. It can also provide an integrated management experience when running cloud-based applications and services, such as email, collaboration, online backup, and more.

Q32. What are the different editions available with Windows Server 2012 Essentials?

There is only one edition—Windows Server 2012 Essentials. It is a flexible offering that provides a platform for running on-premises or cloud-based workloads.

 Q33. Will there be a next version of Windows Small Business Server 2011 Standard?

No. Windows Small Business Server 2011 Standard, which includes Exchange Server and Windows server component products, will be the final such Windows Server offering. This change is in response to small business market trends and behavior. The small business computing trends are moving in the direction of cloud computing for applications and services such as email, online back-up and line-of-business tools.

Q34. Will there be a next version of Windows Small Business 2011 Premium Add-on?

 No. Windows Small Business Server 2011 Premium Add-on, which includes SQL Server and Windows Server as component products, will be the final such Windows Server offering.

 Q35. If I have Windows Small Business Server 2011 Essentials with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

 If you have Software Assurance on Small Business Server 2011 Essentials, you will receive one Windows Server 2012 Essentials license.

This grant will be reflected upon your agreement renewal; however you are entitled to use the granted product upon availability.

 Q36. If I have Windows Small Business Server 2011 Standard edition with Software Assurance when Windows Server 2012 is released, which edition will I be entitled to receive?

If you have Software Assurance on Small Business Server 2011 Standard edition, you will receive one Windows Server 2012 Standard edition license and one Exchange Server Standard 2010 license.

This grant will be reflected upon your agreement renewal; however you are entitled to use the granted product upon availability.

 Q37. If I have Windows Small Business Server 2011 Premium Add-on with Software Assurance when Windows Server 2012 is released,which edition will I be entitled to receive?

If you have Software Assurance on Small Business Server 2011 Premium Add-on edition, you will receive one Windows Server 2012 Standard edition license and one SQL Server 2012 Standard edition license.

This grant will be reflected upon your agreement renewal; however you are entitled to use the granted product upon its availability.

 Q38. How much will Windows Server Essentials cost?

For your specific pricing, contact your Microsoft reseller. Actual prices may vary. Microsoft does not determine pricing or payment terms for licenses acquired through resellers.

Edition

Volume Licensing Open No Level

 

Estimated Retail Price

   
Essentials

$425

   
Foundation

OEM only

Q39. Are there any licensing changes happening to the Foundation edition as part of Windows Server 2012?

There are no changes to the Foundation edition licensing or pricing model. To see the full list of features and licensing, go to the  Foundation Server 2012 website.

{ 0 comments }

In this post I will show you how to hide/unhide a distribution group from Global Address List(GAL) using powershell.

Powershell module for Exchange 2010 module has two cmdlets that helps in querying and setting the hide from address list option on distribution groups. They are “Get-DistributionGroup” and “Set-DistributionGroup“. The visibility status of a distribution group decided based on a Property called “HiddenFromAddressListsEnabled”. We can query this property by using Get-DistributionGroup cmdlet. See below for example.

Get-DistributionGroup -Id "mygroup1" | select HiddenFromAddressListsEnabled

The distribution group is configured to be hidden from GAL if the value of HiddenFromAddressListsEnabled is $true. Otherwise it will be visible in GAL.

We can hide a distribution group by setting the value of this parameter to $true. See below for example

Set-DistributionGroup -Id "mygroup1" -HiddenFromAddressListsEnabled:$true

Hope this helps

{ 3 comments }

Powershell: Get FQDN of local or remote computer

Have you ever wondered how to get FQDN of local or remote computer(Workstations/Server) using powershell? There are some methods available over internet but they are not really upto the mark. All they do is, pick computer name and domain name from two places and concatenate them to form a FQDN. But as a System administrator I can say that is wrong approach and possibility is there where computers can have different domain name and FQDN names. For example, I can configure my computer which is part of techibee.com domain to have a FQDN as mytestpc1.intranet.techibee.com. If such cases, joining the computer name and domain name simply won’t help.

After my research, I felt below procedure is very standard approach compared to any other options.

To get FQDN of local computer:

[System.Net.Dns]::GetHostByName(($env:computerName))

To get FQDN of Remote computer:

[System.Net.Dns]::GetHostByName("mytestpc1")

The System.Net.DNS class has a few other useful methods using which you can get FDQN and IP address details. Refer to http://msdn.microsoft.com/en-us/library/system.net.dns.aspx for more details.

PS C:\> [System.Net.Dns] | Get-Member -Static

TypeName: System.Net.Dns

Name                  MemberType Definition
—-                  ———- ———-
BeginGetHostAddresses Method     static System.IAsyncResult BeginGetHostAddr…
BeginGetHostByName    Method     static System.IAsyncResult BeginGetHostByNa…
BeginGetHostEntry     Method     static System.IAsyncResult BeginGetHostEntr…
BeginResolve          Method     static System.IAsyncResult BeginResolve(str…
EndGetHostAddresses   Method     static ipaddress[] EndGetHostAddresses(Syst…
EndGetHostByName      Method     static System.Net.IPHostEntry EndGetHostByN…
EndGetHostEntry       Method     static System.Net.IPHostEntry EndGetHostEnt…
EndResolve            Method     static System.Net.IPHostEntry EndResolve(Sy…
Equals                Method     static bool Equals(System.Object objA, Syst…
GetHostAddresses      Method     static ipaddress[] GetHostAddresses(string …
GetHostByAddress      Method     static System.Net.IPHostEntry GetHostByAddr…
GetHostByName         Method     static System.Net.IPHostEntry GetHostByName…
GetHostEntry          Method     static System.Net.IPHostEntry GetHostEntry(…
GetHostName           Method     static string GetHostName()
ReferenceEquals       Method     static bool ReferenceEquals(System.Object o…
Resolve               Method     static System.Net.IPHostEntry Resolve(strin…

PS C:\>

Hope this helps and happy learning..

{ 3 comments }

5 Benefits of Server Monitoring

Server monitoring can be somewhat misunderstood by non-technical employees. They may believe that their activities are being watched, or that the company is adopting a “Big Brother” attitude. However, nothing could be further from the truth.

Server monitoring is there to ensure a healthy network and to keep the servers and workstations in top shape. The solution is there to help busy system administrators cope with their workloads, not to snoop on employees.

Let’s look at five benefits server monitoring brings to an organization.

1)      Get complete visibility into your network health and performance

Server monitoring lets the IT administrator, “look under the hood” and closely examine the issues which could impact network performance. It can look at a variety of variables and show you, in real-time, how your server and workstations are functioning. In this way you can quickly identify any areas that are in need of attention and take appropriate action. Thus, server monitoring allows you to take a proactive approach to problem resolution and to fix any issues before they impact your network’s performance.

2)      Automate a huge variety of checks on your network

Hard disk space and performance, scheduled backups, antivirus software updates, critical events and Windows services disruptions – all of these can be automatically checked using a server monitoring solution. This frees up a large amount of time for busy system administrators who no longer have to spend time trying to locate potential issues. Instead they can focus on the servers which need their attention, quickly homing in on the source of an issue. In addition, the checks that a server monitoring solution runs are also customizable.

3)      Know what is happening on your network

You can set alert levels and be notified by email and text messages when the server monitoring solution finds something amiss. This allows you to rapidly respond, even if you are out of the office. By being alerted to potential issues, you can take action before they impact your network performance, or result in downtime for your servers or workstations. This keeps your organization’s productivity at an optimum level.

4)      Scalability

You can quickly view a full list of computers covered by your server monitoring solution and add in new workstations should you need to. This means your solution can scale as the company grows. Cloud-based server monitoring solutions are very flexible and allow you to add services and machines with ease and without complex processes. Cloud-based solutions also have the advantage that they do not require constant patching or updating by the IT administrator, saving both time and costs. The cloud services vendor takes care of this for you.

5)      Frees up your IT resources

By taking over many of your server monitoring tasks, this solution allows you to reallocate your IT resources and time to other higher value tasks such as development, or infrastructure renewal. Not only does the software watch over the system, but it can even perform some remedial actions, such as a server reboot or automatically restarting a service.

 

Server monitoring solutions offer a wide range of benefits to system administrators. In fact, it is almost like having another employee in your IT department, except this one never sleeps. Once you start running a server monitoring solution on your network, you’ll wonder how you managed without it.

This guest post was provided by Mark Williams on behalf of GFI Software Ltd. GFI is a leading software developer that provides a single source for network administrators to address their network security, content security and messaging needs. Learn more on what to look out for in a server monitoring solution.

All product and company names herein may be trademarks of their respective owners.

 

{ 1 comment }

[ Now-a-days many people are capable of writing and using Powershell codes. Given this fact, the uptime2.exe is removed. There is a better PowerShell alternative for this at https://techibee.com/powershell/get-computer-uptime-using-powershell/659]

Ever since I started using Windows 7/Windows 2008 R2 Operating System this problem is there. Uptime.exe utility crashes with error message “Calculates system uptime and availability has stopped working” when I use with “/S” option. The /S option of uptime.exe gives the historical information about computer startup and shutdown times. This information is very useful to understand how many times a computer rebooted.

Since this built-in tool is not working, I explored the ways to get the last X reboots information from a PC using alternate methods. In early stages, I assumed this historical reboot information is stored in some WMI or file system so that I can easily query. After long wait, I came to know that it is actually based on event logs. All we need to do is parse event logs and get the historical startup and shutdown times of the computer.

After knowing the source of information, my interest towards building my own solution to get the last X reboot times information has increased. I did it in powershell and used it whenever I needed. However, I felt having a powershell function may be easy way for folks like me who want to get their hand dirty with powershell. Other system administrators really won’t like it as they need to open powershell, look for command and type it there to get the required output. For various reasons, powershell console a slow staring application. Also it is difficult to remember the function name(or equivalent code) to get the reboots information. Given these reasons, I wanted to build a quick alternative, and that is when Uptime2.exe born.

So I developed a C# console application which mimics the functionality of uptime.exe tool in windows and returns the output we need. “C# application? Hey Poweshell guy, what happened to you?” – Nothing really but somehow I liked the language and started exploring more. Still PS is my best choice for quick and dirty tasks. In fact PS made me my dive into c# very easy and quick. Keeping my happening aside let me talk more about the tool I developed.

The uptime2.exe is a C# console application. It takes two parameters mainly, /Computername and /S. The ComputerName parameter is for querying the information from remote computer and “/S” option works the same way as in uptime.exe – i.e generates historical reboot information. When none of these parameters are specified, the tool just returns the uptime of local computer.

I have too many plans for enhancing this tool. But don’t have enough time in hand at this moment. This is the best shape I can give my thoughts in 5 hours(yes, it took me that much). However, when I ever I find time, I will try to improve it to return more information like Timezone of remote computer(I think no tool does this right now), display last boot time, etc (if you think a feature is worth adding here, please mention in comments section).

I briefly tested this tool in my lab and is giving the desired results. I took care of error handling to the possible extent I can. If you notice any errors, please report to me.

Download:

You can download the tool from here (not available for download anymore) and use it for your requirements. It is FREE. I will share the code as well once my GIT repository is ready for usage.

[Updates]

08/16/2012 : Initial release

08/18/2012: Fixed a bug with time conversion.(Thanks to Srinivas for reporting it)

Below are the a few use cases:

  • c:\>Uptime2.exe — gets the uptime of local computer
  • c:\>Uptime2.exe /s —  gives the historical reboot information of local computer.
  • c:\>Uptime2.exe /computername:mypc1 — give the uptime information of remote computer
  • c:\>Uptime.exe  /computername:mypc1 /s  — gives the historical reboot information of remote computer.

 Disclaimer:

Well, I felt I should add a disclaimer for this utility. Please test the tool in test environment before trying in production. I AM NO WAY RESPONSIBLE FOR ANY KIND OF DAMAGE MADE BY THIS TOOL. USE AT YOUR OWN RISK.

Happy learning and let me know your feedback.

 

 

{ 49 comments }

Active Directory Replication Status Tool (ADREPLSTATUS)

Microsoft has released new version of Active Directory Replication Status Tool (ADREPLSTATUS) which analyzes the status of replication of all Domain Controllers in the Active Directory domain or forest.

It is the advanced version of repadmin . It displays output in a format which is similar to REPADMIN /SHOWREPL /*CSV imported into Excel with significant enhancements.

Specific capabilities for this tool include:

  • Expose Active Directory replication errors occurring in a domain or forest.
  • Prioritize errors that need to be resolved in order to avoid the creation of lingering objects in Active Directory forests.
  • Help administrators and support professionals resolve replication errors by linking to Active Directory replication troubleshooting content on Microsoft TechNet.
  • Allow replication data to be exported to source or destination domain administrators or support professionals for offline analysis.

 

System requirements

Supported operating systems: Undefined, Windows 7 Professional, Windows 8 Release Preview, Windows Server 2003 R2 Enterprise Edition (32-Bit x86), Windows Server 2003, Enterprise Edition for Itanium-based Systems, Windows Server 2008 R2, Windows Server 2008 Standard, Windows Vista Service Pack 1, Windows Vista Service Pack 2, Windows Vista Ultimate, Windows XP Professional Edition

 

Windows Vista

Windows 7

Windows Server 2003

Windows Server 2003 R2

Windows Server 2008

Windows Server 2008 R2

Windows 8 Release Preview

 

  • ADREPLSTATUS does not install on server core installs of Windows.
  • Windows 2000 not supported due to lack of support for .NET Framework 4.0 Domain membership requirements

 

Must be joined to the Active Directory domain or forest you intend to monitor

 

.NET Framework requirements:

.NET Framework 4.0

.NET Framework 3.5.1

 

The ADREPLSTATUS install routine will prompt for the installation of versions as required. It may be necessary to manually install if there is no internet access.

Required User Credentials:

Target forest/domain user account; you must start the application using elevated credentials, by using “Run as administrator”.

Supported DC OS versions that can be monitored by ADREPLSTATUS:

Windows Server 2003

Windows Server 2003 R2

Windows Server 2008

Windows Server 2008 R2

Windows Server 2012 Release Preview

 

Windows 2000 not tested and is therefore not supported.

 

Other Requirements:

ADREPLSTATUS will not work when the following security setting is enabled on the operating system:

System cryptography: Use FIPS 140 compliant cryptographic algorithms, including encryption, hashing and signing algorithms

 

The tool can be downloaded from MS Site

 

{ 0 comments }

Do you know what is VSS? and how it works? Do you know how exchange backup will happen and what technology it uses? Do you know why and how exchange backups generally take less time(you can freezing and unfreezing events in eventlogs) when the databases are too big sizing in GBs?

To get all you questions answered, you must read below two nice articles from “The Exchange team blog”. They explained how VSS backup works? what is a snapshot how you will be able to revert to a given snapshots, etc.

Don’t miss them and do read them 🙂

Part 1: http://blogs.technet.com/b/exchange/archive/2012/06/04/everything-you-need-to-know-about-exchange-backups-part-1.aspx

Part 2: http://blogs.technet.com/b/exchange/archive/2012/06/14/everything-you-need-to-know-about-exchange-backups-part-2.aspx

Hope this helps and happy learning…

{ 0 comments }

MS has released a updated management pack for Exchange 2010 to coincide with the release of Exchange 2010 Service Pack2.

You can download the document and management packs from http://www.microsoft.com/en-us/download/details.aspx?id=692

Overview

The Microsoft Exchange Server 2010 monitoring management pack is designed to be used for monitoring Exchange 2010 events, collecting Exchange component-specific performance counters in one central location, and for raising alerts for operator intervention as necessary. By detecting, sending alerts, and automatically correlating critical events, this management pack helps indicate, correct, and prevent possible service outages or configuration problems, allowing you to proactively manage Exchange servers and identify issues before they become critical. The management pack monitors and provides alerts for automatic notification of events indicating service outages, performance degradation, and health monitoring.

Feature Summary The Exchange Server 2010 Monitoring Management Pack includes rules and scripts to monitor and report on performance, availability, and reliability of all Exchange 2010 server roles including.

  • Mailbox Server Role
  • Client Access Server Role
  • Hub Transport Server Role
  • Edge Transport Server Role
  • Unified Messaging Server Role

Release History

  • 6/15/2012 – Updated release, version 14.3.38.2
  • 4/6/2011 – Updated release, version 14.02.0071.0
  • 11/9/2009 – Original release of the English version and language packs, version 14.0.650.7.
{ 0 comments }