Posts

Showing posts with the label Windows

Changing the name of 'My Computer' icon on the Desktop

Update below registry value to reflect the 'My Computer' icon name in the Desktop: HKEY_USERS\S-1-5-21-1343024091-764733703-725345543-71394\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D} key: (Default) Value: Computer name Split for easy lookup: HKEY_USERS\ S-1-5-21-1343024091-764733703-725345543-71394\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ CLSID\ {20D04FE0-3AEA-1069-A2D8-08002B30309D} PowerShell one-liner: set-itemproperty - path 'registry::HKEY_USERS\S-1-5-21-1343024091-764733703-725345543-71394\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}' - name '(Default)' - value $ ( $env:computername )

Find Windows Product Keys

 Ways to find Windows Product Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform , find value of BackupProductKeyDefault (Not working) Find Product Key Using CMD: wmic path softwarelicensingservice get OA3xOriginalProductKey (Not working) powershell: "(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey" (Not working) Registry: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId

Get wifi password (connected wifi connection) from command line

Image
 Execute below command, and look for value in the output: "key content" under "security settings" netsh.exe wlan show profiles name=’Profile Name’ key=clear Sample output: Ref:  Get Wireless Network SSID and Password with PowerShell - Scripting Blog (microsoft.com)

Finding and Resolving IP conflict in Windows machines

 Option 1: Look for event log something like below in the system experiencing IP conflict: Log Name : System Source : Tcpip Event ID: 4199 "The system detected an address conflict for IP address <> with the system having network hardware address <>. Network operations on this system may be disrupted as a result Option 2: IPconfig result will show private IP address (like 169.254.) assigned even though you set a static IP.

Run as System account

Below is a way to run as System account in Windows computers: psexec -i -s cmd.exe -i  : Interactive -s  : System account cmd.exe : launch command window to execute other commands To run Powershell as system account: psexec -i -s powershell.exe

Solution for RDP connection issue due to TLS version

Issue : RDP connection is unsuccessful from Windows 7 or Windows 2008 R2 to TLS1.0 disabled servers. Solution : Enable TLS1.2 in the server and reboot. Refer this link for TLS versions:  TLS versions Install this hotfix from Microsoft in the client computers and reboot: https://support.microsoft.com/en-sg/help/3080079/update-to-add-rds-support-for-tls-1-1-and-tls-1-2-in-windows-7-or-wind This update provides support for Transport Layer Security (TLS) 1.1 and TLS 1.2 in Windows 7 Service Pack 1 (SP1) or Windows Server 2008 R2 SP1 for Remote Desktop Services (RDS). 

Solutions for WMI errors

Solutions for WMI errors Symptoms: When you run wmic commands in a Windows server, you may get errors like below: wmic VOLUME GET Name ERROR: Description = Not Found Below are solutions for WMI errors, yet to be verified: If WMI database is broken, you need to follow this guide: https://msdn.microsoft.com/en-us/library/aa394603(v=vs.85).aspx to run WMI Diagnosis Utility , which will help you to confirm if that is really your issue and then fix it by following this guide: First try: winmgmt /verifyrepository .If the result is shown as inconsistent, go to step 2 winmgmt /salvagerepository winmgmt /verifyrepository - to check again wmi repository had been repaired successfully. If it fails - try fully rebuild the WMI Repository follow these steps: Disable and stop the winmgmt service Remove or rename C:\Windows\System32\wbem\repository Enable and start the winmgmt service Open a CMD prompt as Administrator In the CMD prompt Navigate to C:\Windows\System32\...

[Windows][Commands] Get DNS servers of a domain

Ways to get DNS servers of a domain: Method 1: nslookup > set type=NS > Outputs: Non-authoritative answer:   nameserver = DNSserverNamel   nameserver = DNSserverName2 DNSserverNamel     internet address = DNSserverIPl DNSserverName2    internet address = DNSserverIP2 Method 2: nltest /dnsgetdc: Output: List of DCs in pseudo-random order taking into account SRV priorities and weights: Non-Site specific:    DNSserverNamel  DNSserverIPl    DNSserverName2  DNSserverIP2 The command completed successfully.

Logon scripts FAQ

Frequently Asked Questions About Logon Scripts:   1.How do I setup Logon scripts in a domain with Active Directory?   2.Why would I choose one method over another?   3.Can I use both methods to assign Logon scripts?   4.How do I setup Logon scripts so they support all of my clients?   5.How do I configure a Logon script for a user on the "Profile" tab in AD Users & Computers?   6.What languages can I use for Logon scripts?   7.Can I use a VBScript program for a Logon script on all clients in my domain?   8.How do I configure a Logon script with Group Policy?   9.What about Logoff, Startup, and Shutdown scripts in Group Policy?   10.What permissions are required for Logon scripts to run?   11.What can be done with a batch file Logon script, besides launch a VBScript program?   12.What about Logon scripts in an NT domain? Answers:  1. How do I setup Logon script...