Home Forums Programming Powershell SQL Logins output to a file via sp_help_revlogin RE: SQL Logins output to a file via sp_help_revlogin

  • I'm working on this problem as well. The reason this does not work is because the output from both stored procedures are different.

    sp_helpdb outputs its results to a grid much like any query.

    sp_help_revlogin actually generates a scripts in the messages window.

    You need to find a way to return the Messages in the SQLDataAdapter.

    invoke-sqlcmd can issue a -verbose switch to output messages, but so far I have had no luck assigning this to a variable or output file.