Showing posts with label Microsoft Windows. Show all posts
Showing posts with label Microsoft Windows. Show all posts

Get Motherboard Model and Serial

Get Motherboard Model and Serial

In CMD

 wmic baseboard get product,Manufacturer,version,serialnumber

Rearm windows server trail license / expire license


  • Open Windows PowerShell
  • To check current license status, run  slmgr -dlv
  • To ream Windows license,  run slmgr -rearm
  • Restart Windows, run Restart-Computer

Access AD without installing RSAT

Access AD without installing RSAT

Open in Run -

C:\Windows\System32\rundll32.exe dsquery.dll,OpenQueryWindow

VSS Writers Failed (Status and Reason)

 Source - http://support.mozy.com/articles/en_US/FAQ/How-do-I-identify-the-cause-of-my-VSS-error

Check status

  1. Click on Start, then in the Search bar, type cmd.  
  2. When cmd appears at the top of the Start menu, right-click on it and select Run As Administrator.
  3. Type vssadmin list writers into the command prompt, then press Enter.

Explore Event Logs

VSS errors are typically registered within the Windows' event logs.

Type eventvwr.msc into the open command prompt, then press Enter.

Within the Event Viewer there are two logs in which VSS related errors may be chronicled:  The Application Log and the System Log.  Under Windows Vista and Windows 7 these logs will be under the category Windows Logs, while in Windows XP these logs will be immediately viewable.  VSS errors will appear in the Application Log as entries with a source labeled VSS, and in the System Log they will appear with a source labeled volsnap.  For both logs we suggest sorting by source, then look for any items that match either of those source types.  Document the Event IDs associated with these errors, as Internet searches for those Event IDs will provide a good start for finding a resolution to your issue.

Take another look at the logs; determine whether there are any repeating errors.  There are many other issues that can contribute to VSS errors, and they may be listed under different source headings.  Some common service errors that impact VSS deal with the COM+ services, or the MSDTC.  Issues with the hard drive or filesystem can also cause VSS issues.  In particular, look within the System log for any errors under the source disk, ftdisk or ntfs.  If you see any errors or warnings under those source types, you may need to perform a checkdisk.


Server Uptime Script

Server Uptime Script

1. create txt file "Servers.txt"

2.  insert server hostname or IP

3. Run script

Powershell code -

 

$names = Get-Content "C:\Uptime\Servers.txt"

        @(

   foreach ($name in $names)

      {

            if ( Test-Connection -ComputerName $name -Count 1 -ErrorAction SilentlyContinue ) 

  {

            $wmi = gwmi -class Win32_OperatingSystem -computer $name

    $LBTime = $wmi.ConvertToDateTime($wmi.Lastbootuptime)

    [TimeSpan]$uptime = New-TimeSpan $LBTime $(get-date)

    Write-output "$name Uptime is  $($uptime.days) Days $($uptime.hours) Hours $($uptime.minutes) Minutes $($uptime.seconds) Seconds"

  }

             else {

                Write-output "$name is not pinging"

          }

        }

) | Out-file -FilePath "C:\Uptime\UpUptime_results.txt"

Set Remote Desktop License per User

 

Setting RD License per User



  1. CMD > gpedit.msc

  1. Browse to

Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Licensing


  1. Double Click Set the Remote Desktop licensing mode


  1. Change it to Enable

Then change Specify the licensing mode for the RD Session Host server to Per User




  1. Click Apply and OK.


DONE


Manual add Windows License Servers (Regedit)

 

Manual License Servers Entry (Regedit)


  1. Open CMD > regedit.

  2. Browse to (Local_Machines\SYSTEM\CurrentControlSet\Services\TermServices\Parameters\LicenseServers)









  1. Add the license server name (Insert Server FQDN) in the (SpecifiedLicenseServers) key.


Extract Windows Install Date and OS Version

Get Install Date and OS Version for a list of Servers provided in a Text file and publish the result in CSV.

Script reads each and every IP/hostname from the inputfile "Serverlist.txt" (Create a Text File "Serverlist.txt" in the same path you save this script), checks if the IP/hostname can be reached. 

If it can be reached connects to WMI and collects the Install Date and OS Version (Caption) and we dump it in a CSV file in the same path where you have this script.

1. Create txt file "Serverlist.txt"

2. Insert server ip or hostname in txt file.

3. Run script


PowerShell Code --


<#  

    Author          : Preenesh Nayanasudhan  

    Script           : Get Install Date and OS Version for list of Servers provided in Text file Serverlist.txt  

    Purpose         : Get Install Date and OS Version for list of Servers provided in Text file and publish the result in CSV  

    Pre-requisite   : Create a Text File Serverlist.txt in the same path you save this script  

#>  

  

# Input File 

 

$Servers = Get-Content "ServerList.txt"  

 

$report = @() 

 

ForEach ($server in $Servers)  

{  

    #Test if computer is online 

      

    if (test-Connection -ComputerName $server -Count 3 -Quiet )  

    {  

        $PingResult = 'Server IS Pinging' 

         

        # Connect to WMI on remote machine to get the required information 

 

        $gwmios = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $server 

 

        # Get the Install Date and Convert readable date & time format 

 

        $osidate = $gwmios.ConvertToDateTime($gwmios.InstallDate) 

        $osname = $gwmios.Caption  

 

        $tempreport = New-Object PSObject  

        $tempreport | Add-Member NoteProperty 'Server Name' $server 

        $tempreport | Add-Member NoteProperty 'Ping Result' $PingResult 

        $tempreport | Add-Member NoteProperty 'OS Version' $osname  

        $tempreport | Add-Member NoteProperty 'OS Install Date' $osidate 

        $report += $tempreport  

    }   

    else   

        {   

        $PingResult = 'Server NOT Pinging'  

        $tempreport = New-Object PSObject  

        $tempreport | Add-Member NoteProperty 'Server Name' $server 

        $tempreport | Add-Member NoteProperty 'Ping Result' $PingResult 

        $report += $tempreport  

    }  

  

}  

$report | Export-Csv -NoTypeInformation ('OSInstallDate.csv')


Windows Terminal Server Architecture

 


Extract Group Policy Report

Extract Group Policy Report

-----------------------------------------------------------------

Command-

cd desktop <Press enter>

GPRESULT /H GPReport.html <Press enter>

GPReport.html <Press enter>

Find which ports are in use

Find which ports are in use

----------------------------------------------------------------

CMD command

netstat -ano | find "port no."

Compile all csv into one

 Compile all csv into one

---------------------------------------------------------------

CMD Command-

cd to Path

copy *.csv All.csv

Find/Extract System Info

 System Info TEXT Output

--------------------------------------------------------------

CMD Command -

systeminfo  > 01_%Computername%_systeminfo.txt

Find Remote Desktop License grace days left

Find Remote Desktop License grace days left

Command -

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !="") CALL GetGracePeriodDays

CMD Hostname IP address Date Time

cd\

cls

hostname & ipconfig | find "192"    ---- Insert IP

date & time