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 25 June 2016

PowerShell Basics for Dummies - ConvertTo-Html

PowerShell Basics for Dummies - ConvertTo-Html


ConvertTo-Html:

  • Converts Microsoft .NET Framework objects into HTML that can be displayed in a Web browser.
  • The ConvertTo-Html cmdlet converts .NET Framework objects into HTML that can be displayed in a Web browser. You can use this cmdlet to display the output of a command in a Web page.
  • You can use the parameters of ConvertTo-Html to select object properties, to specify a table or list format, to specify the HTML page title, to add text before and after the object, and to return only the table or list fragment, instead of a strict DTD page.
  • When you submit multiple objects to ConvertTo-Html, Windows PowerShell creates the table (or list) based on the properties of the first object that you submit. If the remaining objects do not have one of the specified properties, the property value of that object is an empty cell. If the remaining objects have additional properties, those property values are not included in the file.

Get-EventLog -LogName "Windows PowerShell" | ConvertTo-Html > PSEventlog.htm

  • The command sends the HTML code to the PSEventlog.htm file.

PowerShell Basics for Dummies - Get-Service

PowerShell Basics for Dummies - Get-Service


Get-Service:

  • Gets the services running on the specified computers. The default is the local computer.

 Get-Service -ComputerName "Server1"

  • This command gets the services on the "Server1" remote computer.

  • Because the ComputerName parameter of Get-Service does not use Windows PowerShell remoting, you can use this parameter even if the computer is not configured for remoting in Windows PowerShell.


Get-Service "wmi*"

  • This command retrieves services with service names that begin with WMI

Powershell Basics for Dummies - Get-ExecutionPolicy

Powershell Basics for Dummies - Get-ExecutionPolicy

Get-ExecutionPolicy

  • If you'll need to know what execution policy is in use before you attempt to run a script. You can find out by using the Get-ExecutionPolicy command.
  • This will show the current status of Execution policy.
Get-ExecutionPolicy

Four levels of security exist:

  • Restricted — Restricted is the default execution policy and locks PowerShell down so that commands can be entered only interactively. PowerShell scripts are not allowed to run.
  • All Signed — If the execution policy is set to All Signed then scripts will be allowed to run, but only if they are signed by a trusted publisher.
  • Remote Signed — If the execution policy is set to Remote Signed, any PowerShell scripts that have been locally created will be allowed to run. Scripts created remotely are allowed to run only if they are signed by a trusted publisher.
  • Unrestricted — As the name implies, Unrestricted removes all restrictions from the execution policy.

Powershell Basics for Dummies - Set-ExecutionPolicy

Powershell Basics for Dummies - Set-ExecutionPolicy

Set-ExecutionPolicy

  • By Default Microsoft has disabled scripting  in an effort to prevent malicious code from executing in a PowerShell environment. 
  • You should use Set-ExecutionPolicy command to control the level of security surrounding PowerShell scripts. 

Four levels of security exist:

  • 1. Restricted — Restricted is the default execution policy and locks PowerShell down, so that commands can be entered only interactively. PowerShell scripts are not allowed to run.
  • 2. All Signed — If the execution policy is set to All Signed then scripts will be allowed to run, but only if they are signed by a trusted publisher like Microsft etc.
  • 3.Remote Signed — If the execution policy is set to Remote Signed, any PowerShell scripts that have been locally created will be allowed to run. Scripts created remotely are allowed to run only if they are signed by a trusted publisher like Microsoft.
  • 4. Unrestricted — Unrestricted removes all restrictions from the execution policy.

You can set an execution policy by entering the Set-ExecutionPolicy command followed by the name of the policy. For example, if you wanted to allow scripts to run in an All Signed manner you could type:

Set-ExecutionPolicy All Signed

Powershell Get-Help Command Usages and uses- Powershell Basics

Powershell Get-Help Command Usages and uses


Get-Help:

  • The Help Command in PowerShell cmdlet . You can use this command to get help with any other command. For example, if you want to know how the Get-Service command works, you can type:

Get-Help -Name Get-Service
and Windows will display the full command syntax.

  • You can also use Get-Help with individual nouns and verbs. For example, to find out all the commands you can use with the Get verb, type:

Get-Help -Name Get-*

Thursday 2 June 2016

SCCM Interview Questions

SCCM Interview Questions


Does the Configuration Manager console support a 64-bit operation system?
Yes. The Configuration Manager console is a 32-bit program that can run on a 32-bit version of Windows and on a 64-bit version of Windows.

Are there new Active Directory schema extensions for System Center 2012 Configuration Manager?
No. The Active Directory schema extensions for System Center 2012 Configuration Manager are unchanged from those used by Configuration Manager 2007. If you extended the schema for Configuration Manager 2007, you do not need to extend the schema again for System Center 2012 Configuration Manager.

Have the site types changed from Configuration Manager 2007?
System Center 2012 Configuration Manager introduces changes to both primary and secondary sites while the central administration site is new site type. The central administration site replaces the primary site referred to as a central site as the top-level site of a multi-primary site hierarchy. This site does not directly manage clients but does coordinate a shared database across your hierarchy, and it is designed to provide centralized reporting and configurations for your entire hierarchy.
Can I join a pre-existing site to another site in System Center 2012 Configuration Manager?
No. In System Center 2012 Configuration Manager you cannot change the parent relationship of an active site. You can only add a site as a child of another site at the time you install the new site. Because the database is shared between all sites, joining a site that has already created default objects or that has custom configurations can result in conflicts with similar objects that already exist in the hierarchy.

Why can’t I install a primary site as a child of another primary site like I could in Configuration Manager 2007?
With System Center 2012 Configuration Manager, primary sites have changed to support only secondary sites as child sites, and the new central administration site as a parent site. Unlike Configuration Manager 2007, primary sites no longer provide a security or configuration boundary. Because of this, you should only need to install additional primary sites to increase the maximum number of clients your hierarchy can support, or to provide a local point of contact for administration.



Why do I need SQL Server for my secondary site?
In System Center 2012 Configuration Manager, secondary sites require either SQL Server, or SQL Server Express to support database replication with their parent primary site.