select top 10 schema_name(tab.schema_id) + '.' + tab.name as [table], cast(sum(spc.used_pages * 8)/1024.00 as numeric(36, 2)) as used_mb, cast(sum(spc.total_pages * 8)/1024.00 as numeric(36, 2)) as allocated_mbfrom sys.tables tab inner join sys.indexes ind on tab.object_id = ind.object_id inner join sys.partitions part on ind.object_id = part.object_id and ind.index_id = part.index_id inner join sys.allocation_units spc on part.partition_id = spc.container_idgroup by schema_name(tab.schema_id) + '.' + tab.nameorder by sum(spc.used_pages) descceturtdiena, 2026. gada 26. marts
SQL top 10 largest tables
Query returns TOP 10 largest db tables
otrdiena, 2024. gada 12. novembris
trešdiena, 2023. gada 1. novembris
Exceeded the Maximum Number of Computer Accounts Allowed to Create in this Domain
It happens because of default AD ms-DS-MachineAccountQuota value which is 10.
The workaround is to delegate custom rights for specific account:
1. Open the Active Directory Users and Computers snap-in.
2. Right-click the container under which you want the computers added, and press Delegate Control.
3. Press Next.
4. Press Add.
5. After adding all the users and/or groups, press Next.
6. Select Create custom task to delegate and press Next.
7. Select Only the following objects in the folder, check Computer objects, check the Create selected objects in this folder box, and press Next.
8. Check the Create all child object box and press Next.
9. Press Finish.
Source: community.spiceworks.com
trešdiena, 2021. gada 8. decembris
ceturtdiena, 2020. gada 3. septembris
Reset MySQL root password on Windows
Stop MySQL service
Give user full access to /data folder
Command line:
mysqld --skip-grant-tables
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password') where USER='root';
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password') where USER='root';
mysql> FLUSH PRIVILEGES;
ceturtdiena, 2020. gada 25. jūnijs
otrdiena, 2019. gada 8. oktobris
Delete windows recovery partitions
Run PowerShell as admin
Run DISKPART.
Find disk ID:
Select disk you want to modify:
Find partition ID:
Select partition you want to delete:
Delete selected partition:
Source: www.lifewire.com
Run DISKPART.
Find disk ID:
DISKPART> list diskSelect disk you want to modify:
DISKPART> select disk 1Find partition ID:
DISKPART> list partitionSelect partition you want to delete:
DISKPART> select partition 5 Delete selected partition:
DISKPART> delete partition override
DISKPART> exitSource: www.lifewire.com
ceturtdiena, 2019. gada 14. marts
VLAN ranges
0 & 4095 -> full range
0 -> internal system reserved
1 -> Cisco default
2-1001 -> used for ethernet VLANS
1002-1005 -> FDDI & Token Ring
1006-4095 -> extended VLANS for other uses
0 -> internal system reserved
1 -> Cisco default
2-1001 -> used for ethernet VLANS
1002-1005 -> FDDI & Token Ring
1006-4095 -> extended VLANS for other uses
ceturtdiena, 2018. gada 25. oktobris
Recycle Bin is corrupted
Run Command prompt as Administrator.
This clears out the $Recycle.bin folder from the C:\ partition. You may have to do this for each hard disk partition in your system
Source: https://social.technet.microsoft.com
rd /s /q C:\$Recycle.bin
This clears out the $Recycle.bin folder from the C:\ partition. You may have to do this for each hard disk partition in your system
Source: https://social.technet.microsoft.com
ceturtdiena, 2018. gada 18. oktobris
Remove duplicate lines with Notepad++
In replace dialog select "Regular expression" and ". matches newline"
Find what:
Replace with:
Source: https://stackoverflow.com
Find what:
^(.*?)$\s+?^(?=.*^\1$)Replace with:
Source: https://stackoverflow.com
otrdiena, 2018. gada 14. augusts
Remote desktop connection not working after CredSSP update
After Windows 10 1803 Cumulative update it's not allowed to connect with RDP to unpatched machines.
To disable security check - create DWORD AllowEncryptionOracle in registry:
Be aware that disabling security check makes your machine vulnerable!
Source: support.microsoft.com
To disable security check - create DWORD AllowEncryptionOracle in registry:
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters\Set AllowEncryptionOracle = 2 Be aware that disabling security check makes your machine vulnerable!
Source: support.microsoft.com
trešdiena, 2018. gada 25. jūlijs
Log off user from remote machine
Find user's session ID:
Log off user:
QWINSTA /SERVER:<hostname>Log off user:
LOGOFF <sessionid> /SERVER:<hostname> /V
otrdiena, 2018. gada 5. jūnijs
Send test email from PowerShell
Send-MailMessage -SMTPServer 192.168.0.1 -To to@email.com -From from@email.com -Subject "This is a test email" -Body "Hi, this is a test email"
Source: https://serverfault.com
otrdiena, 2017. gada 19. decembris
Remote Desktop Connection - How to get the certificate prompt back?
Delete server connection keys from here:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\ServersHKCU\Software\Microsoft\Terminal Server\Client\LocalDevices\<name>
piektdiena, 2017. gada 18. augusts
pirmdiena, 2017. gada 3. jūlijs
Identify Windows 10 installation media build
Run Command Prompt as administrator
adism /Get-WimInfo /WimFile:F:\sources\install.esd /index:1
piektdiena, 2017. gada 30. jūnijs
Windows 10 lock screen picture file location
If you want to save some Windows Spotlight picture - open the folder:
Look for the files with current date greater than 400KB.
Open files with MSPaint to find the exact one. Save it to *.jpg
C:\Users\<User>\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\Look for the files with current date greater than 400KB.
Open files with MSPaint to find the exact one. Save it to *.jpg
Change AD user profile path
1. Find users SID:
2. Open in regedit key:
3. Modify ProfileImagePath value
wmic useraccount where name="USER" get sid2. Open in regedit key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\User SID3. Modify ProfileImagePath value
otrdiena, 2017. gada 24. janvāris
Delete old computers from Active Directory
Get list of inactive computer for 4 weeks:
dsquery computer –inactive 4
Source: portal.sivarajan.com
trešdiena, 2017. gada 4. janvāris
Change Office 365 sign-in name for AD synced user
To change Office 365 sign-in (Principal) name for user synced with Onsite AD:
Source: msonlinehelpdesk.zendesk.com
- Start PowerShell
- Make sure the Microsoft Online module is loaded
- Execute the following command:
set-msoluserprincipalname -newuserprincipalname newuser@emailaddress.com -userprincipalname user@emailaddress.com. Source: msonlinehelpdesk.zendesk.com
Abonēt:
Ziņas (Atom)