Microsoft RDP and Terminal Services info

Random session disconnects in Windows 11 22H2:

https://learn.microsoft.com/en-us/answers/questions/1021754/windows-11-remote-desktop-frequent-disconnects

Configure “Use only TCP” in Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections

Configure “Turn Off UDP On Client” in Computer Configuration > Administration Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client

Query and reset RDP session on remote PC:

Query:
qwinsta /server:IP/servername
Reset:
rwinsta SESSIONID /server:IP/servername

Configure RDP shadowing in Windows 10/11:

https://winitpro.ru/index.php/2018/07/11/rdp-shadow-k-rabochemu-stolu-polzovatelya-windows-10/

Firefox

Restore previous session after closing Firefox windows and leaving another window open:
– close Firefox and/or don’t open if you just find that you’re in trouble
– go to %AppData%\Mozilla\Firefox\Profiles\YOUR-PROFILE
– find sessionstore.jsonlz4 and rename if to sessionstore.jsonlz4-old
– go to %AppData%\Mozilla\Firefox\Profiles\YOUR-PROFILE\
– copy all files from there to some temporary directoy
– copy one of those files to %AppData%\Mozilla\Firefox\Profiles\YOUR-PROFILE
– rename that copied file to sessionstore.jsonlz4
– try to open Firefox and see if your tabs are restored
– if not or not all, try another file

There is a good tool to recover information from the .jsonlz4:
https://github.com/avih/dejsonlz4

HP Hardware & Software Info

HP ssacli commands in ESXi:

https://itbru.ru/index.php/2019/09/04/hp-ssacli-commands/
https://be-virtual.net/hpe-storage-controller-management-ssacli/
https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-a00018717en_us
https://kb.gtkc.net/hp-smart-array-cli-commands/
https://wiki.froberg.org/en/hpe-storage-controller-management-ssacli

Invoke SSACLI command from remote server: esxcli –server=”servername or IP” –user=”username” –password=”root password” ssacli cmd -q “controller all show status”

Continue reading “HP Hardware & Software Info”

Windows Server Active Directory and Domain controller info

Миграция и удаление контроллера домена Windows Server 2012 Active Directory/Domain controller migration

https://megapuper.ru/index.php?title=%D0%9C%D0%B8%D0%B3%D1%80%D0%B0%D1%86%D0%B8%D1%8F_%D0%BA%D0%BE%D0%BD%D1%82%D1%80%D0%BE%D0%BB%D0%BB%D0%B5%D1%80%D0%B0_%D0%B4%D0%BE%D0%BC%D0%B5%D0%BD%D0%B0_Windows_Server_2012_Active_Directory

Перед установкой Ad Role: Windows Internal Database, reboot

Необходимо чтобы во время добавления роли была запущена служба Remote Registry.

Необходимо чтобы на обоих контроллерах была включена поддержка IPv6 в настройках сетевых карт.

Если на втором сервере появляется ошибка типа “Невозможно добавить роли потому что сервер должен быть перезагружен”, то надо на оба сервера установить Windows Internal Databese, перезагрузиться, добавить в Logon As Service: NETWORK SERVICE, NT SERVICE\ALL SERVICES и NT SERVICE\MSSQL$MICROSOFT##WID, включить службу Remote Regitry, сделать gpupdate на обоих серверах, перезагрузить оба сервера, проверить, есть ли оба пользователя в gpedit, и потом только добавлять роль DC на второй сервер.

Console commands:
https://community.spiceworks.com/topic/1495956-trransferring-fsmo-roles#entry-5601702

The GUI interface for the FSMO roles is spread all over the place. I always use NTDSUTIL to do this.

Open a command prompt on a Domain Controller
Enter “ntdsutil” and the following commands:

roles
connections
connect to server dc1 - put the target DC server's name here
quit
transfer infrastructure master
transfer naming master
transfer pdc
transfer rid master
transfer schema master
quit
quit

After each transfer you will see a list of the FSMO roles and where they are currently stored. Also, ntdsutil has the ability to seize the FSMO roles to a new domain controller. Instead of “transfer …” you use “seize …” for the roles. Use transfer first and seize only as a last resort.

Если после переезда на новый DC не применяются групповые политики на других компьютерах, необходимо проверить чтобы в DNS сервере нового DC были убраны и изменены все записи, касающиеся старого DC.

Sometimes it can work better in Powershell. It used to for me because using ntdsutil once I got error with transferring Schema Master role:
https://petri.com/seizing_fsmo_roles/
Move-ADDirectoryServerOperationMasterRole -Identity "DC3" -OperationMasterRole PDCEmulator -Force
Move-ADDirectoryServerOperationMasterRole -Identity "DC3" -OperationMasterRole RIDMaster -Force
Move-ADDirectoryServerOperationMasterRole -Identity "DC3" -OperationMasterRole InfrastructureMaster -Force
Move-ADDirectoryServerOperationMasterRole -Identity "DC3" -OperationMasterRole SchemaMaster -Force
Move-ADDirectoryServerOperationMasterRole -Identity "DC3" -OperationMasterRole DomainNamingMaster -Force

Удаление:
https://winitpro.ru/index.php/2022/01/13/udalenie-kontrollera-domena-active-directory/

DFS Replication errors:

Authoritative restore for DFSR replication:
https://www.rmtechteam.com/blog/dfs-replication-dfsr-fix/
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/forest-recovery-guide/ad-forest-recovery-authoritative-recovery-sysvol

Perform a non-authoritative synchronization of DFSR-replicated sysvol replication:

https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/force-authoritative-non-authoritative-synchronization

How to fix Error 0xc00002e2 after rebooting Windows Domain Controller:

It happens when you restore old controller’s backup due, as I suppose, to a outdated DC database.
https://support.hostway.com/hc/en-us/articles/360001126259-How-to-fix-Error-0xc00002e2-after-rebooting-Windows-Domain-Controller

Reboot the server into Directory Services Restore Mode by pressing F8 before the OS begins loading. You will be required to use the local Administrator account password.

In Directory Services Restore Mode, you can check if there is a problem with the database by running the following commands:
ntdsutil.exe
activate instance ntds
files

If there is a problem with the Active Directory database NTDS.DIT, you will see an error like the following:
Could not initialize the Jet engine: Jet Error -501. Failed to open DIT for AD DS/LDS instance NTDS. Error -2147418113

To resolve this issue, rename all of the .log files located in C:\Windows\NTDS\ to .log.old, so the logs can be recreated after reboot.

This should fixed the database after the server is rebooted once more. If you continue to get the error, you can access again Directory Services Restore Mode and run the following command:
esentutl /p "c:\windows\ntds\ntds.dit"

Reboot the server and the issue should be solved.

Troubleshoot missing SYSVOL and Netlogon shares:

https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/troubleshoot-missing-sysvol-and-netlogon-shares

Корректное удаление контроллера домена в Active Directory:

https://winitpro.ru/index.php/2022/01/13/udalenie-kontrollera-domena-active-directory/

Проверка состояния контроллеров домена с помощью Dcdiag:

https://winitpro.ru/index.php/2021/04/14/proverka-sostoyaniya-kontrollerov-domena-active-directory-i-replikacii/

An Active Directory Domain Controller Could Not Be Contacted:

An Active Directory Domain Controller Could Not Be Contacted

Group Policy Apply Troubleshooting:

https://winitpro.ru/index.php/2019/03/18/primenenie-gpo-spravka-admina/
https://serverfault.com/a/516427

Test file share connectivity and permissions
Test command at workstation:
nslookup %USERDNSDOMAIN%
net view %USERDNSDOMAIN%
cd \\%USERDNSDOMAIN%\SYSVOL\%USERDNSDOMAIN%\

and check file permissions in folders: Policies and scripts

Check other ports’ connectivity
open and check port at domain infrastructure
Instructions here: Active Directory Firewall Ports – Let’s Try To Make This Simple

Delete local registry keys:
reg delete HKLM\SOFTWARE\Policies /f
reg delete HKCU\Software\Policies /f

Delete local folder:
RD /S /Q %windir%\System32\GroupPolicy

The trust relationship between this workstation and the primary domain failed

1. Войти в windows под локальной учетной записью Администратора или Администратора домена;
2. Выполнить команду klist purge (для зачистки кэша Kerberos);
3. Выполнить команду «netdom resetpwd /s:x.x.x.x /ud:domain\User /pd:*»;
где x.x.x.x это IP-адрес контроллера домена
domain\User это учетная запись администратора домена с указанием имени домена
4. После запроса пароля — необходимо ввести пароль от учетной записи администратора домена;
5. Далее перезагрузить компьютер и войти под учетной записью.

https://www.itworkroom.com/the-trust-relationship-domain-failed/

 

Windows troubleshooting

The Print Spooler service terminated unexpectedly:

net stop spooler
del %systemroot%\system32\spool\printers\*.shd
del %systemroot%\system32\spool\printers\*.spl
net start spooler
https://it.ros-kit.ru/help/computers/kak-ochistit-ochered-pechati/

Fix DHCP service cannot start: error 5: Access Denied:

https://www.wintips.org/how-to-fix-dhcp-service-cannot-start-access-is-denied/

Windows Update Error 0x80070422 while installing standalone update .msi:

– windows update service not running. Start it manually before installing .msi.

Windows 10 20H1 update error 0x8007001f MIGRATE_DATA:

Stop Windows Update
Remove c:\windows\SoftwareDistribution\Downloads
Remove c:\Windows_BT
Check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. If the value in ProfilesDirectory is not set as default %SystemDrive%\Users, set it like this temporary, update Windows, and change back as it was before update.
Reboot.
https://superuser.com/questions/1602404/win10-upgrade-to-version-20h2-failed-how-to-determine-the-cause

Install Windows 11 on unsupporterd hardware:

Fresh install with boot from original ISO:
After getting error about unsupported hardware press Shift + F10, then type “regedit” in CMD window
Go to HKEY_LOCAL_MACHINE\SYSTEM\Setup
Create key “LabConfig”
Create DWORD BypassTPMCheck, BypassSecureBootCheck, BypassRAMCheck, BypassCPUCheck with “1” in each
Close regedit and CMD
Go back in setup window and continue the installation.
https://adminwin.ru/oshibka-this-pc-doesnvt-meet-the-minimum-system-requirements-to-install-this-version-of-windows/

Updating existing installation to Windows 11:
Extract install.wim from Windows 11 ISO
Open Windows 10 .ISO equal to Windows 11 .ISO you’ve decided to install with any CD image editor like UltraISO. Replace ./Sources/install.wim with install.wim from Windows 11 .ISO. Save with decided name.

Domain controller Kerberos login/password errors

https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/domain-controller-not-functioning-correctly

If you experience this symptoms:
– your secondary DC can’t resolve DNS names
– you see “Audit Failure” event ID 4625 with the name of your secondary DC in event viewer on your promary Domain Controller

Check that you have right Kerberos realm on the secondary DC in HKEY_LOCAL_MACHINE\SECURITY\Policy\PolPrDmN
Aquire Kerberos password change from Primary DC:
netdom resetpwd /server: /userd:domain\administrator /password:

“Cannot connect to the DRIVELETTER$ admin share to verify if folder YOURDECIDEDSHAREDFOLDER exists on computer COMPUTERNAME” error while configuring NFS share:

https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/problems-administrative-shares-missing
Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters
If the AutoShareServer and AutoShareWks DWORD values in the LanmanServer\Parameters subkey are configured with a value data of 0, change that value to 1.

Error 0x800ccc14 in Outlook 2021 while creating new user profile:

https://answers.microsoft.com/ru-ru/windows/forum/all/после/fe32ecfd-2d08-43ae-91f9-401bda3ee803
If you’ve installed CryptoPRO before creating user profile in Outlook you’ll get this error. Remove the CryproPRO shit and create a profile without errors.

Failed to deploy OVF package: The task was canceled by a user.

Если OVA:
– распаковать OVA файл с виртуальной машиной используя Winrar или 7zip;
– изменить расширение .mf файла (например на mf-)
– отыскать CD-ROM: vmware.cdrom.iso в .ovf файле
– изменить iso на atapi
– экспортировать распакованное содержимое, выбрав отредактированный .ovf файл

https://communities.vmware.com/thread/431021

https://tm-experimental.blogspot.com/2013/11/failed-to-deploy-ovf-package-task-was.html

Fix ubuntu apt-get and release upgrade errors

Fix fetching updates:

When you get “Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?” error do this:

cd /etc/apt
mv sources.list sources.list.old
lsb_release -a
sudo cat sources.list.old |grep RELEASECODENAME |grep -v "#" |sed 's|us.archive.|old-releases.|g' >> sources.list

(del and retype >> in console if error occures)

 

https://www.tech-notes.net/issues-wit-apt-ubuntu-12-04/

https://stackoverflow.com/questions/38743951/unable-to-fetch-some-archives-maybe-run-apt-get-update-or-try-with-fix-missin

https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release/91821#91821

 

Resume a release upgrade:
https://askubuntu.com/questions/346678/how-do-i-resume-a-release-upgrade

SQLServer Error: 229, The EXECUTE permission was denied on the object ‘sp_sqlagent_update_agent_xps’

Если такая блевота в логе SQLAGENT.OUT:

2018-04-08 19:39:48 – ? [100] Microsoft SQLServerAgent version 12.0.2000.8 (X64 unicode retail build) : Process ID 4440
2018-04-08 19:39:48 – ? [495] The SQL Server Agent startup service account is XXX.
2018-04-08 19:39:48 – ? [393] Waiting for SQL Server to recover database ‘msdb’…
2018-04-08 19:39:48 – ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object ‘sp_sqlagent_update_agent_xps’, database ‘msdb’, schema ‘dbo’. [SQLSTATE 42000] (DisableAgentXPs)
2018-04-08 19:39:48 – ! [000] The EXECUTE permission was denied on the object ‘sp_sqlagent_update_agent_xps’, database ‘msdb’, schema ‘dbo’. [SQLSTATE 42000] (Error 229)
2018-04-08 19:39:48 – ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object ‘sp_sqlagent_update_agent_xps’, database ‘msdb’, schema ‘dbo’. [SQLSTATE 42000] (DisableAgentXPs)
2018-04-08 19:39:48 – ! [000] The EXECUTE permission was denied on the object ‘sp_sqlagent_update_agent_xps’, database ‘msdb’, schema ‘dbo’. [SQLSTATE 42000] (Error 229)
2018-04-08 19:39:48 – ? [098] SQLServerAgent terminated (normally)

То в первую очередь надо проверить, запустится ли сервис от админа, во вторую – права на базы как в самом SQL, так и на физическом носителе.