directoryentry

Do I need to replace localhost in the IIS://localhost/MimeMap when reading the Mimemap

I'm reading out the mime types from IIS's MimeMap using the command _mimeTypes = new Dictionary<string, string>(); //load from iis store. DirectoryEntry Path = new DirectoryEntry("IIS://localhost/MimeMap"); PropertyValueCollection PropValues = Path.Properties["MimeMap"]; IISOle.MimeMap MimeTypeObj; foreach (var item in PropValues) { ...

how to iterate over non-English file names in PHP

I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7. I want to list the filename and their content using PHP. Currently I am using DirectoryIterator and file_get_contents. This works for English files names but not for non-English (chinese) file names. For example, I have fi...

Active Directory Is User Deactivated Code Snippet Needed?

Can some post the way to know if a particular user is a deactivated user in the windows ad ? ...

How to programmatically RESUME IIS website?

I'm using the following code to start website when it is stopped. DirectoryEntry DE = new DirectoryEntry(string.Format("IIS://localhost/W3SVC/{0}", siteID)); if ((Int32)DE.InvokeGet("ServerState") != MD_SERVER_STATE_STARTED) DE.Invoke("Start"); But it works only if the website is stopped and not works if it is PAUSED. How can i s...

finding out if user used for DirectoryEntry connection is an administrator.

Hi, I have an existing DirectoryEntry connection and I want to check if the user that was used for the creation of this DirectoryEntry belongs to a specific group. anyone knows how to achieve this? Thanks, Shuky ...

Administrative Limit Exceeded During C# LDAP Search

I am trying to do a LDAP Search however I keep getting the following error: Unhandled Exception: System.Runtime.InteropServices.COMException (0x80072024): T he administrative limit for this request was exceeded. at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext () at System.DirectoryServices.DirectoryS...

How to list available ADSI (Active Directory Service Interfaces) service providers?

How can I list available ADSI (Active Directory Service Interfaces) service providers in C#? ...

How to add a new Windows user to the Users group by default

I have a piece of code that creates a Windows user. Everything is fine and the user is indeed created. However, when I try to pinvoke LoadUserProfile, the operation fails, because the user is not in the Users group. Now, I know how to pragmatically add this user to the Users group, but I dont want to hard-code group name "Users", since i...

When you set a web directory property "AuthNTLM" using the DirectoryEntry object, what IIS setting are you actually changing?

I'm in task of migrating our product's installer from InstallShield to WiX. To deploy web applications, the previous developers used Custom Actions (written in C#) in InstallShield. In Wix, this is no longer necessary because wix supports IIS deployment. Anyway, one of the code in the Custom Action uses the DirectoryEntry object to set...

Force local user to change password at next login with C#

I'm writing a function for a web app in ASP.NET where the client logs into the server machine, which is Windows authenticated against the local users on the server. The function I am writing resets the users password and emails them the new one. I do this like so: String userPath = "WinNT://" + Environment.MachineName + "/" + username....

Verify if password is correct

i need to verify if the password is correct for a user. i have this code: private bool checkOldPasswordValid(string password, string username) { using (DirectoryEntry entry = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer")) { entry.Username = username; entry.Password =...