Skip to main content

Posts

Showing posts from April, 2023

AZure SQL DMV

 -- https://learn.microsoft.com/en-us/azure/azure-sql/database/high-cpu-diagnose-troubleshoot?view=azuresql SELECT     COUNT(*) as vCores FROM sys.dm_os_schedulers WHERE status = N'VISIBLE ONLINE'; select * from sys.dm_os_schedulers select * from  master.sys.resource_stats SELECT * FROM sys.dm_db_resource_stats ORDER BY end_time DESC;  

Azure SQL logins roles permissions

 --for sql logins SELECT * FROM sys.sql_logins; SELECT * FROM sys.sysusers; SELECT * FROM sys.database_principals  --- to connect master sql logins to the users in the user databases --- run this in user database select l.name as [login name],u.name as [user name] from sysusers u inner join sys.sql_logins l on u.sid=l.sid -- For AAD logins: SELECT * FROM sys.server_principals  SELECT * FROM sys.database_principals  -- To retrive role and it's granted members: SELECT    roles.principal_id                            AS RolePrincipalID   ,    roles.name                                    AS RolePrincipalName   ,    database_role_members.member_principal_id    AS MemberPrincipalID   ,    members.name                                AS MemberPrincipalName FROM sys.database_role_members AS database_role_members   JOIN sys.database_principals AS roles     ON database_role_members.role_principal_id = roles.principal_id   JOIN sys.database_principals AS members     ON database_role_mem

AutoIT input message in MicrosoftMeeting

; Download software https://www.autoitscript.com/site/autoit/downloads/ ; run this script from SciTE script editor ; This is the script, it will find the microsoft teams window and the chat box title, typing automatically  ; Wait for 5 seconds to open Microsoft Teams, click on the chat window and typing message field, this need to be done manually. Sleep(5000) While True ; Loop indefinitely ; Wait for the Microsoft Teams window to exist ;MsgBox(0, "Window Handle","debug -1") ;use the AutoIt v3 Window Info to capture the microsoft teams chat window title, for example, capture the chat box title is "John Smith (ABC) (You) | Microsoft Teams" WinWait("John Smith (ABC) (You) | Microsoft Teams") ; Activate the Microsoft Teams window using its title and a more specific WinTitleMatchMode WinActivate("John Smith (ABC)  (You) | Microsoft Teams") ; MsgBox(0, "Window Handle","debug0") ; Wait for the window to become active W