Get Serial Number using command line and PowerShell

10.Apr.2014 | by Gusac | Filed in: Articles, Tutorials

System’s serial number information is stored in WMI. The WMI class is Win32_Bios and there are different ways to query it. We are going to discuss two methods: Command Line Open the command prompt and type the following command: wmic bios get serialnumber     If you want query a remote system, add the switch /NODE:SERVERNAME, where SERVERNAME is the name of the remote system you want to query.   wmic /node:RemoteSVR01 bios get serialnumber   In above example, the command queries the remote system with name ‘RemoteSvr01’. PowerShell For local system:   Get-WmiObject -Class Win32_Bios   To query a remote system named ‘RemoteSvr01’: Get-WmiObject -Class Win32_Bios -ComputerName RemoteSvr01

Clear all print jobs using PowerShell

27.Oct.2013 | by Gusac | Filed in: Articles, Tutorials

Note: Cmdlet is available on Windows server 2012 but works remotely for previous versions. Windows Server 2012 has a new cmdlet Remove-PrintJob that helps delete the print jobs on the server. You need to specify either the Job ID or the Printer name. Example: Remove-PrintJob -ComputerName tctp22wspsx01 -PrinterName <TestPrinter> -ID 2 Clear all print jobs on the server The command below removes all the print jobs on remote computer. Get-Printer -ComputerName <SystemName>| Get-PrintJob | Remove-PrintJob or Removes all print jobs on the local system. Get-Printer | Get-PrintJob | Remove-PrintJob The above commands gets the list of printers on the system, pass it on the to next cmdlet which retrieves the print jobs on each of the printer. These jobs are then passed on to next cmdlet which finally removes the passed print jobs on the specified computer. Clear all print jobs older than X days Below example delete all print jobs older than 1 day: Get-Printer -ComputerName PrintServer1 | get-printjob | where{$_.SubmittedTime -lt ((Get-Date).adddays(-1))} | Remove-PrintJob (Get-Date).AddDays(-1)  - Change the value –1 to increase the number of days.

How to load VMware PowerCLI module in Powershell console

23.Jun.2013 | by Gusac | Filed in: Tutorials

To load VMware PowerCLI module and to have VMware cmdlets available in powershell console, run the following command: Add-PSSnapin VMware.VimAutomation.Core  

Managing Windows 2008 R2 server from Windows Server 2012 Server Manager

7.Jan.2013 | by Gusac | Filed in: Articles, Tutorials

Server Manager in Windows server 2012 lets you manage remote servers using Windows Remote Management (WinRM). However, for managing down-level servers like Windows server 2008 and Windows server 2008 R2 there are a few prerequisites need to be met.   1. Service Pack Prerequisite SP1 required on Windows Server 2008 R2 and SP2 on Windows Server 2008.   2. Microsoft .Net Framework 4.0   3.  Windows Management Framework (WMF) 3.0 Target system needs to have WinRM 3.0. It is included in Windows Management Framework 3.0 and can be download from Microsoft Site.   4.  Services status Windows Remote Management (WS-Management) service - Started and set to Automatic Windows Management Instrumentation service – Started and set to Automatic DCOM Process Launcher service – Started and set to Automatic   5.  WINRM Port or DCOM Port connectivity Make exception in Windows firewall to allow Winrm or Dcom port. Default port for WinRM over HTTP is 5985 and over HTTPS is 5986.   6. Microsoft Patch for the down-level (target) server Windows Server 2012 list the target servers with status: “Online - Verify WinRM 3.0 service is installed, running, and required firewall ports are open” http://support.microsoft.com/kb/2682011   7. Allow remote server management through WinRM Method 1: Group Policy Computer Configuration > Policies > Administrative Templates > Windows Components > Windows Remote Management (WinRM) > WinRM Service > Allow remote server management through WinRM Set the policy to Enabled and put * symbol for IPv4 and IPv6 filter.     Method 2: Command line On the target server, type the command: Alternatively, you can run the command “winrm quickconfig” to enable remote access   8. Enable Windows PowerShell remote management On the target sever, launch Powershell window and type the following comment: Enable-PSremoting –Force This command configures the computer to receive Windows PowerShell remote commands that are sent by using the WS-Management technology.

Turn IE Enhanced Security Configuration On or Off on Windows Server 2012

3.Jan.2013 | by Gusac | Filed in: Articles, Tutorials

Steps to enable or disable Internet explorer security Configuration:   1.  Open Server Manager 2.  Click Configure this local server to open the Local Server configuration page. 3.  Then, in the Properties area, next to IE Enhanced Security Configuration, click On to open the Internet Explorer Enhanced Security Configuration dialog. 3.  To allow members of the local Administrators group to use Internet Explorer in its default client configuration, under Administrators click Off. 4.  To allow members of all other groups to use Internet Explorer in its default client configuration, under Users click Off. 5.  Click OK to apply your changes. Once the Internet Explorer Enhanced Configuration is turned off for one set of users, Server Manager will display Off next to Internet Explorer Enhanced Security Configuration.

How to add DHCP Scope Option 150 for Cisco CallManager

2.Sep.2012 | by Gusac | Filed in: Tutorials, Articles

By default, the DHCP Scope option 150 for Cisco TFTP Server is not available on Windows Server. Below are the steps to add the configure the option 150:   1.  First we need to define the option 150 so that it can be made available in the scope options list. For this, right click on the IPv4 and choose the option  Set Predefined Options… (screenshot below)   2.  Click on the Add… button and you will get another dialog box asking you the Option Type. 3.  Fill the details as mentioned below and shown in the screenshot: Name: Cisco TFTP Server Data Type: IP Address Array: Checked Code: 150 Description: Used for Cisco Call Manager TFTP Server .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   4.  Click OK and click Edit Array button to enter the IP address for the TFTP Server (Screenshot below). Once you are done, click OK to exit.   5.  Now, to configure Option 150 for any scope, go to its Scope Options, right click on and choose Configure Options and select the Option 150 from the list. You can edit the IPs if you required.

How to check Active Directory Schema Versions

18.Jul.2012 | by Gusac | Filed in: Tutorials, Articles

Schema version value is stored in the objectVersion attribute in Active Directory. There are different methods to query and find the attributes value: Registry Command Line - DSQUERY ADSIEdit.msc Powershell Applies to: Windows server 2003, Windows server 2008 and Windows server 2012 server as well.   Registry: Navigate to registry: HKLM\System\CurrentControlSet\Services\NTDS\Parameters DWORD Value: Schema Version (value in Decimal) In example below, the schema version is 47 (Windows server 2008 R2)   Command Line - DSQUERY Open the command prompt as administrator and type: dsquery * cn=schema,cn=configuration,dc=DOMAINNAME,dc=COM -scope base -attr objectVersion .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   ADSIEDIT 1.  Launch ADSIEdit.msc and connect to Schema naming context.   2.  On the right pane, right click and go to properties. 3.  In properties window, scroll down to attribute objectVersion   Powershell Launch the Active Directory module for Powershell and type the following command: Get-ADObject "cn=schema,cn=configuration,dc=DOMAINNAME,dc=COM" -properties objectversion .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

How to enable Remote Desktop on Windows Server 2012

16.Jul.2012 | by Gusac | Filed in: Articles, Tutorials

In Windows 2012, the usual Remote Desktop window is not easily visible. To launch the Remote Desktop window, there are two methods: Command Line and Graphical User Interface. Command Line 1. Move your mouse to bottom right of the screen and you would see a bar, Charm Bar. 2. Click on the Search button, the one with magnifying glass. See the screenshot below: 3. Enter CMD in the Apps search text box: 4. Click on CMD on the left, it will launch the command prompt: 5. In command prompt window, type SystemPropertiesRemote and hit Enter 6. The above command would launch the System Properties windows. 7. Select the appropriate option under Remote Desktop and click OK.   Graphical Interface 1. Move your mouse to bottom right of the screen and you would see a bar, Charm Bar. 2. Click on the Settings button, 3. Click on Server Info under Desktop 4. The Server Info launches the Control Panel System page. Click Advance System Settings on the right. This would launch the same System Properties page. 5. Select the appropriate option under Remote Desktop and click OK.

Changes in mstsc /admin switch

17.May.2012 | by Gusac | Filed in: Articles, Troubleshoot, Tutorials

As most of you know by now that since Windows server 2008, mstsc.exe has replaced old /console switch with new /admin switch. This article talks about the behavior when you connect to an administrative session using the /admin switch. Below are the behavioral changes: It does not connect to session 0 of the server unlike /console switch. This is because the session 0 on Windows 2008 and later operating system is used exclusively for the system services. Client access license is not used. If you have Remote desktop services role installed with configured CALs, using this switch will not use one of the CALs. We can have only two sessions on the server including session using /admin switch. This different from previous version where we could have two remote desktop sessions and a third console session using /console switch. Time zone and Plug-n-Play device redirection is not available with /admin session Easy Print feature is not available in the session. Administrative sessions (/admin) are not counted towards session limit.

Windows server 8 installation–step by step screenshot

1.Apr.2012 | by Gusac | Filed in: Tutorials, Articles

Step by Step screenshot of Windows server 8 beta installation: