Click here to Skip to main content
15,890,336 members
Everything / Directory

Directory

directory

Great Reads

by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
by Abhijit Shiposkar
Accessing Active Directory Objects via C# (Visual Studio)
by Gil Fink
This tip explains how to perform queries against Active Directory Domain Services

Latest Articles

by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
by Sundeep Kamath
How Resources in Azure can be accessed programmatically using Azure Resource Manager (ARM) APIs
by Sandeep S. Sandhu
Deploy Kerberos on a Raspberry Pi IoT to provide robust and enterprise scalable authentication for IoTs (Part 2)

All Articles

Sort by Updated

Directory 

3 Apr 2011 by #realJSOP
The most glaring problem I see is that in your call to the DirectoryEntry constructor, the string parameter has an invalid space in it, namely:"LDAP:// MyDomain"It should be:"LDAP://MyDomain"Second, you may be missing some parameters inside the string. I recommend that you...
17 Aug 2011 by #realJSOP
You could try checking the DirectoryEntry.SchemaClassName. Users are indicated with a class name of "User". I don't know what the others are (but you should be able to find them on google).
21 May 2013 by _Amy
Validating the client using Lightweight Directory Access Protocol (LDAP)
4 Jun 2012 by a.4j4vv1
I need get a list of Whencreate object and user in ldap with C#,in this code i cat list, all of user in ldap but i need get Whencreate option all of user and object.Code://ActiveDirectorySearch1//Displays all computer names in an Active Directoryusing System;using...
14 Sep 2010 by aayu
private DirectoryEntry entry; entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName, oPassword, System.DirectoryServices.AuthenticationTypes.Secure);private DirectorySearcher ds;entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName, ...
9 Feb 2011 by Abhijit Shiposkar
Accessing Active Directory Objects via C# (Visual Studio)
30 Apr 2011 by Abhinav S
Try putting @ before your text string paths.
6 Apr 2014 by Abhinav S
You can try the FAR tool[^].You might find other tools when you do a search on the internet.Note: I have never used it myself so I don't know if there are any implications.
30 Jun 2010 by Abhishek Sur
Yes, you cant use "Auth_User" or Logon_User to get the appropriate username. You need to search using DirectoryServices.Check this link :http://forums.asp.net/t/1066136.aspx[^]I think this is what exactly you are looking for. :rose:
11 Dec 2018 by Afzaal Ahmad Zeeshan
Quote: I need to search one directory (c:\K_txt) of almost 3,000 .txt files Searching this on the fly is a really very bad idea, and would have to make your users wait each time they make a change in the query. A good approach would be to read your files once, and create tokens (words, in...
19 Feb 2010 by Alaric Dailey
Theoretically its possible, you could connect over an exposed port (preferably over SSL) to query it. But there are better solutions out there.OpenID, OAuth, and WCF authenticationDotNetOpenAuth implements OpenID and OAuth for .NET
22 Oct 2012 by Alchemist2889
Hello Everyone,I installed ADFS 2.0 on my machine (Windows Server R2 SP1) but I wasn't able to start the ADFS service due to some issues (its an entirely different topic). I tried to uninstall it and then install it again, For uninstalling I used the process provided at this link...
16 May 2012 by aLcoHolicDevil
Some times when i run my application it doesnt get users from ActiveDirectory,now basic i have done i wanted to know how to get propertys like user is denied to read or write to certain group....My app is in C#Thaks
16 May 2012 by aLcoHolicDevil
I have gone through both articals before also but i was unable to find an answer.
19 Jun 2012 by aLcoHolicDevil
HiI am creating an application which will get all the users from active directory. Right now i am done with normal users from group. But i am not able to fetch subgroups of a group.How do i query that??A little help will be usefullThank You Kunal Shah
3 May 2010 by alessandro.campagna
Hi All, I got a Login page, using the .net login control that work correctly on my intranet network.
21 Dec 2010 by Amit Kumar Tiwari
I am not a Java developer though please have a look at these links below, they might help you:http://www.javabeat.net/tips/19-recursively-traversing-files-and-folders-usin.html[^]
8 Mar 2011 by Amit Kumar Tiwari
Please try code below:/// /// Gets the Visual Studio 2008 installation directory path. /// /// Visual Studio 2008 installation directory path public static string GetVS9InstallDirectory() { ...
14 Jul 2013 by amitesh1989
hi i search lot on this but i didn't get any solution so i thought i should ask here my question is quite different i have a grid-view in which i have an image button to delete departmentNow according to my application when i create department a folder with that department name will create...
29 May 2013 by amitghorpade29
Hi,I want get all user from particular security group. This Group present in Active directory.I want filter condition for this and also I need C sharp code to do it same.I am trying following Filter criteria:(&(objectCategory=group)(SAMAccountName=" + txtusername.Text +...
7 Nov 2011 by Andrew Brock
Depending on what you are wanting to do, a shell extension[^] may be the best thing. This will integrate your code directly into Windows Explorer, and allow you to do things such as add a toolbar or a column to the file view.If you just want to know what they are looking at, without changing...
12 Mar 2013 by anoble1
Hi,I am looking for a sample program that can grab a users information. I have acquired the Active Directory string. See below: Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As String) As String Try**** ' Dim sPath As String =...
3 Jun 2011 by Anshul R
Use the Shell or its equivalent and execute this : net user "[username]" *Replace [username] with the actual username.Then use SendKeys.SendWait to send the new password, send a return, password again and return.
16 Jun 2012 by Anubhava Dimri
I think this article will help you.Howto: (Almost) Everything In Active Directory via C#[^]
8 Mar 2011 by Apfelmuuus
I use msbuild to build some projects and have to invoke msdev.exe (Visual Studio 6) to build older projects. Since there is a need to use the msbuild-project on different computers I have to get the installdirectory of Visual Studio 6 each or something else.Thanks in advance for any help.
8 Mar 2011 by Apfelmuuus
All right I got it!I just changed.RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS"); vsInstallationPath = regKey.GetValue("ProductDir").ToString();to:RegistryKey regKey =...
11 Oct 2013 by ASP.NET Community
ASP.NET 2.0 uses a new set of predefind Directory names for special work. In general, the ASP.NET directory structure can be determined by the
11 Oct 2013 by ASP.NET Community
This is how to to list the files in a specific directory and allow the user to download the files.ASPX:
11 Oct 2013 by ASP.NET Community
The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level and
21 Mar 2013 by BackyardHackMechanic
This article describes how to get the real lastlogon datetime from an user from Active Directory and how to use custom Active Directory attributes.
16 Jun 2012 by barneyman
use IIS Integrated Authentication[^] to handle the login process if you want to use AD credentials; you can't read passwords from AD, only confirm themUse a single login to address the SQL server, have functionality determined by the Page.User[^] property to work out who's asking
18 Jul 2012 by barneyman
(objectClass=U...
11 Dec 2014 by BillWoodruff
// required in addition to other 'using necessaryusing System.Diagnostics;using System.IO;private void OpenFolder(string folderPath){ if (Directory.Exists(folderPath)) { ProcessStartInfo startInfo = new ProcessStartInfo { Arguments =...
12 Aug 2023 by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
21 Jul 2014 by Brad Joss
Search for files and folders and don't exit the search when there is an error accessing a protected folder, just skip it.
19 Feb 2015 by Brinda Lakhani
I am developing a window application of screen capturing for my company use. I want to capture the screen shoots and store those screen shots automatically in lock folder by programming. And after storing, i want to upload those screen shots on my company's server from that lock folder. so, I...
13 Apr 2010 by BryanMac789
Hi all, I am trying to retrieve the "Modified" date attribute from active directory using c#. In the ADUC snap-in GUI application this property is located in the "object" tab. I am using a Directory Search to retrieve the user records, where by "currentUser" below is declared as a...
18 Apr 2010 by BryanMac789
Hi all,Worked out, with the help of the links Rod provided, what the problem was with the "WhenChanged" property. I noticed that the date and time of this property was different when accessing programatically than from the ADUC Snap-in GUI. Basically what was happening was any object...
4 Apr 2013 by Canafunk
I am looking to implement Automatic Active Directory Logon to one of our intranet Applications. Groups and information needs to extracted from Active Directory The app was coded in CodeCharge Studio 4.3 so I am unable to open of export the project to Visual Studio (Witch in itself is a...
28 Aug 2012 by cell-in
The names of the files's markers in appropriate folders that have .csv addition, should move.i have one folder. C:\\Week My folder includes 2 folders like A and B.C:\\Week\\A C:\\Week\\B And each folder includes a lot of folders. C:\\Week\\A\\abc And "abc" folder...
28 Aug 2012 by cell-in
Thank you and i know this command.if my file name is Selin. I need to move folder of Selin.if my file name is x . I need to move folder of x.But i have a lot of folder and file. I have to use loop. Please check my code. public static void fileMove(string folder) { ...
30 Apr 2011 by cheekycroak
Dear all..before i give up after multiple trial and error attempts,can someone please help me with below query.I am trying to replace the path name D:\Downloads\Music\ (note the slash) to http://mysite.com/Music/ in mysql field name called "filename" under "songlist" table.Below is the...
11 Dec 2018 by CHill60
You could adapt the technique used in this CodeProject article File Searcher in C#[^] or this one WinSearchFile: how to search files on your PC[^] Or the techniques discussed here .net - c# Fastest string search in all files - Stack Overflow[^]
6 Feb 2022 by Choroid
There are some great answers here. I though I would add additional method to do both a Move and Copy a file to a new location. Private Sub btnCopyFile_Click(sender As Object, e As EventArgs) Handles btnCopyFile.Click 'Be sure to...
6 Jan 2011 by chris.noga
Hi Everyone,I'm working on a program that needs to read a list of PC's from Active Directory a few levels down in the OU structure.The AD path I would need to access is this:company.com - Divison1 - Site1 - ComputersDivision 1, Site1 and Computers are all OUs.Problem is any...
21 Dec 2010 by cjrowell74
Ok so this whole Java thing is a still new to me and I am trying to learn it by building myself something to list all the folders and subfolders i have in my music collection (this is a lot)I have the following code done so far and it loops through and lists the top level repeatly about 10...
26 Jun 2012 by Clifford Nelson
You can get the directory size with linq:string path1 = @"C:\Users\cnelson\Documents\Visual Studio 2010\Projects\ConsoleApplication2\ConsoleApplication2";var dir = new DirectoryInfo(path1);long totalsize = dir.GetFiles().Sum(file => file.Length);or do it the old way:string...
26 Jun 2018 by Clifford Nelson
I have been using ManagementClass to create shares, and they can be seen in with the "net share" command line and by using the computer's IP's address in Windows Explorer. The problem is if you look at the properties of the folder that is being shared you do not see the sharing information in...
19 Jan 2012 by Cool Cassis
You can use the GPRsop class which ships with GPMC/RSAT.Simply add a reference to the Microsoft.GroupPolicy.dll.Here's a link to MSDN:http://msdn.microsoft.com/en-us/library/microsoft.grouppolicy.gprsop_members(v=vs.85).aspx[^]Otherwise you must use the WMI root\RSOP...
1 May 2011 by Costica U
Shouldn't be single quote(') instead of double quote(")?
13 Mar 2011 by CPallini
programming nerd wrote Directory::GetDirectories("D:\\")This method is for managed code. If you are indeed using CLI/C++ the have a look at the documentation provided code sample: DirectoryInfo.GetDirectories[^].On the other hand, if you're writing native code then check out, as Hans...
11 Dec 2014 by DamithSL
you can try by executing run command as below System.Diagnostics.Process process = new System.Diagnostics.Process();System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();startInfo.WindowStyle =...
20 Jun 2011 by dasblinkenlight
I do not think that there is a direct way to get to this information. We used to work around this problem by participating in AD's RPC Replication, and storing the history in the database. Essentially, our program periodically polled the actual AD for the "deltas", filtered out the changes that...
6 Jan 2011 by Dave Kreskowiak
In all of those examples, they all connect to a domain controller with a path something like: 'LDAP://DC=fabrikam,DC=com'. You should just have to be more specific and expand that path to include the OU path: 'LDAP://OU=someContainer,DC=fabrikam,DC=com'. Note, using a path like this limits...
25 Jul 2011 by Dave Kreskowiak
That depends on the server you're talking about and how you have to access it. You kind of left those little, but very important details, out of your question.
6 Jan 2015 by Dave Kreskowiak
You can't do what you want because AD doesn't track the machine the user is physically logged into.Where I work, we use a VBScript that is executed on every workstation, by SCCM and reporting back to SCCM Inventory, who is logged into that machine at the time. Over time, the SCCM database...
16 Jul 2017 by Dave Kreskowiak
Sure, it's possible to create a folder in one of the Temp folders. Moving the application? Why? There's no reason to do that. Also, if your app is installed under Program Files, which it should always be, normal users do not have permissions to MOVE the application files to another folder....
15 Aug 2016 by David Dimalanta
I tried using this[^] tutorial from the App Guruz website to observe and point out the errors on not showing the leaderboard UI. Not only the codes but also the plugins as well. (see this link[^] below for more info) By the way, i'm using Unity, making games. After I succeeded in showing...
28 Apr 2011 by Deepthi Aravind
Syntaxmkdi...
30 Jun 2010 by DeepToot
I seem to be having an issue getting the username of the user visiting my site. This is an intranet site and will be cross domain. What I need to do is authenticate the user in Active Directory. I know how to do this in Active Directory but what I can't do is get the username that I want to...
30 Jun 2010 by DeepToot
Excellent that is what I was looking for!HttpContext.Current.User.Identity.Namewas my missing link. Love the easy fixes.Thank you for the time and response.
23 Oct 2010 by DreamCpp
I am working on a project that involves parsing a bunch of xml files in a customizable folder.For sake of saving you several hundred lines of code...Im using MFC on windows XP to build a dialog app, CString is my primary means of storing string data, all global app settings are in a static...
20 Oct 2010 by Dylan Morley
Possibly have a look herehttp://www-01.ibm.com/support/docview.wss?rs=463&context=SSKTMJ&dc=DB520&dc=DB560&uid=swg21270777&loc=en_US&cs=UTF-8&lang=en&rss=ct463lotu[^]The dominoAccessGroups attribute must be requested specifically from an authenticated user, except when it is added to the...
23 Jul 2010 by E.F. Nijboer
Most of the time the LDAP connection isn't okay. You could always try a public LDAP server for testing the code.http://www.emailman.com/ldap/public.html[^]http://www.keutel.de/directory/public_ldap_servers.html[^]Good luck!
9 Aug 2012 by Eddy Vluggen
There's a list of exceptions that can be thrown in the documentation[^], including their reasons. I suggest you also read the notes below the exceptions, as this would require a specific set-up.
14 Mar 2011 by Emilio Garavaglia
In addiction to other solution, consider also a better design of your classes, or your code will became a mess.a) You use sometimes string (did you mean std::string ??) sometime character arrays, sometime char*. Be consistent!b) Directories should form a hierarchy. How can you do it with...
7 Nov 2011 by epanjohura
http://www.cplusplus.com/[]
11 Mar 2011 by Espen Harlinn
I believe you may find this interesting:http://www.boost.org/doc/libs/1_46_0/libs/filesystem/v3/doc/tutorial.html[^] - it will even work on other os'esYou can also usehttp://www.boost.org/doc/libs/1_46_0/libs/regex/doc/html/index.html[^] to facilitate quite advanced search...
3 Apr 2011 by farzane2009
Hi . Az you know every user that is defined in active directory has FirstName,LastName ,UserLoginName(sAMAccountName),Email,.... now i have FirstName+LastName of any users on my local network and i want to get UserLoginName of any users from server's active directory.what can i do?? and here my...
9 Oct 2011 by Fazlur Rahman
This article describes how to keep form based and active directory user based authentication process in parallel in ASP.NET.
16 Aug 2013 by fjdiewornncalwe
You can try the solution found hereor you can browse through some of the other links here
7 Jun 2011 by funniezatee
Hi,the context is I have a cron job - a script that I have in php. What it does is determine the oldest few folders in a directory and deletesthem. It then also performs an update to the wordpress database.Alone when running from browser URL, it works without any problems. However...
8 Jun 2011 by funniezatee
Hi everyone,I have sort of found my own answer while looking at functions.php filefrom other templates.What worked for me was I shifted any global variables in my external scriptout into the main functions.php file. I also shifted any functions from my script into functions.php....
19 Sep 2012 by Ganesan Senthilvel
Here is the reference code:Set objSysInfo = CreateObject("ADSystemInfo")strComputer = objSysInfo.ComputerNameSet objComputer = GetObject("LDAP://" & strComputer)arrOUs = Split(objComputer.Parent, ",")arrMainOU = Split(arrOUs(0), "=")Wscript.Echo arrMainOU(1)
16 Aug 2013 by gayanee Wijayasekara
i have a web site developed with c#. this site will be hosted in the local intranet of our organization. the users are authenticated from their windows ID using windows authentication. i want to display the picture in the active directory of a user, when a user visits the site.please...
28 Mar 2011 by GedSmith
I have tried to write a vb script to get the folder structure of a directory (and sub folders) and output the structure to excel. I can do it in a list form but would like the directory tree indented in excel so you can see the folder hierarchy.Here is my code so far:Sub...
26 Jul 2010 by Gil Fink
This tip explains how to perform queries against Active Directory Domain Services
1 Aug 2018 by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
15 Jun 2015 by Hamza Dweikat
Hi All ,I am working to develop an asp.net web forms that working on the active directory authentication . we need to make a mix mode of form authentication and windows authentication togetheris there is any special configuration for IIS is this possible to do? Thanks
13 Mar 2011 by Hans Dietrich
Check out MSDN for FindFirstFile() and FindNextFile().To open a file, you can use ShellExecute(). This will open any file that has a recognized/associated extension.
21 Apr 2012 by havens1515
I know this thread is a year old, but I was looking for a similar script. When I found yours, it was close to what I wanted, but I modified it to be able to handle a directory with ANY depth. For some reason, I can't get the file to open correctly at the end, so I just left that part...
28 Apr 2011 by Ir-win ChakadCo
Download the source code -423 KBIntroduction:Today I put a sample program to manage your FTP Perhaps all of you with many programs to work with FTP or have seen much of you need to have transferred the file to the server or servers to receive and manage the server. It can create...
6 Feb 2022 by jameslooi88
I have some problem with copying the files from one Directory to another directory by create the folder if that folder is not exists in destination directory. Example: I have a lot of files in test folder but i only want to copy 1.txt Source path: C:\temp\test\1.txt destination path:...
4 Dec 2013 by Jayesh B
HiNeed help for accessing Microsoft Windows Server 2008 R2's Active Directory Users & computers information through with the help of Java?Thanks in advanceRegards,Jayesh B
19 Aug 2014 by Jinan Kordab
This article describes how to create or delete an Active Directory Services Email using ASP.NET web page, remotely.
18 Oct 2013 by JL_Coder
Hello all. I need to integrate a third party plugin in my asp.net website. To install the plugin, they have mentioned this sentence, "Create an application through your IIS control panel with root directory at -(some path from my website folder)?".I am not much aware with IIS and rarely worked...
2 Oct 2013 by Jochen Arndt
Yes, there is such a function: SHCreateDirectoryEx[^]. To use it you must include shlobj.h and link with shell32.lib.
7 Dec 2011 by Joe Leibowitz
Use PowerShell to Query and Display Data II (Active Directory\LDAP)
10 Sep 2013 by Joezer BH
Use DirectoryInfo's GetDirectories to get a list of directoriesHere's a simple example:// Make a reference to a directory.DirectoryInfo di = new DirectoryInfo(@"c:\");// Get a reference to each directory in that directory.DirectoryInfo[] diArr = di.GetDirectories();// Display...
22 May 2013 by John_Hunter2
I have one custom list with fields like(IDs, Name, Phone no) . when i add a new item to the list a new item form will be opened. While filling the form by entering the first field( IDs), i want other fields to be auto-populate from active directory.Can it be possible through Browser(UI) or...
4 Apr 2011 by Jonathan Cardy
Hi!You don't need to create your own dialog. .NET does this work for you, simply display a OpenFileDialog through which the user can select files to copy. See the documentation for OpenFileDialog...
4 Apr 2013 by José Amílcar Casimiro
Hi,This code:strUser = Page.User.Identity.NameReturns the domain and username of current user.When you make a ldap search like this:adsSearch.Filter = "sAMAccountName=" & strUserYou need to remove the domain name from strUser, because you are already querying the domain.Hope...
30 Aug 2018 by KD209
Hello All, I am trying to create a PS Script that will search AD account with the following conditions: Account is Active/Enabled (account not disabled) Account is expired 90 days or more Account password is not set to never expire or Account password has expired I want the result to return...
24 Jul 2011 by KhanImranKhan
Hello MembersHow to search files in a password procteced folder on a remote machine ? I've the server IP and userid/password to access the folder but how to authenticate programmatically.Thanks
20 Mar 2010 by kingskunal
I am trying to create a directory on ftp server using asp.net (c#)Please reply how to omplement it
1 Mar 2010 by Kristian Sixhøj
Have a look at the FileSystemWatcher[^] component from the toolbox.
22 Oct 2012 by Kuthuparakkal
Follow:http://www.deepakgaikwad.net/index.php/2009/09/24/retrieve-basic-user-attributes-from-active-directory-using-ldap-in-java.html[^]
13 Dec 2015 by Laurie Stearn
The aim is to create a directory. Here are the global decls:typedef NTSTATUS (__stdcall *NTDLLptr)( PHANDLE FileHandle, ACCESS_MASK DesiredAccess, OBJECT_ATTRIBUTES *ObjectAttributes, PIO_STATUS_BLOCK IoStatusBlock, PLARGE_INTEGER AllocationSize, ULONG...