Showing posts with label to. Show all posts
Showing posts with label to. Show all posts

Thursday, 22 June 2017

How to stop SCCM from installing Files on System or C drive

* SCCM by default install site server role component on first available NTFS drive.

* In order to avoid the files being installed, we need to create a magic file on the drive so that SCCM understand and ignore me.

*The Magical file name is "no_sms_on_drive.sms"

* You need to create this empty file and place on the drive which you want SCCM to ignore.

Wednesday, 26 April 2017

Install Bash Shell on Windows to Execute Linux Commands from Windows

Install Bash Shell on Windows to Execute Linux Commands from Windows


  • To install Bash,your PC should be running a 64-bit version of Windows 10 Anniversary Update build 14393 or later
  • Now Open Settings -> Update and Security -> For developers
  • Select the Developer Mode radio button

  • Then from Start, search for "Turn Windows features on or off" (type 'turn')
  • Select Windows Subsystem for Linux (beta)

  • Click OK
  • Now Open a PowerShell prompt as administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux


  • Restart your computer when prompted

Wednesday, 1 March 2017

SCCM Query find All Server count with OS Name

SCCM Query find All Server count with OS Name



  • Recently I was asked to count of servers by OS
  • It was quite Challenging as we need to understand the SCCM Structure very well to do the SQL Queries.
  • Following are the Queries to fin the Server by OS Name and the count of Servers
SELECT VR.operatingSystem0,COUNT(VR.operatingSystem0) FROM v_R_System AS VR
WHERE VR.operatingSystem0 LIKE '%Windows Server%'
GROUP BY VR.operatingSystem0

Saturday, 19 November 2016

How to Delete a SCCM 2012 r2 Site System role

How to Delete a SCCM 2012 r2 Site System role


You can delete a site system using the Configuration Manager console by performing the procedure described:

  • To delete a site system, all previously administrator-defined site system roles must be deleted. The ConfigMgr site system role is automatically added to any new site system created by the site component manager. Depending on the site role added, the Site component server role might also be assigned to the site system. These two roles cannot be added to a site system by the administrator and cannot be manually removed using the Configuration Manager console.

  • A site system can be deleted when it is still assigned the ConfigMgr site system server role, but it cannot be deleted if it is still assigned the Site component server server role.

  • In the Configuration Manager console of the primary site server, navigate to System CenterConfiguration Manager / Site Database / Site Management / <site code> - <site name> / Site Settings / Site Systems / <site system name>.

  • Verify that no site roles are currently assigned to the site system other than the ConfigMgr site system role.

  • Right-click <site system name> for the site system that you want to delete, and click Delete.

  • Click Yes on the Confirm Delete dialog box.

Wednesday, 19 October 2016

SCOM 2012 R2 Console crashes after October Windows Update -Hotfix KB3200006

SCOM 2012 R2 Console crashes after October Windows Update


  • The SCOM 2012 R2 Console crashes after installing the Latest October patches.
  • This is know issue and microsft has released a Hotfix KB3200006.
  • https://support.microsoft.com/en-us/kb/3200006.
  • Please downaload the hotfix and install to resolve the Console Crash issue.
  • It affects all OS versions. So you need to install on App OS where there is SCOM 2012 R2 Console irrespective of the UR 

Thursday, 15 September 2016

Set-DnsClientServerAddress: Powershell command to set the DNS Server

Set-DnsClientServerAddress: Powershell command to set the DNS Server


  • You need to configure the DNS Server Ip adress of the Server.
  • This will help name resolution to happen correctly.
  • To configure DNS Server Name for your network Card use "Set-DnsClientServerAddress"

Set-DnsClientServerAddress -InterfaceAlias "AdminNet" -ServerAddresses 192.168.10.2

PowerShell command to set Ipv6 IP Address


PowerShell command to step Ipv6 IP Address

  • Powershell is the most effective way to set the Ip Adress to all servers.
  • You use the New-NetIPAddress with -AddressFamily IPv6
  • This will set the Ipaddress to V6.
  • You should also mention the interface address

New-NetIPAddress -AddressFamily IPv6 -InterfaceAlias "AdminNet" `
-IPAddress 2001:db8:0:10::2 -PrefixLength 64 -DefaultGateway 2001:db8:0:10::1

New-NetIPAddress: PowerShell command to configure Static Ip Address

PowerShell command to configure Static Ip Address

  • Many times we have to configure Ipadress
  • Its usually done for servers where static ip address are given.
  • To set Static Ip adress you need to know the Network Interface for which you want to set the IP
  • To configure you use the command "New-NetIPAddress"
New-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "AdminNet" `
-IPAddress 192.168.10.2 -PrefixLength 24 -DefaultGateway 192.168.10.1

  • -AddressFamily tells whether its IPV4 or IPV6
  • -InterfaceAlias tells the Name of the network.
  • -IPAddress specify the ip adress you want to configure.
  • -PrefixLength speciy the Subnet length.
  • -DefaultGateway specify the Gateway IP.

PowerShell Commmand to Disable DHCP on the Network Interface

PowerShell Commmand to Disable DHCP on the Network Interface

  • In Server we generally dont use DHCP to assign IP address.
  • We usuall set Static IP Address to Server.
  • So we need to disable the DHCP.
  • To disable DHCP from Powershell use the Command "Set-NetIPInterface" with option -DHCP Disabled

Set-NetIPInterface -InterfaceAlias "Admin" -DHCP Disabled -PassThru

  • You should specifyf or which interface you want to disable the DHCP, So you have to give the InterfaceAlias as well.

Get-NetAdapter: PowerShell Command to find Network Adapater Alias name and Index Number

PowerShell Command to find Network Adapater Alias name and Index Number


  • If you have to do changes to your Network Adapter then you need to know the Alias Name and Index Number
  • You can find those easily in PowerShell
  • The Command is "Get-NetAdapter"
  • You can see the "Name" which is Alias and ifIndex which is the "Index Number"

Wednesday, 14 September 2016

Install-ADDSDomainController: PowerShell Command to Promote a Server to Domain Controller

PowerShell Command to Promote a Server to Domain Controller




Install-ADDSDomainController -SkipPreChecks -NoGlobalCatalog:$false -CreateDnsDelegation:$false `
-CriticalReplicationOnly:$false -DatabasePath "C:\Windows\NTDS" -DomainName "Contoso.com" `
-InstallDns:$true -LogPath "C:\Windows\NTDS" NoRebootOnCompletion:$false -SiteName `
"Default-First-Site-Name" `-SysvolPath "C:\Windows\SYSVOL" -Force:$true


  • Install-ADDSDomainController will promote the Server to Domain Controller.
  • -SkipPreChecks will skip the prechecks and will procced with the install
  •  -NoGlobalCatalog:$false Will not install Global Catalog Component on this server.
  • -CreateDnsDelegation:$false Will not create DNS Delegation on this server
  • -DatabasePath tell where should be the NTDS Folder Location
  • -DomainName tell your Domain Name
  • -InstallDns:$true Installs DNS Component on the server
  • -LogPath tells the LogPath Location.
  •  NoRebootOnCompletion:$false Will not reboot the server after install.If you want to reboot make it $true
  • -SiteName Enter the AD Site name where server has to be installed
  • -SysvolPath Location of the Sysvol folder

Saturday, 10 September 2016

Content not Downloading to Distribution Point in SCCM 2012 R2

Content not Downloading to Distribution Point in SCCM 2012 R2


  • SCCM is a very complex system.
  • It hard to troubleshoot even with such exhaustive logging
  • Reason is that the Mutiple issues on system can cause a side effect 
  • So one of the frequent issue i face in my envionment is that the Content is not avaialble in Distribution Point.
  • To resolve this the only effective solution i found is to reboot the server.
  • So dont waste time investigating logs, as it will give 1000 varities of error
  • As first step reboot the Distribution point server. 
  • If you still have issues then you can troubleshoot with logs

Wednesday, 7 September 2016

How to restore a Corrupt SCOM Database in SCOM 2012 R2 Step by Step

How to restore a Corrupt SCOM Database in SCOM 2012 R2

  • Sometimes the SCOM database gets corrupted because of disk issue.
  • Restoring it from Backup is a very lengthy process and time consuming.
  • Opening a ticket with Microsoft might help, but there default reply is to restore from last good backup
  • So how you quickly recovery a corrupt SCOM database?. There is a way.
  • First Stop all SCOM Services on your management server.
  • Then Put the Corrupt SCOM database in SINGLE_USER Mode.
If you Operations Manager DB is corrupted Run the below command,

DBCC CHECKDB ('OperationManager', REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS, NO_INFOMSGS
    If you Operations Manager Datawhare house is corrupted Run the below command,

    DBCC CHECKDB ('OperationsManagerDW', REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS, NO_INFOMSGS

    • Once completed you should be able to bring your database online

    Step by Step Procedure to Restore SCOM 2012 R2 Databases after crash or Disaster:

    Step by Step Procedure to Restore SCOM 2012 R2 Databases after crash or Disaster:


    Many times for various reason we have to restore the SCOM databases.Follow the below procedure

    • Start SQL Server Management Studio.
    • In the Connect to Server dialog box, select the appropriate values in the Server type drop-down combo box, in the Server name box, and in the Authentication box.
    • Click Connect.
    • In Object Explorer, expand Databases, and then select the OperationsManager, OperationsManagerAC, or OperationsManagerDW database.
    • Right-click the database, point to Tasks, and then click Restore.
    • Click Database to open the Restore Database dialog box.
    • On the General page, the name of the restoring database appears in the To database list.
    • In the To a point in time text box, either retain the default (the most recent possible) or select a specific date and time by clicking the browse button, which opens the Point in Time Restore dialog box.
    • To specify the source and location of the backup sets to restore, click the From Device option.
    • Click Browse to open the Specify Backup dialog box.
    • In the Backup media list box, select one of the listed device types. To select one or more devices for the Backup location list box, click Add.
    • In the Select the backup sets to restore grid, select the backups to restore. This grid displays the backups available for the specified location.
    • In the Restore options panel, select the Overwrite the existing database option.
    • In the Restore the database files as options panel, verify the original database file name and path are correct.
    • For the Recovery state options, specify the state option Leave the databases ready to use by rolling back the uncommitted transactions. 
    • Additional transaction logs cannot be restored.
    • Click OK to restore the database.
    • Make sure whenever you restore always restore OperationsManager, and OperationsManagerDW database. Orelse youw ill face 31552 issue.

    Monday, 5 September 2016

    What is Azure resource group and how to create it PowerShell

    What is Azure resource group and how to create it PowerShell

    What is Resource group:

    • Before deploying any resources to your subscription, you must create a resource group that will contain the resources.

    Create a resource group:

    • To create a resource group, use the New-AzureRmResourceGroup cmdlet.

    New-AzureRmResourceGroup -Name CognosApp -Location "West US"

    • Uses the Name parameter to specify a name for the resource group and the Location parameter to specify its location.

    Connect to Specific Azure Subscription using Powershell

    Connect to Specific Azure Subscription using Powershell


    • Organizations have mutiple Subscriptions, One for DEV,One for ACC and One for PROD.
    • So there are times where you want to connect to particular Subscription.
    • You have to use the command Set-AzureRmContext with SubscriptionID followed by the unique Subscription ID for the Subscription

    Set-AzureRmContext -SubscriptionID <YourSubscriptionId>

    How to Login to your Azure from PowerShell

    How to Login to your Azure from PowerShell

    • To login to your Azure account, use the Add-AzureRmAccount cmdlet.

    Add-AzureRmAccount

    • The cmdlet prompts you for the login credentials for your Azure account. 
    • After logging in, it downloads your account settings so they are available to Azure PowerShell.
    • The account settings expire, so you need to refresh them occasionally. 
    • To refresh the account settings, run Add-AzureRmAccount again.

    Thursday, 14 July 2016

    How to find which servers are allowed to do DNS Scavenging

    How to find which servers are allowed to do DNS Scavenging


    To see which servers are currently allowed to scavenge, run the command 

    DNSCmd /ZoneInfo

    • If there is a section “Scavenge Servers” at the bottom of the output, then those DNS servers whose IP addresses are listed are the only ones that can perform scavenging on the specified zone. 

    • If there is no “Scavenge Servers” section present, then any DNS server otherwise permitted can perform scavenging on the zone.

    Thursday, 30 June 2016

    Powershell Command to find version of OS


    Powershell Command to find version of OS



    • To find which version of Windows you are running, enter the following commands in the Command Prompt or Powershell:


    wmic os get caption

    wmic os get osarchitecture

    Saturday, 21 May 2016

    How to Enable Logging for Linux agent in SCOM 2012 r2

    How to Enable Logging for Linux agent in SCOM 2012 r2

      • Linux agent is one of the most challenging to monitor in SCOM. As is cross platform monitoring it does not give clear error when there is error.
      • So you should enable Loging on Agent to see whats happening.
      • Once loging is enabled you can see log created in /var/opt/microsoft/scx/log.log
      • To see the current state of loging type scxadmin -log-list
      • To set loging to Troubleshooting type scxadmin -log-set all verbrose

      • This will set the loging to TRACE and will start recording all events.
      • Once your troubleshooting is compeleted you have to reset the log back/
      • To do this use the command scxadmin -log-reset
      • This will reset the logs back to info level from Trace level