.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

T-SQL - Creating a Local User On Windows OS

Posted By: Anusha     Posted Date: November 11, 2009    Points:2   Category :Sql Server
Hi,

My requirement is that I need to create a local user on my System (On my Windows OS) using T-SQL. And I need to set this user under 'Administrators' group.

Using this local user I should be able to login to my Windows OS (At System Startup).

Is it possible? If so may I know how could we do this?

Many Thanks,

Regards.
Anusha.

Responses
Author: Amit Mehra             
Posted Date: November 11, 2009     Points: 5   

Hi,

I guess you can do that using AddUser.exe its windows shell use to create user and the syntax is

AddUsers {/c|/d{:u}|/e} filename [/s:x] [/?] [\\computername|domainname] [/p:{l|c|e|d}]


Now to execute command shell using T-SQl you can read this article

EXEC xp_cmdshell 'dir *.exe';


http://msdn.microsoft.com/en-us/library/ms175046.aspx

Thanks
Amit

Thanks,
Amit
Please "Mark As Answer " if this post help you.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend