|
You could pretty easily use LDAP to get the distinguished name of the user and parse it to work out what OU they are in. There is no real automatic way to do it.
Alternatively, do it on AD group membership rather than OU by using Integrated Authentication and then only giving that AD group NTFS read permissions on the site.
|
|
|
|
|
Guys,
How can I access a shared secured folder from code (VB/C#) that will not show the UserName/Password dialogue box?
Thank you
ThaScorpion
|
|
|
|
|
You could impersonate a user using the LogonUser() and ImpersonateLoggedOnUser() api's and then RevertToSelf() once you have finished.
|
|
|
|
|
Great,
Thank you alot, it worked fine
ThaScorpion
|
|
|
|
|
Has anyone had any experience with setting up Impersonation and Constrained Delegation for an ASP.Net WebApp thats accessing Index Server on a different server?
I've setup the WebApp so that it's working fine with Impersonation, and I've set the web server to be allowed to delegate to the Server that Index Server is running on. BUt it's still not working X(
|
|
|
|
|
Suppose I am using an anti-virus/firewall that doesn't have a window service unlike Norton then, obviously the application will not come up unless a user logs in. Is there any virus/hack threat during this time. I am not sure what the window service of Norton does but it is there up before the application comes up. I am sure that the shared folders/drives are accessible across a network even when not logged in. But can virus or hackers do any thing in such a scenario.
|
|
|
|
|
When the machine is running but not logged in, assuming the network connection is available (ie. the connection isn't initiated at login like some wireless connections are), then the machine can be targeted by remote exploitation attacks against any process which is running and in which a vulnerability can be found. A firewall which is only running when the user is logged in is a very bad idea - I must admit I don't know of any that only run when there is a logged on user, however.
|
|
|
|
|
Check out in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
whether any Antivirus Serivces are put in or not. If they are there then they run irrespective of the user logged in or not.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
Applications in that key run at login time, not at boot time. If you boot the machine and do not log in, nothing in that key will run.
As I also said, any AV or Firewall apps that do run at logon time are idiotic.
|
|
|
|
|
Craster wrote: If you boot the machine and do not log in, nothing in that key will run.
This is the situation I have my doubt. How can I make sure that the AV/Firewall is protecting my PC during this vulnerable time?
|
|
|
|
|
One originally written for win9x perhaps?
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
True - but then you'd hope that they would have updated them to run outside of a user context for later OSs.
|
|
|
|
|
How can I make sure that the AV/Firewall is protecting my PC during the time no one is logged in?
|
|
|
|
|
1. Log Off
2. Run port scan from another machine.
3. log On
4. Check Firewall Logs for activity.
|
|
|
|
|
How to make sure console process being started by Windows->Run doesn't show/have its console window?
I tried in .NET using ::ShowWindow(SW_HIDE) on HWND obtained from GetCurrentProcess()->MainWindowHandle.ToPointer()
But there was a flicker as the window first showsup and then gets hidden.
Pls suggest...
Thank you & Regards, Renuka
|
|
|
|
|
If you dont want a Console, dont create a Console app. A Console app will always show
a Console when it starts up.
Use a Windows app instead; you can prevent the main form from showing by setting
its Visible property to false (in designer or in code inside the constructor).
|
|
|
|
|
Supply a ProcessStartInfo to Process.Start with the CreateNoWindow flag set to true . You'll need to also set UseShellExecute to false .
Sorry, I thought you were asking how to start a console application from a .NET program without showing a console. If running from Start/Run, you do indeed need to create a Windows application rather than a console application.
-- modified at 6:42 Wednesday 25th July, 2007
|
|
|
|
|
You can do this by calling ShowWindow() on the console apps main window, to do this you need to get a handle to the window.
Use this function to get a handle to the window (Use this for Windows 9x only as it does not have a GetConsoleWindow() function), see the second code sample on how to show/hide the console window on all versions of windows.
HWND Console::GetConsoleWindow9X() const
{
HWND hWndConsole = NULL;
TCHAR szTempTitle[_MAX_PATH] = {'\0'};
TCHAR szTempOldTitle[_MAX_PATH] = {'\0'};
if(GetConsoleTitle(szTempOldTitle, _MAX_PATH) > 0)
{
WCHAR szBuff[_MAX_PATH] = {'\0'};
GUID obGuid;
CoCreateGuid(&obGuid);
StringFromGUID2(obGuid, szBuff, _MAX_PATH);
wsprintf(szTempTitle, "%ws", szBuff);
SetConsoleTitle(szTempTitle);
Sleep(50);
if((hWndConsole = FindWindow(_T("tty"), szTempTitle)) == NULL)
if((hWndConsole = FindWindow(_T("ConsoleWindowClass"), szTempTitle)) == NULL)
hWndConsole = FindWindow(NULL, szTempTitle);
SetConsoleTitle(szTempOldTitle);
}
return hWndConsole;
}
This second example can be used to show/hide the console window on all OS's, on Windows 9x it will call the function in the first example to get the handle to hide.
void Console::ShowConsoleWindow(bool bHide )
{
HWND hWndConsole = NULL;
#if(_WIN32_WINNT >= 0x0500) // Windows 2000 and later only
hWndConsole = GetConsoleWindow();
#else
hWndConsole = GetConsoleWindow9X();
#endif
ShowWindow(hWndConsole, (bHide) ? SW_SHOW : SW_HIDE);
}
regards,
|
|
|
|
|
Thank you for the kind responses.I call ShowWindow(SW_HIDE) on the MainWindowHandle obtained from Process instance within the Console Process Entry point function (main). The outcome of this is not that clean. First we see a cmd window being launched to start this process and this window gets hidden upon ShowWindow(SW_HIDE) call. Is there a solution to avoid this flicker?
Even calling FreeConsole() had the same impact in the output.
How does windows service run without any cmd window? Can something similar be done for console process by not converting console process itself into service?
I use Windows XP and .NET Framework 2.0
Thanks again & Regards, Renuka
|
|
|
|
|
The problem is that it takes time to perform the hide window, during which the console application window is visible for a brief time.
This is not easy to get around, but as others have suggested another approach would be to use a Windows application with a hidden main window.
Services do not (typcially) interact with the desktop, so have no user interface and no window.
You could convert your console application to a Service, but I would not recommend that unless it has to be a service, I would convert it to a windows application without a UI window.
regards,
|
|
|
|
|
Helloo i recently came to knw abt da anonymous free proxy servers by which one can access da internet free of cost without able to notice our IP adress and download limit.
so my question was is it true that th ISP vendor wont be able to know my download limit.
|
|
|
|
|
Your ISP will still know your download limit as all the traffic will still go through them.
Please refrain from using txt speak, its very annoying
regards,
|
|
|
|
|
kthxbye
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
yr wlcm!
|
|
|
|
|
Hi,
I have a Windows application which actually carries out a file transfer operation from a SCSI device to the local directory.
However during the file transfer and DB updates, the CPU usage shoots up to 100%.
Can anyone help me in optimizing the CPU usage?
Thanks in Advance,
KKrista
|
|
|
|