• Home
  • Linux
  • Docker
  • Windows
    • PS
    • C#
    • Exchange Server
  • Other
    • Perl
    • IPV6
    • MacOS
  • DB
    • MSSQL
    • MariaDB
    • PG

Home

Windows 11, taskbar corner overflow, show all tray icons

Details
Written by: po3dno
Category: Windows
Created: 01 January 2022
Hits: 1020

Here is a workaround :

  • Click the Start or Search icon in the Taskbar
  • Type cmd, right-click on Command Prompt, and then click Run as administrator
  • Copy and paste the following: explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
  • Press Enter
  • Select "Always show all icons and notifications on the taskbar"
  • Click OK

If the checkbox "Always show all icons ..." is greyed out, I'm not totally sure what fixed it yet but it appears that changing the EnableAutoTray value in the Regedit helped.

To do so, open Regedit, go here:

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]

Then set EnableAutoTray to 1

RemoveLocalAdm_PC

Details
Written by: po3dno
Category: C#
Created: 20 October 2021
Hits: 1040
using System;
using System.Management;
using System.Text.RegularExpressions;
using System.DirectoryServices;

namespace RemoveLocalAdm_PC
{
    class Program
    {
        static void Main(string[] args)
        {
            string PC = System.Environment.MachineName;
            string groupName = "local_administrator_" + PC;
            string sid = "544";

            ManagementObjectSearcher searchGroup = new ManagementObjectSearcher(@"SELECT name FROM Win32_Group where LocalAccount = true and sid = 'S-1-5-32-544'");
            ManagementObjectCollection adminGroup = searchGroup.Get();
            string gr = null;

            /*
            foreach (ManagementObject group in adminGroup)
            {
                gr = group["Name"].ToString();
                //Console.WriteLine(group["Name"].ToString());
                continue;
            }
            */

            if (gr != null)
            {
                ManagementObjectSearcher search = new ManagementObjectSearcher("SELECT * FROM Win32_GroupUser where (groupcomponent='win32_group.name=\"" + gr + "\",domain=\"" + PC + "\"')");
                ManagementObjectCollection userList = search.Get();

                foreach (ManagementObject user in userList)
                {
                    string pattern = ".+cimv2:win32_(.+).Domain=\"(.+)\",Name=\"(.+)\"";
                    Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);

                    Match m = Regex.Match(user["PartComponent"].ToString(), pattern, RegexOptions.IgnoreCase);

                    /*
                    if (m.Success)
                    {
                        //Console.WriteLine(m.Groups[1].Value + ' ' + m.Groups[2].Value + ' ' + m.Groups[3].Value);
                    }
                    */

                    DirectoryEntry localGroup = new DirectoryEntry(String.Format("WinNT://{0}/{1},group", Environment.MachineName, gr));
                    DirectoryEntry removeobj = new DirectoryEntry(String.Format("WinNT://{0}/{1}", m.Groups[2].Value, m.Groups[3].Value));

                    Console.WriteLine(String.Format("WinNT://{0}/{1}", m.Groups[2].Value, m.Groups[3].Value));

                    if (m.Groups[2].Value == PC && (m.Groups[3].Value == "Администратор" || m.Groups[3].Value == "Administrator")) { continue; }
                    if (m.Groups[2].Value == "DOMAIN" && m.Groups[3].Value == "Workstation_admins") { continue; }
                    if (m.Groups[2].Value == "DOMAIN" && m.Groups[3].Value == groupName) { continue; }

                    try
                    {
                        localGroup.Invoke("Remove", new object[] { removeobj.Path });
                        localGroup.CommitChanges();
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Try remove from group from: {0} group or user: {1}..." + Environment.NewLine + e.ToString(), gr, m.Groups[2].Value + @"\" + m.Groups[3].Value);
                    }

                }
            }


            //Console.ReadLine();
        }
    }
}

Рекурсивный merge AVHDX

Details
Written by: po3dno
Category: Power Shell
Created: 19 October 2021
Hits: 1013

$vhd = Get-ChildItem -Filter base* | Get-VHD 

$curdisk = "e:\export\virtual hard disks\base-w2019en.vhdx"; 
function Get-ParentAVHDX {
  param ($p); 
  $pp = $vhd | ?{$_.parentpath -eq $p}; 
  if ($pp) {
    Get-ParentAVHDX($pp.path); 
    write-host $pp.path $pp.parentpath; 
    Merge-VHD -Path $pp.Path -DestinationPath $pp.ParentPath -Verbose -WhatIf
  }
} 
Get-ParentAVHDX($curdisk)

partition 1

Details
Written by: po3dno
Category: MariaDB
Created: 07 October 2021
Hits: 982

ALTER TABLE e_5136_copy
REORGANIZE PARTITION p_future INTO (
PARTITION p_202201 VALUES LESS THAN (TO_DAYS('2022-02-01 00:00:00')),
PARTITION p_future VALUES LESS THAN MAXVALUE);


ALTER TABLE e_5136
REORGANIZE PARTITION p_future INTO (
PARTITION p_202201 VALUES LESS THAN (TO_DAYS('2022-02-01 00:00:00')),
PARTITION p_202202 VALUES LESS THAN (TO_DAYS('2022-03-01 00:00:00')),
PARTITION p_202203 VALUES LESS THAN (TO_DAYS('2022-04-01 00:00:00')),
PARTITION p_202204 VALUES LESS THAN (TO_DAYS('2022-05-01 00:00:00')),
PARTITION p_202205 VALUES LESS THAN (TO_DAYS('2022-06-01 00:00:00')),
PARTITION p_202206 VALUES LESS THAN (TO_DAYS('2022-07-01 00:00:00')),
PARTITION p_202207 VALUES LESS THAN (TO_DAYS('2022-08-01 00:00:00')),
PARTITION p_202208 VALUES LESS THAN (TO_DAYS('2022-09-01 00:00:00')),
PARTITION p_202209 VALUES LESS THAN (TO_DAYS('2022-10-01 00:00:00')),
PARTITION p_202210 VALUES LESS THAN (TO_DAYS('2022-11-01 00:00:00')),
PARTITION p_202211 VALUES LESS THAN (TO_DAYS('2022-12-01 00:00:00')),
PARTITION p_202212 VALUES LESS THAN (TO_DAYS('2023-01-01 00:00:00')),
PARTITION p_future VALUES LESS THAN MAXVALUE);

secedit

Details
Written by: po3dno
Category: Power Shell
Created: 05 October 2021
Hits: 1009
$account = "accountName"
$userRight = "SeServiceLogonRight*"

$code = (Start-Process secedit -ArgumentList "/export /areas USER_RIGHTS /cfg c:\policies.inf" -Wait -PassThru).ExitCode
if ($code -eq 0)
    {
        Write-Output "security template exported successfully exit code $code"
    }
else
    {
        Write-Output "security template export failed exit code $code"
    }

$sid = ((Get-LocalUser $account).SID).Value

$policy = Get-Content C:\policies.inf
$newpol = @()
foreach ($line in $policy)
    {
        if ($line -like $userRight)
            {
                $line = $line + ",*$sid"
            }

        $newpol += $line
    }

$newpol | Out-File C:\policies.inf -Force

$code = (Start-Process secedit -ArgumentList "/configure /db secedit.sdb /cfg C:\policies.inf /areas USER_RIGHTS /log C:\policies.log" -Wait -PassThru).ExitCode
if ($code -eq 0)
    {
        Write-Output "exit code $code"
    }
else
    {
        Write-Output "exit code $code"
    }

Remove-Item -Path c:\policies.inf -Force
  1. LocalGroup_AD
  2. LDAP
  3. iso uefi
  4. How to stop computer from entering sleep under “Critical Battery Trigger Met” misidentification

Subcategories

Power Shell Article Count:  53

C# Article Count:  10

Perl Article Count:  1

Exchange Server Article Count:  15

Other Article Count:  24

MSSQL Article Count:  17

Windows Article Count:  25

MariaDB Article Count:  3

Linux Article Count:  8

Docker Article Count:  2

pg Article Count:  1

Page 10 of 32

  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 175
  • Articles View Hits 154278