473,396 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DirectoryEntry and msRADIUSFramedIPAddress

Hello,
I would like create a simple user and setting a static IP to him. but every time I try to set msRADIUSFramedIPAddress property i have this message of error:
System.Runtime.InteropServices.COMException (0x8000500F): The directory property cannot be found in the cache.
Please help me (and sorry my english).

Expand|Select|Wrap|Line Numbers
  1.  public void createNewUser(String userName,String Password,String staticIp)
  2.         {
  3.             try
  4.             {
  5.                 string s_Username = userName;
  6.                 string s_Password = Password;
  7.                 string s_Description = "Test User Account";
  8.  
  9.                 DirectoryEntry AD = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
  10.                 // create a new user
  11.                 DirectoryEntry NewUser = AD.Children.Add(s_Username, "user");
  12.                 // set the properties
  13.                 NewUser.Invoke("SetPassword", new object[] { s_Password });
  14.                 NewUser.Invoke("Put", new object[] { "Description", s_Description });
  15.                  NewUser.Properties["msRADIUSFramedIPAddress"].Add(staticIp);           
  16.  
  17.                 // commit the changes
  18.                 NewUser.CommitChanges();
  19.                 txtResult.Text = "Success!!";
  20.             }
  21.             catch (Exception err)
  22.             {
  23.                 // set the error message
  24.                 txtResult.Text = err.ToString();
  25.             }
  26.         }
  27.  
Davide
Oct 20 '10 #1
0 1190

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Querton Pierre-Benoit | last post by:
Hello, I develop a class to control IIS throw ADSI. But is seems that some method doesn't work with IIS. To be more clear ;) When I do the following code : DirectoryEntry w3svc = new...
2
by: Jessica | last post by:
When I create a single LDAP ActiveDirectory user and use DirectoryEntry.Invoke("SetPassword"...), the user is created and the password is set with no problems. However, when I try to add more...
2
by: Jay | last post by:
Please excuse the double post if your reader shows this as a new and as a reply. I can only use the web interface and it puts my reply 34 pages in. I am getting an error while trying to do a...
2
by: AbdSol | last post by:
I wanted to know why the output is different & also like to know if C# i can get the user name using DirectoryEntry > find. C# String myADSPath = ("WinNT://"+...
1
by: kenguil | last post by:
I'm hoping that this is the right group to post this to and that someone will have an answer to this. Environment: 1) Laptop joined to domain "foo.com", logged in using cached credentials 2)...
2
by: Chad Beckner | last post by:
Hi everyone, Sorry for cross posting, but I wanted to try and put this where it would be more visible to everyone... :-) I need to find a way to be able to search for entries in our ADS tree. ...
0
by: Mik | last post by:
Hi I am struggling to make a Web site/Web Directory copy work. I am using the System.DirectoryServices to connect to my localhost machine. There I have two web sites: Mysite1 (siteno 1) and...
6
by: huzz | last post by:
How do i create a directory entry to access a user's details such as their email address. Here are the object structure. domain.co.uk | |Computer Services - Type (OU) | |Cliff Saran - Type...
1
by: Magnus R | last post by:
In VB.Net I'm trying to find out the names of what Administrative Groups exist by querying Active Directory. The problem is when I try and query the children of the key LDAP://CN=Administrative...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.