i have a home and a work account - dont know how i managed that! :)
lane0p2
Posts
-
DomainController() is inaccessible due to its protection level?? -
DomainController() is inaccessible due to its protection level??Hi Guys, i'm trying to use the DomainController class to access the metadata of an OU, but i keep getting: "'System.DirectoryServices.ActiveDirectory.DomainController.DomainController()' is inaccessible due to its protection level" any ideas on how i can change this access level? i can access the classes with the DirectoryServices namespace, it just seems to be the ActiveDirectory namespace in struggling with! sorry if this is dumb question, i'm a newbie! Many Thanks, Phil
-
underline just one word within a lablei don't suppose you know of any good tutorials on this?
-
underline just one word within a lablethanks for your help.
-
underline just one word within a lableHi guys, does anyone know how to underline just one word within a lable?
-
skipping access denied folders when using GetDirectories()Cool, thanks guy, i thought there would be an easy option!!
-
skipping access denied folders when using GetDirectories()Hi all, i can use something like the code below to get all the directory within a given folder. DirectoryInfo di = new DirectoryInfo(@"C:\"); foreach (DirectoryInfo d in di.GetDirectories("*.*", SearchOption.AllDirectories)) { Console.WriteLine(d.Name); } but as soon as i hit a folder i dont have access to it crashes. is there anyway i can perform the same action but get it to skip folder i don't have access too? Many Thanks, Phil
-
Event log query... very odd!there is!! i was looking at the eventviewer and ended up testing loads of ID but only 1394 failed. i just can't figure it out!
-
Event log query... very odd!Hi All, i have a code (below), it take 2 variables, the first being the server name and the second being the eventID to look for in the Directory Service eventlog. it seems to work fine for all eventID's except the one im looking for - 1394, where it always shows nothing!! any ideas? EventLog el = new EventLog("Directory Service", args[0].ToString()); foreach(EventLogEntry i in el.Entries) { if(Convert.ToInt32(i.EventID) == Convert.ToInt32(args[1])) { Console.WriteLine(i.EventID.ToString() + " - " + i.TimeWritten.ToShortDateString()); } }
-
assigning ownership of files and folders???Hi All, does anyone know how to assign ownership of files and folders? i have the code to take ownership myself, but can't figure out how to assign ownership to someone else - but i can in the GUI(Vista)!! There are other 3rd party apps which can do it (setowner.exe) but i wanted to build my own so i can have extra functionality. i have found this article: "One of the security constraints of NTFS/NT is that you are only allowed to set the owner of a file to yourself (e.g. "take ownership") or to the "Administrators" group. However, there is a "side entrance" whereby you can assign any arbitrary user as the owner, even if they're not an administrator. This is a privilege that is *granted* to administrators and backup operators, but NOT *enabled* by default. So, how do you enable this? Unfortunately there is no native .NET way to do this" so my question is, does someone know how to make C# do this? Many Thanks, Phil
-
otherWellKnownObjectsHi all, i'm trying to create a OU in AD to have a otherWellKnownObjects attribute. i can access the OU fine while connecting to it normally. but as soon as i try to access it via the otherWellKnownObjects attribute i get the error - "There is no such object on the server" and when i check the attribute in AD is it no longer set to null but i am unable to view its value! any ideas? Many thanks, Phil.
-
connecting to the Deleted Objects container in ADHi All, i'm trying to connect to the Deleted objects container in AD by using: DirectoryEntry de = new DirectoryEntry("LDAP://CN=Deleted Objects,DC=domain,DC=com") and it is retuning with an error saying - There is no such object on the sever. but i can see it when i use LDP!! can anyone help? Many Thanks, phil
-
How to use a COM Interface Dll within C# code???hello, done it! when debugging i could see all the entries in IPGrant, the problem was converting the object array into a string array, i managed this with: ExIpSecurity ipsec = new ExIpSecurity(); ipsec.BindToSmtpVsi(someSMTPserver, 1, "someDC"); ipsec.GetRelayIpList(); object[] o = (object[])ipsec.IPGrant; string[] s = new string[o.Length]; Array arr = s; o.CopyTo(arr, 0); s = (string[])arr; foreach (string i in s) { sw.WriteLine(i); } thanks for your help mate, have a good weekend. Phil
-
How to use a COM Interface Dll within C# code???the lines in the VB script are: Set objDsIpSec = CreateObject("ExIpSec.ExIpSecurity") objDsIpSec.BindToSmtpVsi "someSMTPserver", 1, "someDC" objDsIpSec.GetRelayIpList listToDisplayIp = objDsIpSec.IpGrant listToDisplayIp appears to be a string array. the lines in using in C# are: ExIpSecurity ipsec = new ExIpSecurity(); string[] s; ipsec.BindToSmtpVsi("someSMTPserver", 1, "someDC"); ipsec.GetRelayIpList(); s = ipsec.IPGrant.ToString().Split(' '); foreach (string i in s) { MessageBox.Show(i.ToString()); } if i run the VB script i get a list of IP address but if i run the C# code i get one popup box saying System.Object[] what am i doing wrong?
-
How to use a COM Interface Dll within C# code???Hi All, i'm try to take the VB script and Dll in this article http://support.microsoft.com/kb/935635 and make the functionality work with C#. i can add the ExIpSec.dll type library and with the using statement (using EXIPSECLib) i can expose the Interfaces and i can some of them to work. but when i try to retrieve the list if IP addresses i just get System.object[]. i have tried converting this to a string[] but i get nothing back. can anyone tell how to correct call this dll? - DllImport does seem to work either!! Many Thanks, Phil
-
Add Active Directory User to Local GroupLDAP string - LDAP://CN=Administrator,CN=Users,DC=aDomain,DC=com userDN - CN=aUser,CN=Users,DC=aDomain,DC=com DN means distinguishedName cool?
-
Converting an Octet string into a stringHi Curtis, this has been a great help, and even though i understand it all much better. i still can't find the Entrypoints for the Dll. i have tried using Link /dump /exports dllname.dll and this doesn't return anything that is used in the VB script. i have used COM browser and this shows more details, but when i use these details in the C# code it return a unable to find an entry point exception. sorry to be a pain, could you help further? Many Thanks, Phil
-
Converting an Octet string into a stringHi Curtis, this is just what i'm looking for. although the VB script calls the dll. do you know how i could use DLLImport to make calls this this dll? sorry for the questions, i'm a newbie at this!! thanks is advance! Phil
-
Converting an Octet string into a stringHi, im trying to convert the octet string (msExchSmtpRelayIpList) and convert into a list of IP addresses. i have tried various things but just get random numbers that don't relate to IP addresses!! can anyone help me? Many Thanks, Phil
-
each button click starting a new threadHi, thanks for replying so quickly. the problem is it won't compile. it errors saying - No overload for button1_Click matches delegate 'System.Threading.ThreadStart.