Showing posts with label microsoft. Show all posts
Showing posts with label microsoft. Show all posts

Friday, April 7, 2023

Microsoft : Change Remote Desktop port

 The step

  1. Start the registry editor. (Type regedit in the Search box.)
  2. Navigate to the following registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  3. Find PortNumber
  4. Click Edit > Modify, and then click Decimal.
  5. Type the new port number, and then click OK.
  6. Close the registry editor, and restart your computer.

 

Check the current port by running the following PowerShell command:

Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"

 

To add a new RDP Port to the registry:

$portvalue = 3390

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue

New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue
New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue 


Source : https://learn.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/change-listening-port

Thursday, January 19, 2023

Microsoft : Reboot a Server in a Failover Cluster


The guide:

  1. Login to the windows host to reboot
  2. Select Start> Administrative tools> Failover Cluster Manager
  3. Select Failover Cluster Manager
  4. Verify which server you need to reboot
  5. Select Nodes, right click the desired server, and select Drain Roles
  6. Verify that the Roles have migrated successfully by selecting the Node, and navigating to the Roles tab
  7. Reboot the host
  8. After the reboot has successfully, navigate back to Failover Cluster Manager> Nodes> Right click and select Fail Roles Back

Source:

Monday, November 29, 2021

Active Directory : The Security Database on the Server does not have a Computer Account for this Workstation Trust Relationship

Issue : 

The Security Database on the Server does not have a Computer Account for this Workstation Trust Relationship

Solutions:

  1. Login to local Administrator (make sure you set a local administrator password on machine and or set an user account password which is a member of local administrators group). Then unjoin the PC from the domain
  2. Reboot the PC.
  3. On the domain controller, go to Active Directory Users and Computers and delete the computer account.
  4. This may take up to a few minutes for the changes to replicate between all of the Active Directory domain controllers. So wait for few minutes.
  5. Rejoin the PC to the domain. 

Tuesday, March 10, 2020

Microsoft : \WINDOWS\SYSTEM32\CONFIG\SYSTEM is missing or corrupt

Restore the registry manually

1.Insert the Windows XP setup CD and restart the computer
2.Press any key to boot from the CD
3.Press R to access Repair Console
4.Enter the Administrator password. When the Command Prompt appears, type the following commands, one at a time and press Enter after each command, replacing C: with the Windows’ drive letter:

Backup current file to temp folder:
md tmp
copy c:\windows\system32\config\system c:\windows\tmp\system.bak
copy c:\windows\system32\config\software c:\windows\tmp\software.bak
copy c:\windows\system32\config\sam c:\windows\tmp\sam.bak
copy c:\windows\system32\config\security c:\windows\tmp\security.bak
copy c:\windows\system32\config\default c:\windows\tmp\default.bak
Delete corrupt file:
delete c:\windows\system32\config\system
delete c:\windows\system32\config\software
delete c:\windows\system32\config\sam
delete c:\windows\system32\config\security
delete c:\windows\system32\config\default 
Copy file from repair to system32\config:
copy c:\windows\repair\system c:\windows\system32\config\system
copy c:\windows\repair\software c:\windows\system32\config\software
copy c:\windows\repair\sam c:\windows\system32\config\sam
copy c:\windows\repair\security c:\windows\system32\config\security
copy c:\windows\repair\default c:\windows\system32\config\default
5.Exit
6.Enter
7.Restart computer

source : https://neosmart.net/wiki/windows-system32-config-system-missing-corrupt/


Wednesday, July 24, 2019

Tuesday, July 23, 2019

Microsoft : IIS Issue

Issuse:
IIS Application pool cannot be deleted


Solutions:

Here are the Powershell commands:
  • import-module WebAdministration
  • iis:
  • ls *optional* This just shows you the AppPools folder exists
  • cd AppPools
  • dir
  • del *name_of_Web_Pool*
  • Will ask you if you really do want to remove the App Pool. “Hit A for “Yes to all”.
  • ls – This will allow you to verify the AppPool is gone.
Source : http://jaredheinrichs.com/fix-application-pool-cannot-be-deleted-because-it-contains-1-applications.html

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

Issue :
Handler "PHP_via_FastCGI1" has a bad module "FastCgiModule" in its module list.

Solutions/Source:
https://domagojsalopek.com/post/handler-php-via-fastcgi-has-a-bad-module-fastcgimodule-in-its-module-list

Monday, July 22, 2019

Microsoft : IIS Redirect

1. Redirect HTTP to HTTP
 
        <rewrite>
            <rules>
                <rule name="redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" />
                </rule>
            </rules>
        </rewrite>
  • Permanent (301) – preferable type in this case, which tells clients that the content of the site is permanently moved to the HTTPS version. Good for SEO, as it brings all the traffic to your HTTPS website making a positive effect on its ranking in search engines.
  • Found (302) – should be used only if you moved the content of certain pages to a new place *temporarily*. This way the SEO traffic goes in favour of the previous content’s location. This option is generally not recommended for a HTTP/HTTPS redirect.
  • See Other (303) – specific redirect type for GET requests. Not recommended for HTTP/HTTPS.
  • Temporary (307) – HTTP/1.1 successor of 302 redirect type. Not recommended for HTTP/HTTPS.

Microsoft: Install SSL Certificate in Windows 2012

Step to install certificate :

1.Convert current SSL format to Windows support format (.PFX or .P12 or P7B or .SST)

2.Import the certificate used mmc.exe. Under mmc, add Snap-in Certificates - This snip-in will always certificates for : Computer account. Then finish

3.Under personal, import the certificate to server

4.Now, certificate is install in server.

Wednesday, June 12, 2019

Wednesday, October 3, 2018

Microsoft : Windows 2012 R2 GUI Missing after remove .Net Frame 4.5

Issue : GUI Missing after reboot



Solve:
1.  Run the below commands in the Server Core’s command prompt window to help you recover:
DISM.exe /online /enable-feature /all /featurename:NetFx4
DISM.exe /online /enable-feature /all /featurename:MicrosoftWindowsPowerShell
2.  The above commands will re-install .Net 4.0 and PowerShell on the server. Once PowerShell is installed, you can add the Graphical Shell (Windows Explorer) using the following command:
Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
3.  Once the GUI Shell is installed, you will need to restart the server with the following command:
Restart-Computer
 Source:

Monday, January 22, 2018

Microsoft : The trust relationship between this workstation and the primary domain failed.

Issue :

The trust relationship between this workstation and the primary domain failed.

Solutions :

To resolve this issue, remove the computer from the domain, and then connect the computer to the domain.
  • Use a local administrator account to log on to the computer.
  • Select Start, press and hold (or right-click) Computer > Properties.
  • Select Change settings next to the computer name.
  • On the Computer Name tab, select Change.
  • Under the Member of heading, select Workgroup, type a workgroup name, and then select OK.
  • When you are prompted to restart the computer, select OK.
  • On the Computer Name tab, select Change again.
  • Under the Member of heading, select Domain, and then type the domain name. 
  • Select OK, and then type the credentials of the user who has permissions in the domain.
  • When you are prompted to restart the computer, select OK.
  • Restart the computer.

Source :

Thursday, January 4, 2018

Microsoft : How to disable RDP access for Administrator

Solutions:

To deny a user or a group logon via RDP, explicitly set the "Deny logon through Remote Desktop Services" privilege.
  • Start | Run | secpol.msc if editing the local policy or chose the appropriate policy and edit it
  • Go to -> | Local Policies | User Rights Assignment.
  • Find and double click -> "Deny logon through Remote Desktop Services"
  • Add the user and / or the group that you would like to dny access.
  • Click ok
Source : 

Wednesday, August 3, 2016