Mostrando postagens com marcador Windows Server. Mostrar todas as postagens
Mostrando postagens com marcador Windows Server. Mostrar todas as postagens

sexta-feira, março 07, 2025

Oracle OCI Console Connection

These are the steps to access your Windows instance using VNC. I am assuming that you have the necessary permissions and that the network allows traffic on port 443. The details can be found in the Oracle documentation.

Create a local connection:


Copy VNC connection:





This is an example:
Start-Job { Echo N | plink.exe -i C:\SSHKeys\ssh-privatekey.ppk -N -ssh -P 443 -l ocid1.instanceconsoleconnection.oc1.us-chicago-1.anxxeljras4jybackio75le7wjglf6fxxxxx -L 5905:ocid1.instance.oc1.us-chicago-1.anxxeljras4xxxxx:5905 instance-console.us-chicago-1.oci.oraclecloud.com }; sleep 5; plink.exe -i C:\SSHKeys\ssh-privatekey.ppk -N -L 5900:localhost:5900 -P 5905 localhost -l ocid1.instance.oc1.us-chicago-1.axxxxxxxxxxxxxxxa

Your private key must be in PPK format. You can use PuTTYgen to convert the key.

VNC viewer:


Bonus: It is possible to use SAC (Special Administration Console). It is disabled by default, but you can enable it using bcdedit:


bcdedit /ems ON bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200


Copy the command and connect. After the connection is established, start a session and connect to it (example below: session 1). You can type "cmd" to create the first session, and it's possible to have multiple sessions.

SAC>ch -si 1:





Done:



terça-feira, dezembro 17, 2024

Oracle OCI - Lost Windows Instance Password

1. Create a Ubuntu Instance and Connect via SSH

2. For the Windows Instance

Stop the Windows Instance.
Detach the Boot Volume.


3. Attach the Boot Volume to the Ubuntu Instance

Attach the detached Windows boot volume as a block volume in the Ubuntu instance.
Set the attachment type to iSCSI and Read/Write access.

4. Copy iSCSI Commands & Information
Copy the iSCSI commands and connection details provided when attaching the volume. These commands will be used later on the Linux instance.




Run the command in the Linux:



5. In the Linux (Ubuntu) Instance
Perform the following steps to recover and reset the Windows instance credentials:

a. List Volumes:
sudo sfdisk -l /dev/sdb

b. Fix NTFS Issues:
Identify the partition with NTFS issues (e.g., /dev/sdb4, typically shown as "Microsoft basic data").
$sudo ntfsfix /dev/sdb4

c. Create a Directory to Mount the Partition:
$sudo mkdir -p /media/windows

d. Mount the Partition:
$sudo mount /dev/sdb4 /media/windows

e. Update Your System:
$sudo apt update

f. Install chntpw:
$sudo apt install chntpw

g. Run chntpw to Clear or Reset Passwords:
Use chntpw to modify the Windows user passwords.
Clear the user password:
$chntpw /media/windows/Windows/System32/config/SAM -u opc
Select the option 1 to clear the password
Allow black passwords
chntpw -e /media/windows/Windows/System32/config/SYSTEM
>cd ControlSet001\Control\Lsa\
>ed LimitBlankPasswordUse
>0x0



6. Unmount the Volume

$sudo umount /media/windows

7. Disconnect the iSCSI Connection

Run the commands you copied earlier when attaching the iSCSI volume (for diconnect).

8. Reattach the Boot Volume to the Windows Instance

Detach the volume from the Ubuntu instance.

Reattach it to the original Windows instance.

9. Access the Windows Instance

You should now be able to connect to the Windows instance using RDP without a password.

Modify both the opc user and the Administrator user settings.
If the Administrator account is disabled, enable it during the process (use chntpw).
Making changes to both accounts ensures accessibility.
Better safe than sorry!

segunda-feira, abril 01, 2024

Steps to rename an Active Directory Domain

There are some requirements that I have not added to this article; you can find them in Microsoft articles.

 I will run the commands in a domain member machine, not in the domain controller. In the domain member server:

>Install-WindowsFeature RSAT-AD-Tools -IncludeAllSubFeature

 In the domain controller create a DNS zone for your new domain:

OLD Domain: contoso.com

New Domain: contosonew.com

 >Add-DnsServerPrimaryZone -Name contosonew.com -ReplicationScope "Domain" –PassThru

In the domain member-run:

>rendom /list 


A Domainlist.xml will be created. You need to edit the file and replace the DNSname and NetBiosName

<?xml version ="1.0"?>
<Forest>
    <Domain>
        <!-- PartitionType:Application -->
        <Guid>891277a0-70de-4f9d-a176-80140ea9c334</Guid>
        <DNSname>ForestDnsZones.contosonew.com</DNSname>
        <NetBiosName></NetBiosName>
        <DcName></DcName>
    </Domain>
    <Domain>
        <!-- PartitionType:Application -->
        <Guid>e60931a4-f3e9-4b7c-8ae2-1e4d2078338c</Guid>
        <DNSname>DomainDnsZones.contosonew.com</DNSname>
        <NetBiosName></NetBiosName>
        <DcName></DcName>
    </Domain>
    <Domain>
        <!-- ForestRoot -->
        <Guid>e070ac56-99c0-4005-8193-40535c6eabd1</Guid>
        <DNSname>contosonew.com</DNSname>
        <NetBiosName>CONTOSO</NetBiosName>
        <DcName></DcName>
    </Domain>
</Forest>

>rendom /showforest

Upload the file:

>rendom /upload

Prepare:

>rendom /prepare

Execute, Domain Controllers will be restarted automatically
>rendom /execute

 

 Fix the GPO issues in the domain controller:

gpfixup /olddns:contoso.com /newdns:contosonew.com


gpfixup /oldnb:TEST /newnb:RESOURCE

Rename the Domain Controllers:

netdom computername DC1.contoso.com /add:DC1.contosonew.com
netdom computername DC1.contosonew.com /makeprimary:DC1.contosonew.com

Remove the old reference to the old domain

rendom /clean

Finish the process (For me I got several error, and after a few minutes and was able to finish the process):

rendom /end