This procedure returns an expanded list of Active Directory groups for all servers.
NOTE: This SP is likely to take a long time to run, especially with large numbers of servers. Consider using one of the SPs with more limited scope, like Report.ADAcctsInSQLByID, Report.ADAcctsInSQLByServerName, or Report.ADAcctsInSQLBySLA.
Parameters: None.
Example execution:
CREATE TABLE #results (
ExecutionDateTime datetime
, ServerName varchar(100)
, SQLAcctInstanceID int
, ADAcctGroupName nvarchar(400)
, ADAcctObjectName nvarchar(400)
, ADAcctIsGroup bit
, ADAcctGroupMember varchar(100)
, ADAcctLastLogon datetime
, ADAcctBadLogonCount bigint
, ADAcctPasswordNeverExpires bit
, ADAcctPasswordNotRequired bit
, ADAcctPermittedLogonTimes varchar(1000)
, ADAcctPermittedWorkstations varchar(max)
, ADAcctLastPasswordSet datetime
, ADAcctLastBadPasswordAttempt nchar(20 )
, ADAcctUserCannotChangePassword nchar(20 )
, ADAcctDescription nvarchar(max)
, ADAcctDelegationPermitted bit
, ADAcctAccountExpirationDate datetime
, ADAcctAccountLockoutTime datetime
, ADAcctEmailAddress nvarchar(1000)
, ADAcctEnabled bit
, ADAcctEmployeeID nvarchar(400)
, ADAcctVoiceTelephoneNumber varchar(100)
, ADAcctDistinguishedName nvarchar(4000)
, ADAcctDisplayName nvarchar(4000)
, ADAcctSurName nvarchar(200)
, ADAcctMiddleName nvarchar(200)
, ADAcctGivenName nvarchar(200)
, ADAcctName nvarchar(400)
, ADAcctGUID varchar(200)
, ADAcctSID varchar(200)
, ADAcctSmartcardLogonRequired nchar(20)
, ADAcctHomeDirectory nvarchar(4000)
, ADAcctHomeDrive nvarchar(4000)
, ADAcctAllowReversiblePasswordEncryption bit
, SQLAcctSID varbinary (85)
, SQLAcctstatus smallint
, SQLAcctcreatedate datetime
, SQLAcctupdatedate datetime
, SQLAcctaccdate datetime
, SQLAccttotcpu int
, SQLAccttotio int
, SQLAcctspacelimit int
, SQLAccttimelimit int
, SQLAcctresultlimit int
, SQLAcctname sysname
, SQLAcctdbname sysname
, SQLAcctpassword varbinary (max)
, SQLAcctlanguage sysname
, SQLAcctdenylogin int
, SQLAccthasaccess int
, SQLAcctisntname int
, SQLAcctisntgroup int
, SQLAcctisntuser int
, SQLAcctsysadmin int
, SQLAcctsecurityadmin int
, SQLAcctserveradmin int
, SQLAcctsetupadmin int
, SQLAcctprocessadmin int
, SQLAcctdiskadmin int
, SQLAcctdbcreator int
, SQLAcctbulkadmin int
, SQLAcctloginname sysname
, SQLAcctBadPasswordCount int
, SQLAcctBadPasswordTime datetime
, SQLAcctHistoryLength datetime
, SQLAcctPasswordLastSetTime datetime
, SQLAcctPasswordHash varchar(50)
, SQLAcctLoginType varchar(50)
, SQLAcctDateLastModified datetime
, SQLAcctIsDisabled bit
, SQLAcctIsLocked bit
, SQLAcctIsPasswordExpired bit
, SQLAcctIsSystemObject bit
, SQLAcctLanguageAlias varchar(50)
, SQLAcctMustChangePassword bit
, SQLAcctPasswordExpirationEnabled bit
, SQLAcctPasswordPolicyEnforced bit
, SQLAcctState varchar(50)
, SQLAcctWindowsLoginAccessType varchar(50)
, SQLAcctDefaultDatabase varchar(400)
, MoreInfo varchar(250)
);
INSERT INTO #results
EXEC Report.ADAcctsInSQLAll;