top of page

Script to Fix Orphan Users in SQL Server

Updated: Jan 20, 2020

--Find Orphan Users in the DB

EXEC sp_change_users_login 'Report'

--If you already have a login created, map the user to login using the following script.

EXEC sp_change_users_login 'Auto_Fix', 'user'

--If you want to create a new login and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'

--get info about what AD groups the user is associated with.

xp_logininfo 'Domain\UserName','all'

83 views0 comments

Recent Posts

See All

SQL Server Profiler Trace

--Import multiple trace file in sql Table. --All the rollover files will be automatically imported --provide number tracefile to capture...

Comments


bottom of page