Wednesday, November 21, 2018

SharePoint - Sync User Provide to Site Collection

SharePoint - Sync User Provide to Site Collection

Sometimes the sync between the User Profile service and the site collections get disconnected and updates to the site collection do not get synced.

Running theses stsadmn commands and the timer job usually fix the problem. The first commend is not necessary but reports the current state.

Stsadm.exe –o sync –listolddatabases 0
Stsadm.exe –o sync –deleteolddatabases 0
Ruun Timer Job "User Profile Service Application - User Profile to SharePoint Full Synchronization" from CA .

SQL - List of accounts and database permissions

SQL - List of accounts and database permissions


DECLARE @DBuser_sql VARCHAR(4000)
DECLARE @DBuser_table TABLE (DBName VARCHAR(200), UserName VARCHAR(250), LoginType VARCHAR(500), AssociatedRole VARCHAR(200))
SET @DBuser_sql='SELECT ''?'' AS DBName,a.name AS Name,a.type_desc AS LoginType,USER_NAME(b.role_principal_id) AS AssociatedRole FROM ?.sys.database_principals a
LEFT OUTER JOIN ?.sys.database_role_members b ON a.principal_id=b.member_principal_id
WHERE a.sid NOT IN (0x01,0x00) AND a.sid IS NOT NULL AND a.type NOT IN (''C'') AND a.is_fixed_role <> 1 AND a.name NOT LIKE ''##%'' AND ''?'' NOT IN (''master'',''msdb'',''model'',''tempdb'') ORDER BY Name'
INSERT @DBuser_table
EXEC sp_MSforeachdb @command1=@dbuser_sql
SELECT * FROM @DBuser_table ORDER BY DB
Name


From <https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2044d912-72b2-4859-af58-d089284a7120/query-to-see-all-databases-to-which-a-user-has-access?forum=sqlsecurity

SQL - List Linked Servers and Logins

SQL - List Linked Servers and Logins

Probably need sysadmin role for this. Copied from the internet, need to find refernce.

SELECT    ss.name 
          ,ss.product 
          ,ss.provider 
          ,'Local Login ' = case sl.uses_self_credential 
                            when 1 then 'Uses Self Credentials' 
                            else ssp.name 
                            end 
           ,'Remote Login Name' = sl.remote_name 
           ,ss.modify_date 
      FROM sys.Servers ss 
 LEFT JOIN sys.linked_logins sl 
        ON ss.server_id = sl.server_id 
 LEFT JOIN sys.server_principals ssp 
        ON ssp.principal_id = sl.local_principal_id

SQL - List databases, size, and file location

SQL - List databases, size, and file location

This is based on something I found on the internet 7 years ago. Reference unkown

SELECT
    D.name,
    
    F.Name AS FileType,
F.type_desc,
    F.physical_name AS PhysicalFile,
    F.state_desc AS OnlineStatus,
    CAST((F.size*8)/1024 AS VARCHAR(26)) + ' MB' AS FileSize,
    CAST(F.size*8 AS VARCHAR(32)) + ' Bytes' as SizeInBytes
FROM 
    sys.master_files F
    INNER JOIN sys.databases D ON D.database_id = F.database_id
ORDER BY
    D.name

SQL - List Databases


SQL - List Databases

Probably need sysadmin server role to see all databases?

select * from sys.databases

Monday, November 19, 2018

Photo Retouching Service Review - Portrait vs Still Life

The photo retouching market has exploded with online service offerings. Many of them are focused on the portrait market and fewer offer services for still life.

If you offer photo retouching services, provide your link below in the comments.