|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Login error when opening a deployed projectbuilt an MSI package using the setup and deployment projects setup wizard. I ran the MSI package on my machine (where I developed the application) to install it and I can run the application just fine. I deployed it on another machine but when I ran the application I get an error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as my startup project and this is the code: Sub Main() Dim currentUser As WindowsIdentity = WindowsIdentity.GetCurrent() AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then Dim switch As New realSwitchboard switch.ShowDialog() Else Dim sales As New realSwitchboardSales sales.ShowDialog() End If End Sub The user belongs in the PMS_Admin group. This is the error message I get: System.Data.SqlClient.SqlException: Login failed for user 'OFFICE\Display Wenzl'. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at PMS.realSwitchboard.FillOptions() at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) I've tried deploying on other machines but I get the same "Login Failed" error. What am I doing wrong? Thanks in advance! Christine I just noticed that if I add the user to the Built In administrators
group, the application works perfectly fine. Obviously I don't want to put every user in the administrators group, so how would I get around this? Thanks, Chris chris wrote: Show quoteHide quote > I've developed a Windows Forms Application in Visual Studio 2003. I > built an MSI package using the setup and deployment projects setup > wizard. I ran the MSI package on my machine (where I developed the > application) to install it and I can run the application just fine. I > deployed it on another machine but when I ran the application I get an > error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as > my startup project and this is the code: > > Sub Main() > Dim currentUser As WindowsIdentity = > WindowsIdentity.GetCurrent() > > AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) > If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or > (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then > Dim switch As New realSwitchboard > switch.ShowDialog() > > Else > Dim sales As New realSwitchboardSales > sales.ShowDialog() > End If > End Sub > > The user belongs in the PMS_Admin group. This is the error message I > get: > > System.Data.SqlClient.SqlException: Login failed for user > 'OFFICE\Display Wenzl'. > at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& > isInTransaction) > at > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString > options, Boolean& isInTransaction) > at System.Data.SqlClient.SqlConnection.Open() > at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection > connection, ConnectionState& originalState) > at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, > Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand > command, CommandBehavior behavior) > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, > CommandBehavior behavior) > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) > at PMS.realSwitchboard.FillOptions() > at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs > e) > at System.Windows.Forms.Form.OnLoad(EventArgs e) > at System.Windows.Forms.Form.OnCreateControl() > at System.Windows.Forms.Control.CreateControl(Boolean > fIgnoreVisible) > at System.Windows.Forms.Control.CreateControl() > at System.Windows.Forms.Control.WmShowWindow(Message& m) > at System.Windows.Forms.Control.WndProc(Message& m) > at System.Windows.Forms.ScrollableControl.WndProc(Message& m) > at System.Windows.Forms.ContainerControl.WndProc(Message& m) > at System.Windows.Forms.Form.WmShowWindow(Message& m) > at System.Windows.Forms.Form.WndProc(Message& m) > at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) > at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > msg, IntPtr wparam, IntPtr lparam) > > I've tried deploying on other machines but I get the same "Login > Failed" error. What am I doing wrong? > > Thanks in advance! > > Christine You should use SQL Authentication instead of Windows Authentication.
If you keep to Windows Authentication; you could include the Domain Users as allowed users, but I would without shaddow of a doubt go for the Sql Authentication solution. -- Show quoteHide quotergds. /Claus Konrad MCSD.NET (C#) "chris" wrote: > I just noticed that if I add the user to the Built In administrators > group, the application works perfectly fine. Obviously I don't want to > put every user in the administrators group, so how would I get around > this? > Thanks, > Chris > > chris wrote: > > I've developed a Windows Forms Application in Visual Studio 2003. I > > built an MSI package using the setup and deployment projects setup > > wizard. I ran the MSI package on my machine (where I developed the > > application) to install it and I can run the application just fine. I > > deployed it on another machine but when I ran the application I get an > > error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as > > my startup project and this is the code: > > > > Sub Main() > > Dim currentUser As WindowsIdentity = > > WindowsIdentity.GetCurrent() > > > > AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) > > If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or > > (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then > > Dim switch As New realSwitchboard > > switch.ShowDialog() > > > > Else > > Dim sales As New realSwitchboardSales > > sales.ShowDialog() > > End If > > End Sub > > > > The user belongs in the PMS_Admin group. This is the error message I > > get: > > > > System.Data.SqlClient.SqlException: Login failed for user > > 'OFFICE\Display Wenzl'. > > at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& > > isInTransaction) > > at > > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString > > options, Boolean& isInTransaction) > > at System.Data.SqlClient.SqlConnection.Open() > > at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection > > connection, ConnectionState& originalState) > > at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, > > Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand > > command, CommandBehavior behavior) > > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 > > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, > > CommandBehavior behavior) > > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) > > at PMS.realSwitchboard.FillOptions() > > at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs > > e) > > at System.Windows.Forms.Form.OnLoad(EventArgs e) > > at System.Windows.Forms.Form.OnCreateControl() > > at System.Windows.Forms.Control.CreateControl(Boolean > > fIgnoreVisible) > > at System.Windows.Forms.Control.CreateControl() > > at System.Windows.Forms.Control.WmShowWindow(Message& m) > > at System.Windows.Forms.Control.WndProc(Message& m) > > at System.Windows.Forms.ScrollableControl.WndProc(Message& m) > > at System.Windows.Forms.ContainerControl.WndProc(Message& m) > > at System.Windows.Forms.Form.WmShowWindow(Message& m) > > at System.Windows.Forms.Form.WndProc(Message& m) > > at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) > > at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) > > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > > msg, IntPtr wparam, IntPtr lparam) > > > > I've tried deploying on other machines but I get the same "Login > > Failed" error. What am I doing wrong? > > > > Thanks in advance! > > > > Christine > > I am using Trusted_Connection = True, I don't know if that's the same
as Integrated Security = True. However I took your advice and am using SQL authentication instead and it works fine now. Thank you! Claus wrote: Show quoteHide quote > You should use SQL Authentication instead of Windows Authentication. > If you keep to Windows Authentication; you could include the Domain Users as > allowed users, but I would without shaddow of a doubt go for the Sql > Authentication solution. > -- > rgds. > /Claus Konrad > MCSD.NET (C#) > > > "chris" wrote: > > > I just noticed that if I add the user to the Built In administrators > > group, the application works perfectly fine. Obviously I don't want to > > put every user in the administrators group, so how would I get around > > this? > > Thanks, > > Chris > > > > chris wrote: > > > I've developed a Windows Forms Application in Visual Studio 2003. I > > > built an MSI package using the setup and deployment projects setup > > > wizard. I ran the MSI package on my machine (where I developed the > > > application) to install it and I can run the application just fine. I > > > deployed it on another machine but when I ran the application I get an > > > error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as > > > my startup project and this is the code: > > > > > > Sub Main() > > > Dim currentUser As WindowsIdentity = > > > WindowsIdentity.GetCurrent() > > > > > > AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) > > > If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or > > > (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then > > > Dim switch As New realSwitchboard > > > switch.ShowDialog() > > > > > > Else > > > Dim sales As New realSwitchboardSales > > > sales.ShowDialog() > > > End If > > > End Sub > > > > > > The user belongs in the PMS_Admin group. This is the error message I > > > get: > > > > > > System.Data.SqlClient.SqlException: Login failed for user > > > 'OFFICE\Display Wenzl'. > > > at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& > > > isInTransaction) > > > at > > > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString > > > options, Boolean& isInTransaction) > > > at System.Data.SqlClient.SqlConnection.Open() > > > at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection > > > connection, ConnectionState& originalState) > > > at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, > > > Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand > > > command, CommandBehavior behavior) > > > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 > > > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, > > > CommandBehavior behavior) > > > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) > > > at PMS.realSwitchboard.FillOptions() > > > at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs > > > e) > > > at System.Windows.Forms.Form.OnLoad(EventArgs e) > > > at System.Windows.Forms.Form.OnCreateControl() > > > at System.Windows.Forms.Control.CreateControl(Boolean > > > fIgnoreVisible) > > > at System.Windows.Forms.Control.CreateControl() > > > at System.Windows.Forms.Control.WmShowWindow(Message& m) > > > at System.Windows.Forms.Control.WndProc(Message& m) > > > at System.Windows.Forms.ScrollableControl.WndProc(Message& m) > > > at System.Windows.Forms.ContainerControl.WndProc(Message& m) > > > at System.Windows.Forms.Form.WmShowWindow(Message& m) > > > at System.Windows.Forms.Form.WndProc(Message& m) > > > at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) > > > at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) > > > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > > > msg, IntPtr wparam, IntPtr lparam) > > > > > > I've tried deploying on other machines but I get the same "Login > > > Failed" error. What am I doing wrong? > > > > > > Thanks in advance! > > > > > > Christine > > > > From the exception (sqlException), it is implied that you are most likely
using a connectionstring with 'Integrated Security = true'? Am I correct? If yes - the current user ('OFFICE\Display Wenzl') is not allowed access to the database. It is a Sql database login error you are seeing. -- Show quoteHide quotergds. /Claus Konrad MCSD.NET (C#) "chris" wrote: > I've developed a Windows Forms Application in Visual Studio 2003. I > built an MSI package using the setup and deployment projects setup > wizard. I ran the MSI package on my machine (where I developed the > application) to install it and I can run the application just fine. I > deployed it on another machine but when I ran the application I get an > error: Login Failed for user OFFICE\Display Wenzl. I have Sub Main as > my startup project and this is the code: > > Sub Main() > Dim currentUser As WindowsIdentity = > WindowsIdentity.GetCurrent() > > AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal) > If (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Admin")) Or > (Thread.CurrentPrincipal.IsInRole("OFFICE\PMS_Users")) Then > Dim switch As New realSwitchboard > switch.ShowDialog() > > Else > Dim sales As New realSwitchboardSales > sales.ShowDialog() > End If > End Sub > > The user belongs in the PMS_Admin group. This is the error message I > get: > > System.Data.SqlClient.SqlException: Login failed for user > 'OFFICE\Display Wenzl'. > at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& > isInTransaction) > at > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString > options, Boolean& isInTransaction) > at System.Data.SqlClient.SqlConnection.Open() > at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection > connection, ConnectionState& originalState) > at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, > Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand > command, CommandBehavior behavior) > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, > CommandBehavior behavior) > at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) > at PMS.realSwitchboard.FillOptions() > at PMS.realSwitchboard.realSwitchboard_Load(Object sender, EventArgs > e) > at System.Windows.Forms.Form.OnLoad(EventArgs e) > at System.Windows.Forms.Form.OnCreateControl() > at System.Windows.Forms.Control.CreateControl(Boolean > fIgnoreVisible) > at System.Windows.Forms.Control.CreateControl() > at System.Windows.Forms.Control.WmShowWindow(Message& m) > at System.Windows.Forms.Control.WndProc(Message& m) > at System.Windows.Forms.ScrollableControl.WndProc(Message& m) > at System.Windows.Forms.ContainerControl.WndProc(Message& m) > at System.Windows.Forms.Form.WmShowWindow(Message& m) > at System.Windows.Forms.Form.WndProc(Message& m) > at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) > at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > msg, IntPtr wparam, IntPtr lparam) > > I've tried deploying on other machines but I get the same "Login > Failed" error. What am I doing wrong? > > Thanks in advance! > > Christine > >
accessing emails using owa ... traceable?
Unhandled exception vs handled (security issue) Kerberos Token Renewal Forms Authentication with Active Directory, login control crashes Impersonation testing Is there a function that I can call to validate a domain? Security Exception Help!! InvalidOperationException in GetProcessesByName!! Can I retrieve Unix box OS info using DirectoryEntry Property OS? Is all .NET assembles are vulnerable to decompilation ? |
|||||||||||||||||||||||