Hi Jerry,
I think you can get the property of Active Directory object through
ADSI(active directory service interface).
In .Net, it is replaced by System.DirectoryServices namespace.
You can get more information from the two sample below:
http://www.codeproject.com/dotnet/activedirquery.asp?target=active+directory
%7Cobject%7Cproperty
http://www.codeproject.com/aspnet/adsi1.asp?target=active+directory|object
%7Cproperty
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "JerryP" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
| Subject: Re: Launching Directory Properties and UserProfile Properties
from C#
| Date: Thu, 18 Sep 2003 08:15:37 +0200
| Lines: 193
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#
[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: blueice1x.de.ibm.com 194.196.100.75
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:185709
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Jeffrey,
|
| thank you very much - I will try that.
|
| Just one Question left, Is there also a way to do similar for Active
| Directory Objects ?
|
| again - thank you !
|
| Jerry
|
|
| | >
| > Hi Jerry,
| >
| > Sorry for letting you waitting for so long time.
| > To invoke the "properties" verb on a file, you must set the
| > SEE_MASK_INVOKEIDLIST
| > to SHELLEXECUTEINFO's fMask field of ShellExecuteEx function.
| >
| > I write a sample code for you to launch the property dialog.
| >
| > public const int SEE_MASK_INVOKEIDLIST = 0xC;
| >
| > [StructLayout(LayoutKind.Explicit)]
| > public struct DUMMYUNIONNAME
| > {
| > [FieldOffset(0)]
| > public IntPtr hIcon;
| > [FieldOffset(0)]
| > public IntPtr hMonitor;
| > }
| >
| > [StructLayout(LayoutKind.Sequential )]
| > public struct SHELLEXECUTEINFO
| > {
| > public int cbSize;
| > public int fMask;
| > public IntPtr hwnd;
| > public string lpVerb;
| > public string lpFile;
| > public string lpParameters;
| > public string lpDirectory;
| > public int nShow;
| > public IntPtr hInstApp;
| > public int lpIDList;
| > public string lpClass;
| > public int hkeyClass;
| > public int dwHotKey;
| > public DUMMYUNIONNAME dun;
| > public IntPtr hProcess;
| > }
| >
| > [DllImport("shell32.dll")]
| > public static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO si);
| >
| > SHELLEXECUTEINFO si=new SHELLEXECUTEINFO();
| > si.cbSize=Marshal.SizeOf(typeof(SHELLEXECUTEINFO));
| > si.lpFile="D:\\Jeffrey";
| > si.lpVerb="properties";
| > si.fMask =SEE_MASK_INVOKEIDLIST;
| > ShellExecuteEx(ref si);
| >
| > It works well on my machine.
| > Hope this helps,
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! -
www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "JerryP" <
[email protected]>
| > | References: <
[email protected]>
| > <
[email protected]>
| > | Subject: Re: Launching Directory Properties and UserProfile Properties
| > from C#
| > | Date: Tue, 16 Sep 2003 09:11:35 +0200
| > | Lines: 81
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: blueice1x.de.ibm.com 194.196.100.75
| > | Path:
| >
|
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.
| > phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: cpmsftngxa07.phx.gbl
| microsoft.public.dotnet.languages.csharp:184451
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Jeffrey,
| > |
| > | from my code I do the following:
| > | create a directory
| > | create a user (local or AD - depends on environmnet)
| > | share the created directory
| > | set permissions (just created account on just created share)
| > |
| > | and then I want to display the directory Properties window to the
user -
| > if
| > | he likes to add some permissions, I also
| > | want to show the User Object to also enable the user to change
| everything
| > he
| > | wants.
| > |
| > | I just set what my app needs from code - any other thing the user must
| do
| > | himself - why should I code everything again - MS did this already
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
| > |
| > | Hope you understand what I am trying to do,.....
| > |
| > | thanks
| > |
| > | Jerry
| > |
| > |
| > | | > | >
| > | > Hi JerryP,
| > | >
| > | > Thank you for posting in this group.
| > | > Can you tell me what task you want to finish?
| > | > I think you can get most property of a certain folder by WindowAPI
| > | function
| > | > or WMI.
| > | > Also, you can refer to System.DirectoryServices namespace to invoke
| the
| > | > ADSI to get the
| > | > property of the AD object.
| > | >
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! -
www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "JerryP" <
[email protected]>
| > | > | Subject: Launching Directory Properties and UserProfile Properties
| > from
| > | C#
| > | > | Date: Mon, 15 Sep 2003 14:43:29 +0200
| > | > | Lines: 11
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <
[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: blueice1x.de.ibm.com 194.196.100.75
| > | > | Path:
| > | >
| > |
| >
|
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
| > | > phx.gbl!TK2MSFTNGP10.phx.gbl
| > | > | Xref: cpmsftngxa07.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:184178
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | Hello,
| > | > |
| > | > | is there a way to launch the property dialogue for a directory
from
| my
| > | c#
| > | > | app ?
| > | > | I would also like to launch the User Account Properties from
Active
| > | > | Directory Users and Computers, and the properties window for an
| Object
| > | in
| > | > | Active Directory.
| > | > |
| > | > | Thanks for any hints.
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|