-
how to restore logins with passwords
Hi,
I want to delete N number of logins today and restore them 5 days later.
What steps should be done beside backup of master.
what whould be the way to restore logins with passwords (with or without permissions )without restoring master?
I gess just running sp_resolve_logins
will not help.
thank you
Alex
-
SELECT 'EXEC sp_addlogin @loginame = ''' + loginname + ''''
,', @defdb = ''' + dbname + ''''
,', @deflanguage = ''' + language + ''''
,', @encryptopt = ''skip_encryption'''
,', @passwd ='
, cast(password AS varbinary(256))
,', @sid ='
, sid
FROM syslogins
WHERE name NOT IN ('sa')
AND isntname = 0
--This will produce a script. Store that script and re run it whenever u want to recreate. it creates all logins except SA and NTLogins.
-
thank a lot Mak
thank a lot, Mak
it works fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|