This post is slightly deviating from my routine SQL scripts. :)
Here is the command to get the list of users present in a local group.
This is command shell script and the results can be directly written to a output file.
To get the list of users from local administrator group, run the below command from the command prompt.
net localgroup Administrators >C:\LocalAdministrators.txt
The same can be executed from SQL server using the xp_cmdshell extended stored procedure.
Here is the command to get the list of users present in a local group.
This is command shell script and the results can be directly written to a output file.
To get the list of users from local administrator group, run the below command from the command prompt.
net localgroup Administrators >C:\LocalAdministrators.txt
The same can be executed from SQL server using the xp_cmdshell extended stored procedure.
EXEC xp_cmdshell 'net localgroup Administrators'