Wednesday, 31 December 2014

SCOM Agent Uninstall error : The patch Package could not be opened

SCOM Agent Uninstall error : The patch Package could not be opened



  • SCOM agent uninstall was always a piece of Cake. Jut right click and select uninstall from console



  • But recently i was migrating from SCOM 2007 to SCOM 2012 and i have to uninstall SCOM 2007 R2 agents.Most went wellBut few failed with error


"The patch Package could not be opened. Verify that the patch package exists and that you can access it.Or contact the application support."


  • First reaction was shocked. Haven't seen this error.I have access and all the msi to uninstall.



  • Later i found out that issue is because of fact that the agent creates a reg entry of while installing with unique patch number.And if this conflicts or if there multiple of them then it will fail.


So to fix It follow the below steps,


  • Click Start
  • In Search type Regedit
  • Click on HKEY_CLASSES_ROOT\Installer\Products\07779052F1B26F94BAD9C107B8
  • Then double click on "Patches"
  • Delete all the Values in it and Close it.
  • Now go and try to uninstall it and it will work fine.

Sunday, 28 December 2014

SCOM 2012 R2 Fatal error 1603 while installing Management Server

SCOM 2012 R2 Fatal error 1603 while installing Management Server


  • I was today trying to install SCOM 2012 R2 on Windows 2008 r2.
  • Everything seems to be going well and Pre requisite passed with flying colors.
  • But while installing Management Server in the middle it failed with Fatal error 1603 and all got rolled back and installation was aborted.It asked me to refer the scom install log while which just gave the error 1603 Fatal error.
  • After investigating some time found that there is 1 pre requisite which Microsoft missed to do.Probably a bug.
  • Microsoft.NET 3.5.1 is mandatory. If this is not install it won't say any errors while you run the pre requsite. But.But in middle install will fail.
  • So before starting the installation of SCOM management Server Go to Add/remove programs and click "add roles" and select "Application Server"    and install.
  • This time the MS installation went through without any errors.

Sunday, 21 December 2014

Show-Eventlog:How to open Event viewer from Powershell

How to open Event viewer from Powershell


  • Manytime you might want to open Eventviewer while working in Powershell.
  • There is a way to directly open the event viewer from Powershell.
  • The Command is Show-Eventlog

  • This will directly open the event viewwer from the Powershell

Saturday, 20 December 2014

SCOM 2012 maintenacemode from Powershell or Command Shell

SCOM 2012 maintenacemode from Powershell or Command Shell


  • Now you can set the maintenace mode in SCOM using command shell or powershell
  • You the following command Start-SCOMMaintenanceMode

Sunday, 7 December 2014

Where is logoff button in windows 2012

Microsoft has done away with log off button.

Now in Windows 2012 its called Sign out.

So if you want to log off of Windows 2012 server then click sign out.

Wednesday, 26 November 2014

Active Directory RMS management pack

Active Directory RMS management pack


  • Microsoft has released an RMS management pack for Active Directory.This will also cover RMS servers on Windows 2012
  • You can find the download it from here
  • http://www.microsoft.com/en-us/download/details.aspx?id=26911
  • This Rights Management Service Management pack to properly work need local Administrator right on the servers you want to monitor.
  • To install the MP download the MP and install the MSI.It will give you 3MP .Import it

Tuesday, 11 November 2014

Get-GPO:How to Get list of Group POlicy in your EnviRornment using Powershell

Get-GPO:How to Get list of Group Policy in your Environment using Powershell



GET-GPO is a very powerfull Command.It gets list of all GPO in your Domain.

To get a list of all GPO, thep

GET-GPO

You will get the below error

PS C:\Users\foxsha> GET-GPO
The term 'GET-GPO' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spe
lling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:8
+ GET-GPO <<<<
    + CategoryInfo          : ObjectNotFound: (GET-GPO:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


The reason for this error is that there is no Module Available for Active Directory

So first Import the Module using Command

Import-Module "grouppolicy"

You will see the below error

PS C:\Users\foxsha> Import-Module "grouppolicy"

Import-Module : The specified module 'grouppolicy' was not loaded because no valid module file was found in any module
directory.
At line:1 char:14
+ Import-Module <<<<  "grouppolicy"
    + CategoryInfo          : ResourceUnavailable: (grouppolicy:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

The resaon for this error is that there is no Group policy Feature installed so first we need to install the group policy features

If you are on your desktop and not on Server,you need to go to below location and download and install it


Then go to Programs and Features in Control Panned .Click "Turn Windows Feature On or OFF " and select "Group policy management"

Now try " Import-Module "grouppolicy" and then GET-GPO and it will run sucesfully

Monday, 10 November 2014

Get-Process:How to capture the list of process running on the Computer using Powershell

How to capture the list of process running on the Computer using Powershell


  • To list all process running on the computer use the Command
           Get-Process

          This will give you list of all the process running on your system.
  • To count number of process running on the system,use
          (get-process).count





  • To output the Process to textfile so that you can send email to your support team with details,use
         get-process | out-File -FilePath c:\temp\testpr.txt


         This will give you output to text file.

  • If you want only to check if particular process is running, then use
          get-process | select-string "goog"


Sunday, 9 November 2014

Get-Content:How to use Get-content to Count the Number of Lines in the File

How to use Get-content to Count the Number of Lines in the File

Get-Content is a very powerful command and you will use it very often in your script.


  • Lets say You want to see all Counte of file,type


Get-Content C:\temp\t1.txt

Where C:Temp is the folder path where the file is and t1.txt is the filename


  • Now if you want to Count the number of Files in the file then, use


(get-content c:\temp\t1.txt).count

This will give the number of Lines in the File


  • Now say you want to Pjust first 5 lines in the File, then use


(get-content c:\temp\t1.txt -totalcount 5)

This will give you the first 5 lines


Also to see only Line where Particular word is matching use the below command

get-content C:\temp\t1.txt | select-string "get-c"

This will show lines only where "get-c" matches

Saturday, 8 November 2014

Get-Alias and useful Examples

Get-Alias and useful Examples


  • Get-Alias is very useful Powershell Command.It gives alternate name for the Commands.Instead of long form you can use the short Alias form. Lets see some example.
  • In order to find the Alias of "Get-Service" command which list all the services running in the computer and there running state, type the following Command in Powershell Windows

                      GET-Alias -definition Get-Service.




  • You can see that the Alias for Get-Service command is gsv.
  • So nextime to check this list of service and their status type just "gsv"

How to Check if Powershell is installed on your Computer?

How to Check if Powershell is installed on your Computer?


  • To check if Powershell is installed on your Computer
  • Go to C: Drive and  Click on "Windows" Folder
  • Now click on Sytem32 folder then Click on "WindowsPowerShell" Folder
  • Now depending on the Version of Powershell installed You will se it as v1.0 or v2.0 or v3.0. This tell you what version of Powershell is installed.
  • Now in our case is v1.0. Click on v1.0 folder.
  • You will see a "Powershell.exe". This confirms that Powershell is installed on your system.