Process in C# with Windows Service Account

Hi,
   I would like to launch SQL Server Management Studio from C# Process Class thru windows service account. When I start the process, I got the in Win32Exception ( “Logon failure: unknown user name or bad password”). I verified the User credentials
as well. Please let me if you have any idea on this issue.
Code:
private
void cmdSqlServer2012_Click(object sender,
EventArgs e)
Process objProcess =
null;
ProcessStartInfo objProcessStart =
null;
string strSqlServer =
@"C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe";
//string strSqlServer = "ssms.exe";
string strUserID = ConfigurationManager.AppSettings["UserID"];
string strUserPwd = ConfigurationManager.AppSettings["Password"];
try
                objProcess =
new Process();
                objProcess.StartInfo.LoadUserProfile =
false;
                objProcess.StartInfo.FileName = strSqlServer;
                objProcess.StartInfo.UseShellExecute =
false;
                objProcess.StartInfo.UserName =
"Senthil.Krishnamoort";
                objProcess.StartInfo.Domain =
"Services";
                objProcess.StartInfo.Password = ConvertToSecureString(strUserPwd);
objProcess.Start();
catch (Win32Exception w32E)
// The process didn't start.
MessageBox.Show(w32E.Message);
catch (Exception ex)
MessageBox.Show(ex.Message);
finally
                objProcess.Dispose();
                objProcess =
null;
public static
SecureString ConvertToSecureString(string password)
if (password == null)
throw new
ArgumentNullException("password");
SecureString secureString =
new SecureString();
foreach (char ch
in password)
                secureString.AppendChar(ch);
            secureString.MakeReadOnly();
return secureString;

Hi
Krish0609,
Firstly please try do the following steps
Service____rightclik___Propertise___Logon___allow service  to interact with desktop.
Secondly, from your code,  I would suggest you used
ProcessStartInfo.Arguments
Property
to  sets the set of command-line arguments to use when starting the application.
objProcess.StartInfo.Password = ConvertToSecureString(strUserPwd);
I doubt this issue maybe you have converted to secure string.
By the way, here is how to use SSMS command line.
Usage:
sqlwb.exe [-S server_name[\instance_name]] [-d database] [-U user] [-P password] [-E] [file_name[, file_name]] [/?]
[-S The name of the SQL Server instance to which to connect]
[-d The name of the SQL Server database to which to connect]
[-E] Use Windows Authentication to login to SQL Server
[-U The name of the SQL Server login with which to connect]
[-P The password associated with the login]
[file_name[, file_name]] names of files to load
[-nosplash] Supress splash screen
[/?] Displays this usage information
Please also refer to Bruce Prang's Blog
to learn more.
Best regards,
kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Not able to login with window AD account

    Hi,
    I did all the necessary configuration for windows AD in cmc,
    Here are the steps,
    I did the following configuration to set up the WINDOWS AD,
    1.Configured  the service account for use with the AD plug in.
    a)Created the service principal name (SPN) for service account
    b)Set delegation for the service account.
    2.configured the BI Plateform for use with  the service account
    a)Add SPN to the CMC.
    b)Set the  SIA to run as the service account
                    c) verified that service account and windows AD login  account is
                    working checked that no error message appeared and could see white screen
    I tried login with my AD account credential in to CMC but shows error showing "not authorized to login"
    can any1 please help
    Thanks,
    pavana

    Ambarish,
    is this the Kerberos configuration file, I need to set up
    [libdefaults]
    default_realm = DOMAIN.COM
    dns_lookup_kdc = true
    dns_lookup_realm = true
    default_tkt_enctypes = rc4-hmac
    default_tgs_enctypes = rc4-hmac
    [domain_realm]
    .domain.com = DOMAIN.COM
    domain.com = DOMAIN.COM
    .domain2.com = DOMAIN2.COM
    domain2.com = DOMAIN2.COM
    [realms]
    DOMAIN.COM = {
    default_domain = DOMAIN.COM
    kdc = HOSTNAME.DOMAIN.COM
    DOMAIN2.COM = {
    default_domain = DOMAIN2.COM
    kdc = HOSTNAME.DOMAIN2.COM
    [capaths]
    DOMAIN2.COM = {
    DOMAIN.COM =

  • Unable to start Oracle Process Manager from the windows services for OBIEE

    Hi,
    I have OBIEE 11g installed on a 32-bit windows machine. Of the two windows services installed, I am unable to start the Oracle Process Manager. When I try to start it I get the following error:
    Error 1053: The service did not respond to the start or control request  in a timely fashion.
    At the back end, this service is calling the file opmn.exe which is placed at MIDDLEWAREHOME\Oracle_BI1\opmn\bin. On trying to execute this file the error we get is:
    The procedure entry point longjmp could not be located in the dynamic link library orauts.dll
    I have tried replacing the orauts.dll file, but to no avail.
    Please let me know if you have any clue regarding what is to be done.
    Thanks
    Naman

    Hi Naman,
    This error occurs for the following reasons,
    *Path variable is not set properly
    *Multiple Oracle homes exists in the same machine.
    Follow the below steps and let me know if it works,
    1. Select My Computer -> Right Click -> Properties
    2. In the System Properties screen go to Advanced Tab
    3. Click on Environment Variables
    4. In the System Variables section select PATH variable & Click edit
    5. Now you will find that it will contain invalid directories. Remove the incorrect entries. This may happen when you have multiple oracle homes in the same machine
    6. Restart the service.
    Rgds,
    Dpka

  • Can't do anything with Windows 7 Account

    Hello, I have an old test account called Administrator, it is an administrator account and I can't seem to do anything with it, when I go to Control Panel and Manage Users there is no Delete Account button. I tried going to Start and typed netplwiz and
    tried to remove the account their and it wont let me have access to, I even tried switching it from Administrator to Standard and it still won't let me have access to do that. I even tried it in safe mode. I was logged into the original administrator account
    I always used, not in the one I was trying to delete.

    Hi,
    You mentioned that you can't do anything with this old account, For this account, can you log into it? we can do a test to check whether this account has "real" admin privilege, try to open device manager, see if you are prompted a warnning message. or just
    run lusrmgr.msc and view the user account list in your system.
    Another situation is that the old account profile is corrupted, if you want to fix it, try this link:
    http://windows.microsoft.com/en-in/windows/fix-corrupted-user-profile#1TC=windows-7
    And from your description, seems you want to delete it with another admin account but failed, could you please tell us the error message prompted when you delete? or check the Event viewer.
    Yolanda Zhu
    TechNet Community Support

  • Airport extreme with windows service pack 2

    I have just recently bought a macbook pro laptop, & have been corresponding with a forum member about a wireless setup.
    I want to have a wireless set up with a PC desktop with windows xp home service pack 2 that is stationed in the kitchen. This was recommended to me in this forum. Right now the PC has an Ethernet black box, with at&t DSL service. It has one yellow Ethernet cable coming from the black box to the PC & one grey DSL cord coming out of the black box & connects to a phone in the kitchen. I bought the laptop for my online classes so steady reliable internet service is crucial. Upon reading the specs of the airport extreme however got me a little concerned about which service pack I can use.
    Here is my question & comment from another member on this forum;
    I just noticed a PC has to have windows service pack 3, I have service pack 2, will it work with service pack 2? I am reluctant to update to service pack 3, my story behind my reluctance; the last time I did it, my PC completely crashed, the hard drive died. It had to be replaced, & ever since I get a little yellow alert to update to service pack 3, but I have not done it out of fear of another meltdown. Right now it is the only computer in our house, & I need it for my online classes. Last summer when I tried the service pack 3 update, & subsequent PC meltdown, I had to go to a public computer lab to finish off an online class, so I do not want to go through this again.
    And this is what they said;
    +That will give you wired internet access at the PC. Of course, the MacBook Pro will be wireless. I am not sure about the technical specifications required for the Airport. My initial reaction is that you should be fine to use the Airport as just a router with the PC with Service Pack 2. I think SP3 is just required for administration of the Airport using the Airport Utility for Windows. But, you could administer the Airport with your MBP. You may want to confirm this in the Airport forum unless somebody else here knows for sure! Sorry!+

    Which would be more powerful & reliable? the newest airport extreme or the aiport with the 500GB time capsule?
    Again, it will depend on what your networking requirements are. If we are talking about support for Time Machine backups, then only the Time Capsule (of the two options you listed) would work. Apple doesn't currently support these backups to drives attached to the AirPort Extreme Base Station.
    Would I be better off with something that is just for wireless internet? or a combo unit time capsule & airport?
    If you don't have any networking gear now, then it may make better sense to go with a combination unit.

  • Trouble with Windows Service Pack 1 ?

    I am using
    Adobe CreatePDF, and because I am using it with a musical notation software program
    , Finale, I have to use the Adobe Desktop Printer, to convert the file
    s.  This has worked very well for a couple of months but, the other day I attempted to us
    e it and it doesn't work.  I contacted Adobe, through their online chat room and a
    fter trouble shooting my computer, the tech said that the Adobe Desktop Printer does not work
    now with Windows 7, Service Pack 1.  They are working on the problem.  Has this been addressed on the forum yet?  I'm sorry, but I couldn't find it if it has.  Anyone else having this problem.  It's really put me in a bind.  How are we to know when the issue has been addressed?
    Thanks.

    I'm sorry, in the Subject Window, I neglected the "7".  It's Windows 7, Service Pack 1.
    Thanks.

  • Is using a taskbar icon in .exe combined with windows service a good idea as part of an alarm system?

    My client wants an alert system and his focus is on the taskbar.  He wants the icon to change, (and ideally even blink) and also to have some beeping when a new work request comes in.  It needs to run constantly, and grab the attention of an operator
    who may not be paying much attention to the screen.
    I’m excited to develop this, but after years of web development, I feel paralyzed.  I must be making this harder than it needs to be, but here’s my plan…  I'll start with a windows form, which will run minimized, and have an icon that looks like
    a hammer in the taskbar.  A timer would continually check for a new service requests.  When it sees one it would change the toolbar icon to a red x and sent a few dozen beeps out to the operator.  I think I need a windows service running that
    checks periodically to see if my windows exe is running.  If not, it should start it up.  Perhaps this could be a scheduled task, rather than a service.  
    Some of my questions are;
    How do I change the taskbar icon on the fly?
    Is this a good idea, or is there an easier way?
    Snippets of code or related articles are most welcome!
    Thanks!

    So I created a windows form and added a timer to check for unacknowledged requests.  If it finds any, it changes the icon on for the taskbar, and makes a beep.  Simple, but it works.  However, I'm having a beep of a time trying to figure out
    where to put the ico files so they are where they need when I publish it.  Others seem to suggest adding them using the properties of the application, under application / resources / Icon and manigest blah blah blah.  But I can only seem to add one
    there.  I need the three different ones.  I'm confused!  Any suggestions?
            private bool iconBig = true;
            private Icon redcross = new Icon("..\\NewRequest.ico");
            private Icon redcross2 = new Icon("..\\NewRequest2.ico");
            private Icon hammer = new Icon("..\\Hammer.ico");
     private void timer1_Tick(object sender, EventArgs e)
                List<WorkRequest> myWorkRequests = WorkRequestData.WorkRequest_unAcknowledged();
                if (myWorkRequests.Count > 0)
                    for (int i = 0; i < 5; i++)
                        SystemSounds.Beep.Play();
                        if (iconBig == true)
                            iconBig = false;
                            this.Icon = redcross;
                            this.Refresh();
                        else
                            iconBig = true;
                            this.Icon = redcross2;
                            this.Refresh();
                else
                    this.Icon = hammer;
                    this.Refresh();

  • DB not open, with Windows Service

    I have created a new database (10gR2 in W2k3) with the assistant. If I restart the Window's service or restarting the server, the Window's service looks started, but the state real of the DB is close. Then, for go to state open, I'm that execute to startup from sqlplus console. Why not works finely the Windows Service?

    If you feel confident in doing this, open regedit and go here:
    HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/<your oracle installation home name>
    Then check that the following keys are set as shown:
    ORA_<your SID>_AUTOSTART = TRUE
    ORA_<your SID>_SHUTDOWN = TRUE
    ORA_<your SID>_SHUTDOWNTYPE = immediate
    With those settings, your instance should startup and shutdown properly whenever the service is started or stopped. Reboot after any changes are made.

  • Default ZAM 10 Windows Service Accounts

    Hi there,
    My customer's security department did a review and noticed some strangely named service accounts in this Windows 2008 member server running just ZAM 10. They would like to get more info on these accounts but we could find none in the documentation.
    Here is part of the conversation:
    Our security people are questioning some logon accounts used by Novell Zam/ZCM on servers. (See Below). It has proven impossible so far to find definitive info about these accounts possibly due to Google not liking the format of the account name. The account used on the main server is slightly different (.\__z_1_200__). These accounts were created by Zam on install. Any information on them would be greatly appreciated and in particular the rights they require on the server.
    There is a strange local admin user set up <server-name>.
    The account is called _z_1_80_ . Does anyone know what it is?
    It must be created as part of the zcm product that is installed on this server. The server <another-server> also has an account like this and this has zcm installed also.
    Also is a screen shot of the services aplet.
    cheers,
    Kirk

    They are created during the install for using in various ZEN Services.
    There is nothing special about the accounts other than that they are
    local administrators.
    The Services using those accounts can be changed to use another local
    administrators accounts by using the services control panel.
    On 7/21/2010 11:46 AM, kmaule wrote:
    >
    > Hi there,
    >
    > My customer's security department did a review and noticed some
    > strangely named service accounts in this Windows 2008 member server
    > running just ZAM 10. They would like to get more info on these accounts
    > but we could find none in the documentation.
    >
    > Here is part of the conversation:
    >> Our security people are questioning some logon accounts used by Novell
    >> Zam/ZCM on servers. (See Below). It has proven impossible so far to find
    >> definitive info about these accounts possibly due to Google not liking
    >> the format of the account name. The account used on the main server is
    >> slightly different (.\__z_1_200__). These accounts were created by Zam
    >> on install. Any information on them would be greatly appreciated and in
    >> particular the rights they require on the server.
    >>
    >>
    >> There is a strange local admin user set up<server-name>.
    >> The account is called _z_1_80_ . Does anyone know what it is?
    >> It must be created as part of the zcm product that is installed on
    >> this server. The server<another-server> also has an account like this
    >> and this has zcm installed also.
    >
    > Also is a screen shot of the services aplet.
    >
    > cheers,
    > Kirk
    >
    >
    > +----------------------------------------------------------------------+
    > |Filename: ZAM10WindowsServices.jpg |
    > |Download: http://forums.novell.com/attachment....achmentid=4626 |
    > +----------------------------------------------------------------------+
    >
    Craig Wilson - MCNE, MCSE, CCNA
    Novell Knowledge Partner
    Novell does not officially monitor these forums.
    Suggestions/Opinions/Statements made by me are solely my own.
    These thoughts may not be shared by either Novell or any rational human.

  • Query to Find what SQL Server services running, what status and with what service account

    I need to check what SQL Server services are running(engine,agent,IS,AS,RS,browser and Full text) and what is the present status and what service accounts are been used by them on several servers in a single shot.
    Could any one help me in finding a good script for the same.

    I have been looking for the same thing, the issue I am running into is finding the Actual Service Name.  I know this question is old, and I personally do not understand the reply. 
    so Far I have the following:
    DECLARE @ServiceAcount NVARCHAR(128);
    SET @Service = 'No Return Value'
    --MsDtsServer100 (SSIS)
    EXEC master.dbo.xp_regread
    'HKEY_LOCAL_MACHINE',
    'SYSTEM\CurrentControlSet\services\MsDtsServer100',
    'ObjectName',
    @ServiceAccount OUTPUT;
    SELECT @ServiceAccount;
    I am still looking for the correct service naming for Analysis Services, Distributed Replaay Client, Distributed Replay Controller

  • Can't  upgrade I tunes because of problems with Windows Service Pack 2

    My daughter and I got shuffles for Christmas. I am unable to upgrade to the necessary version of I tunes because I do not have SP2. When I try to download the windows service pack 2 my computer crashes. Any suggestions? Are there any ways around this?

    Hi there
    It could be that this particular file has some corruption. It could also simply be that the number of objects in the file is somewhat taxing your PC resources.
    You might try what is outlined in the link below and see if it helps anything.
    Click here to read
    The post you are likely interested in was made by Jayashree and involves tweaking a setting in the Windows Registry.
    Cheers... Rick
    Click here for Adobe Certified Captivate and RoboHelp HTML Training
    Click here for the SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Directory Synchronization with different Service Account Permissions than "Enterprise Admin"

    Hello,
    I would like to ask whether there is a way to install and configure DirSync tool with the account different than Enterprise Admin. Please let me know if there are alternate methods to accomplish that.
    Thanks,
    NerKO

    No.
    This screen will not allow you to continue without Enterprise Admin rights.  Understand however, this account is used for 5 seconds, and not saved anywhere once the wizard completes.
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

  • Make WDS Service account approve pending devices in WINDOWS DEPLOYMENT SERVICES

    Hi Technet and all other people reading this.
    I am at the moment trying to get a Service account(WDSService) to approve pending devices in Windoes Deployment Services on a WDS server.
    I have created a domain called LALALA.dk on a server(DNS is included in the domain), and installed windows deployment services on another server. The Deployment service is setup to prestage devices, and therefore devices needs to be approved before it can
    be deployed.
    My problem is that at the moment, we are using Domain Admin accounts to do the approving and i wish to change that to a service account, made specially for this job which ofc. should have minimum right. Because i have a very hard time understanding
    why i NEED to grant domain admin rights or local admin rights to a person just so that he can approve pending devices. There has to be a way to use a service account to do the job.
    I have done some research and found out that local admin, domain admins and enterprise admins are the only onces that have the permission to approve pending devices, and that a problem for me, when i want a service account to do it for me(Not automatically)
    but a service account that can name and approve devices manually.
    Here is what i have allready tried.
    1. making WDSService run the Windows Deployment Services (service), but this didnt work because it lacks the permissions needed.
    2. I have given the read+write permissions on the remoteinstall folder, even tried with full control.
    3. Delegate control on the OU in active directory, to create computer object, with full write permissions. I also tried with full control. I added both WDSServer$ and the service account(WDSService) on the OU. Still nothing.
    4. I then downloaded subinacl tool, and granted WDSService account permission to start, stop the service, even tried with full control on the Windows Deployment Service(WDSServer as server_name). I get error 1297 something with priviledge missing from the
    service account to perform the actions. So still nothing. Which is really weird when i ran a command i cant remember now, where i could see that the service account had full permission granted to the service, and still was'nt able to start the service.
    5. I then tried to create a script using WDSUTIL, but was not able to grant the service account permissions to perform the action of approving pending devices. And i dont want to use a script everytime i need to approve a device.
    6. Since the local system account is running the Windows Deployment Service , my thought was to join the WDSService account to the built-in NT AUTHORITY/local system or NT AUTHORITY/local service, this seems impossible from what i experienced, unless you
    are super powershell geek i quess you can, so this option didnt get me anywhere as well.
    6. I then created a gpo granting wdsservice account the "log on as a service" policy on the Windows deployment service Server, still nothing works as attended. I still get error 1297.
    7.I tried copying the registry keys (WDSSERVER) from the HKEY_LOCAL_MACHINE hive on the WDS Server, and imported it into my Domain's registry, but could'nt find the service i wanted to grant permissions to in the group policy settings (computer configuration/policies/windows
    settings/security settings/System Services) I then created a registry entry with group policy (computer configuration/policies/windows settings/security settings/registry) to point to (local machine/system/controlset001/services/WDSServer) and granting
    WDSService account full control and deployed the policy to the Deployment server. Nothing happend and i still cant approve pending devices with my service account.
    from my understanding service account where created to maintain small certain tasks or actions with limited permissions, so if comprimised they could only do very little damage, and so that this account can be setup to perform the tasks without any administation
    of the account. So my question is, is it even possible to achieve what i want = granting a service account the permission to perform the action of approving pending devices on a Windows Deployment Server, and if so how ? 
    I am so confused over this and I am really reaching the limits of my understanding of this.
    Help is very much appreciated.
    Henrik Larsen

    Hi ZeR1X,
    The Require Administrator approval is for unknown computers.
    The similar thread:
    WDS - Request administrator approval not working
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/b9088be7-7afe-4e2b-b5fb-4554a92c4a2a/wds-request-administrator-approval-not-working
    More information:
    Windows Deployment Service fails to start with error information of 0x5
    http://support.microsoft.com/kb/2009647
    WDS 3.01 Troubleshooting Guide
    http://technet.microsoft.com/en-us/library/cc754828(v=ws.10).aspx
    I’m glad to be of help to you!
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • About the Service Account related tasks in Process Definition

    Who can explain the function of Service Account Alert/Moved/Changed task in Process Defintion? And when will the task be triggered?I am not very clear about these tasks' function.Thanks!

    Hi,
    I recommend you refer to the following articles:
    http://technet.microsoft.com/en-us/library/bb629601(v=exchg.80).aspx
    Use the Get-AvailabilityConfig cmdlet to retrieve the accounts that are trusted in cross-forest exchange of free/busy information.
    The Get-AvailabilityConfig cmdlet lists the accounts that have permissions to issue proxy availability service requests on an organizational or per-user basis.
    http://technet.microsoft.com/en-us/library/bb125182(v=exchg.141).aspx
    Use the Shell to configure trusted cross-forest availability with a service account
    Hope this helps!
    Thanks.
    Niko Cheng
    TechNet Community Support

  • How Can i sign in without windows live account, only with an usual administrator account????

    Hello guys , im new in the forum and i have this small problem, i want to sign in to windows 8.1 with an usual account , not with windows live account, its okay to sign in with windows live account but im asking because im a little bit
    curious.
    Thank you for the support :D !!!

    Hi Pelopidas
    Please follow the link
    http://www.techrepublic.com/blog/windows-and-office/quick-tip-change-microsoft-live-to-a-local-account-in-windows-81/

Maybe you are looking for

  • My Safari doesn't work properly after installing Lion.  Don't like it, how can I uninstall? (Cloud not worth it)?

    I upgraded ti Lion 10.7.2 for icloud but it's causing other problems with my mac.  My Safari doesn't work properly anymore.  Wishing I didn't upgrade, anyone know how to fix this or do i just have to uninstall?  Thanks,

  • Do you have to purchase Photoshop Elements in addition to Photoshop Lightroom?

    I currently have Photoshop Lightroom 5.  I am attempting to use the stamp option in the sketch filter.  I can't find it in Lightroom.  Upon investigating, I believe that you must use an external editor such as Photoshop Elements.  Is this correct?  D

  • Payment refusal

    Why on earth is it so hard to make a simple payment to Skype.... Or contact with customer service directly?!!! I need to renew my skype number subscription. I have been trying to renew it for the past few days, but won't accept my payment. Tomorrow m

  • Vendor Evaluation in ML81N

    Dear Gurus I need to maintain some additional sub criteria for External Services, since sap standard has only 2 Sub criteria, in ML81N the vendor evaluation TAB Appears over there. My problem is, I can add the additional sub criteria as business requ

  • Can't pick photos from iPhoto as wallpaper

    Hi, The photo picker in System Preferences > Destop & Screen Saver doesn't work for photos in iPhoto anymore. It shows Apple, iPhoto and Folders but there is no content in iPhoto, nothing no Events no albums. And it doesn't seem to be loading (no bea